From eb91c9a5c76f4e8ed27ead0d97ca02efbba2dcd1 Mon Sep 17 00:00:00 2001 From: Lucas Brendel Date: Sun, 21 Nov 2021 12:53:51 -0600 Subject: [PATCH] generated with new verison of svd2rust (#30) --- Cargo.toml | 4 +- src/can.rs | 138 +-- src/can/clc.rs | 130 +- src/can/fdr.rs | 238 +++- src/can/id.rs | 88 +- src/can/list.rs | 100 +- src/can/mcr.rs | 90 +- src/can/mitr.rs | 51 +- src/can/msid.rs | 50 +- src/can/msimask.rs | 90 +- src/can/mspnd.rs | 92 +- src/can/panctr.rs | 166 ++- src/can_mo0.rs | 129 +- src/can_mo0/moamr.rs | 116 +- src/can_mo0/moar.rs | 146 ++- src/can_mo0/moctr.rs | 143 ++- src/can_mo0/modatah.rs | 150 ++- src/can_mo0/modatal.rs | 150 ++- src/can_mo0/mofcr.rs | 407 ++++-- src/can_mo0/mofgpr.rs | 150 ++- src/can_mo0/moipr.rs | 180 ++- src/can_mo0/mostat.rs | 297 ++++- src/can_node0.rs | 91 +- src/can_node0/nbtr.rs | 176 ++- src/can_node0/ncr.rs | 266 ++-- src/can_node0/necnt.rs | 166 ++- src/can_node0/nfcr.rs | 204 ++- src/can_node0/nipr.rs | 210 +++- src/can_node0/npcr.rs | 116 +- src/can_node0/nsr.rs | 268 +++- src/ccu40.rs | 105 +- src/ccu40/ecrd.rs | 127 +- src/ccu40/gcsc.rs | 111 +- src/ccu40/gcss.rs | 111 +- src/ccu40/gcst.rs | 313 ++++- src/ccu40/gctrl.rs | 312 +++-- src/ccu40/gidlc.rs | 67 +- src/ccu40/gidls.rs | 71 +- src/ccu40/gstat.rs | 123 +- src/ccu40/midr.rs | 81 +- src/ccu40_cc40.rs | 316 ++--- src/ccu40_cc40/c0v.rs | 83 +- src/ccu40_cc40/c1v.rs | 83 +- src/ccu40_cc40/c2v.rs | 83 +- src/ccu40_cc40/c3v.rs | 83 +- src/ccu40_cc40/cmc.rs | 398 ++++-- src/ccu40_cc40/cr.rs | 49 +- src/ccu40_cc40/crs.rs | 90 +- src/ccu40_cc40/dit.rs | 65 +- src/ccu40_cc40/dits.rs | 90 +- src/ccu40_cc40/fpc.rs | 106 +- src/ccu40_cc40/fpcs.rs | 90 +- src/ccu40_cc40/ins.rs | 490 +++++--- src/ccu40_cc40/inte.rs | 252 ++-- src/ccu40_cc40/ints.rs | 175 ++- src/ccu40_cc40/pr.rs | 49 +- src/ccu40_cc40/prs.rs | 90 +- src/ccu40_cc40/psc.rs | 90 +- src/ccu40_cc40/psl.rs | 96 +- src/ccu40_cc40/srs.rs | 220 +++- src/ccu40_cc40/swr.rs | 79 +- src/ccu40_cc40/sws.rs | 79 +- src/ccu40_cc40/tc.rs | 567 ++++++--- src/ccu40_cc40/tcclr.rs | 59 +- src/ccu40_cc40/tcset.rs | 51 +- src/ccu40_cc40/tcst.rs | 69 +- src/ccu40_cc40/timer.rs | 90 +- src/ccu80.rs | 118 +- src/ccu80/ecrd.rs | 127 +- src/ccu80/gcsc.rs | 127 +- src/ccu80/gcss.rs | 127 +- src/ccu80/gcst.rs | 381 +++++- src/ccu80/gctrl.rs | 312 +++-- src/ccu80/gidlc.rs | 71 +- src/ccu80/gidls.rs | 75 +- src/ccu80/gpchk.rs | 302 +++-- src/ccu80/gstat.rs | 141 ++- src/ccu80/midr.rs | 81 +- src/ccu80_cc80.rs | 405 ++---- src/ccu80_cc80/c0v.rs | 83 +- src/ccu80_cc80/c1v.rs | 83 +- src/ccu80_cc80/c2v.rs | 83 +- src/ccu80_cc80/c3v.rs | 83 +- src/ccu80_cc80/chc.rs | 200 ++- src/ccu80_cc80/cmc.rs | 398 ++++-- src/ccu80_cc80/cr1.rs | 49 +- src/ccu80_cc80/cr1s.rs | 90 +- src/ccu80_cc80/cr2.rs | 49 +- src/ccu80_cc80/cr2s.rs | 90 +- src/ccu80_cc80/dc1r.rs | 108 +- src/ccu80_cc80/dc2r.rs | 108 +- src/ccu80_cc80/dit.rs | 65 +- src/ccu80_cc80/dits.rs | 90 +- src/ccu80_cc80/dtc.rs | 256 ++-- src/ccu80_cc80/fpc.rs | 106 +- src/ccu80_cc80/fpcs.rs | 90 +- src/ccu80_cc80/ins.rs | 490 +++++--- src/ccu80_cc80/inte.rs | 304 +++-- src/ccu80_cc80/ints.rs | 211 +++- src/ccu80_cc80/pr.rs | 49 +- src/ccu80_cc80/prs.rs | 90 +- src/ccu80_cc80/psc.rs | 90 +- src/ccu80_cc80/psl.rs | 174 ++- src/ccu80_cc80/srs.rs | 250 ++-- src/ccu80_cc80/stc.rs | 131 +- src/ccu80_cc80/swr.rs | 87 +- src/ccu80_cc80/sws.rs | 87 +- src/ccu80_cc80/tc.rs | 744 +++++++---- src/ccu80_cc80/tcclr.rs | 67 +- src/ccu80_cc80/tcset.rs | 51 +- src/ccu80_cc80/tcst.rs | 105 +- src/ccu80_cc80/timer.rs | 90 +- src/dac.rs | 154 +-- src/dac/dac01data.rs | 108 +- src/dac/dac0cfg0.rs | 302 +++-- src/dac/dac0cfg1.rs | 321 +++-- src/dac/dac0data.rs | 90 +- src/dac/dac0path.rs | 130 +- src/dac/dac0patl.rs | 190 ++- src/dac/dac1cfg0.rs | 302 +++-- src/dac/dac1cfg1.rs | 295 +++-- src/dac/dac1data.rs | 90 +- src/dac/dac1path.rs | 130 +- src/dac/dac1patl.rs | 190 ++- src/dac/id.rs | 81 +- src/dlr.rs | 50 +- src/dlr/lnen.rs | 278 +++-- src/dlr/ovrclr.rs | 79 +- src/dlr/ovrstat.rs | 161 ++- src/dlr/srsel0.rs | 230 +++- src/eru0.rs | 45 +- src/eru0/exicon.rs | 323 +++-- src/eru0/exisel.rs | 310 +++-- src/eru0/exocon.rs | 280 +++-- src/fce.rs | 26 +- src/fce/clc.rs | 106 +- src/fce/id.rs | 81 +- src/fce_ke0.rs | 102 +- src/fce_ke0/cfg.rs | 304 +++-- src/fce_ke0/check.rs | 90 +- src/fce_ke0/crc.rs | 90 +- src/fce_ke0/ctr.rs | 130 +- src/fce_ke0/ir.rs | 90 +- src/fce_ke0/length.rs | 90 +- src/fce_ke0/res.rs | 49 +- src/fce_ke0/sts.rs | 150 ++- src/flash0.rs | 87 +- src/flash0/fcon.rs | 443 ++++--- src/flash0/fsr.rs | 391 ++++-- src/flash0/id.rs | 81 +- src/flash0/marp.rs | 131 +- src/flash0/procon0.rs | 213 +++- src/flash0/procon1.rs | 195 ++- src/flash0/procon2.rs | 195 ++- src/generic.rs | 289 +++-- src/gpdma0.rs | 448 ++----- src/gpdma0/chenreg.rs | 105 +- src/gpdma0/clearblock.rs | 111 +- src/gpdma0/cleardsttran.rs | 111 +- src/gpdma0/clearerr.rs | 111 +- src/gpdma0/clearsrctran.rs | 111 +- src/gpdma0/cleartfr.rs | 111 +- src/gpdma0/dmacfgreg.rs | 96 +- src/gpdma0/id.rs | 49 +- src/gpdma0/lstdstreg.rs | 342 +++-- src/gpdma0/lstsrcreg.rs | 342 +++-- src/gpdma0/maskblock.rs | 342 +++-- src/gpdma0/maskdsttran.rs | 342 +++-- src/gpdma0/maskerr.rs | 342 +++-- src/gpdma0/masksrctran.rs | 342 +++-- src/gpdma0/masktfr.rs | 342 +++-- src/gpdma0/rawblock.rs | 230 +++- src/gpdma0/rawdsttran.rs | 230 +++- src/gpdma0/rawerr.rs | 230 +++- src/gpdma0/rawsrctran.rs | 230 +++- src/gpdma0/rawtfr.rs | 230 +++- src/gpdma0/reqdstreg.rs | 294 +++-- src/gpdma0/reqsrcreg.rs | 294 +++-- src/gpdma0/sglreqdstreg.rs | 294 +++-- src/gpdma0/sglreqsrcreg.rs | 294 +++-- src/gpdma0/statusblock.rs | 161 ++- src/gpdma0/statusdsttran.rs | 161 ++- src/gpdma0/statuserr.rs | 161 ++- src/gpdma0/statusint.rs | 113 +- src/gpdma0/statussrctran.rs | 161 ++- src/gpdma0/statustfr.rs | 161 ++- src/gpdma0/type_.rs | 49 +- src/gpdma0/version.rs | 49 +- src/gpdma0_ch0.rs | 185 +-- src/gpdma0_ch0/cfgh.rs | 222 +++- src/gpdma0_ch0/cfgl.rs | 408 ++++-- src/gpdma0_ch0/ctlh.rs | 110 +- src/gpdma0_ch0/ctll.rs | 352 ++++-- src/gpdma0_ch0/dar.rs | 90 +- src/gpdma0_ch0/dsr.rs | 108 +- src/gpdma0_ch0/dstat.rs | 90 +- src/gpdma0_ch0/dstatar.rs | 90 +- src/gpdma0_ch0/llp.rs | 90 +- src/gpdma0_ch0/sar.rs | 90 +- src/gpdma0_ch0/sgr.rs | 108 +- src/gpdma0_ch0/sstat.rs | 90 +- src/gpdma0_ch0/sstatar.rs | 90 +- src/gpdma0_ch2.rs | 84 +- src/gpdma0_ch2/cfgh.rs | 182 ++- src/gpdma0_ch2/cfgl.rs | 368 ++++-- src/gpdma0_ch2/ctlh.rs | 110 +- src/gpdma0_ch2/ctll.rs | 260 +++- src/gpdma0_ch2/dar.rs | 90 +- src/gpdma0_ch2/sar.rs | 90 +- src/hrpwm0.rs | 203 +-- src/hrpwm0/csgcfg.rs | 235 +++- src/hrpwm0/csgclrg.rs | 83 +- src/hrpwm0/csgfcg.rs | 107 +- src/hrpwm0/csgfsg.rs | 141 ++- src/hrpwm0/csgsetg.rs | 83 +- src/hrpwm0/csgstatg.rs | 195 ++- src/hrpwm0/csgtrc.rs | 59 +- src/hrpwm0/csgtrg.rs | 71 +- src/hrpwm0/csgtrsg.rs | 141 ++- src/hrpwm0/glbana.rs | 256 +++- src/hrpwm0/hrbsc.rs | 129 +- src/hrpwm0/hrccfg.rs | 343 +++-- src/hrpwm0/hrcctrg.rs | 79 +- src/hrpwm0/hrcstrg.rs | 79 +- src/hrpwm0/hrcstsg.rs | 177 ++- src/hrpwm0/hrghrs.rs | 51 +- src/hrpwm0/midr.rs | 81 +- src/hrpwm0_csg0.rs | 198 +-- src/hrpwm0_csg0/blv.rs | 90 +- src/hrpwm0_csg0/cc.rs | 411 ++++-- src/hrpwm0_csg0/dci.rs | 234 +++- src/hrpwm0_csg0/dsv1.rs | 49 +- src/hrpwm0_csg0/dsv2.rs | 90 +- src/hrpwm0_csg0/ies.rs | 225 +++- src/hrpwm0_csg0/istat.rs | 195 ++- src/hrpwm0_csg0/pc.rs | 49 +- src/hrpwm0_csg0/plc.rs | 281 +++-- src/hrpwm0_csg0/sc.rs | 462 ++++--- src/hrpwm0_csg0/sdsv1.rs | 90 +- src/hrpwm0_csg0/spc.rs | 90 +- src/hrpwm0_csg0/sre.rs | 250 +++- src/hrpwm0_csg0/srs.rs | 280 +++-- src/hrpwm0_csg0/swc.rs | 83 +- src/hrpwm0_csg0/sws.rs | 83 +- src/hrpwm0_hrc0.rs | 172 +-- src/hrpwm0_hrc0/cr1.rs | 49 +- src/hrpwm0_hrc0/cr2.rs | 49 +- src/hrpwm0_hrc0/dcf.rs | 49 +- src/hrpwm0_hrc0/dcr.rs | 49 +- src/hrpwm0_hrc0/gc.rs | 338 +++-- src/hrpwm0_hrc0/gsel.rs | 454 ++++--- src/hrpwm0_hrc0/pl.rs | 122 +- src/hrpwm0_hrc0/sc.rs | 51 +- src/hrpwm0_hrc0/scr1.rs | 90 +- src/hrpwm0_hrc0/scr2.rs | 90 +- src/hrpwm0_hrc0/sdcf.rs | 90 +- src/hrpwm0_hrc0/sdcr.rs | 90 +- src/hrpwm0_hrc0/ssc.rs | 96 +- src/hrpwm0_hrc0/tsel.rs | 200 ++- src/ledts0.rs | 141 +-- src/ledts0/evfr.rs | 160 ++- src/ledts0/fnctl.rs | 407 ++++-- src/ledts0/globctl.rs | 347 ++++-- src/ledts0/id.rs | 81 +- src/ledts0/ldcmp0.rs | 150 ++- src/ledts0/ldcmp1.rs | 150 ++- src/ledts0/line0.rs | 150 ++- src/ledts0/line1.rs | 150 ++- src/ledts0/tscmp0.rs | 150 ++- src/ledts0/tscmp1.rs | 150 ++- src/ledts0/tsval.rs | 106 +- src/lib.rs | 1994 +++++++++++++++++++++++------- src/pba0.rs | 24 +- src/pba0/sts.rs | 96 +- src/pba0/waddr.rs | 49 +- src/pmu0.rs | 11 +- src/pmu0/id.rs | 81 +- src/port0.rs | 147 +-- src/port0/hwsel.rs | 630 ++++++---- src/port0/in_.rs | 321 ++++- src/port0/iocr0.rs | 450 ++++--- src/port0/iocr4.rs | 450 ++++--- src/port0/iocr8.rs | 450 ++++--- src/port0/omr.rs | 175 +-- src/port0/out.rs | 486 +++++--- src/port0/pdisc.rs | 321 ++++- src/port0/pdr0.rs | 230 +++- src/port0/pdr1.rs | 230 +++- src/port0/pps.rs | 486 +++++--- src/port1.rs | 160 +-- src/port1/hwsel.rs | 630 ++++++---- src/port1/in_.rs | 321 ++++- src/port1/iocr0.rs | 450 ++++--- src/port1/iocr12.rs | 450 ++++--- src/port1/iocr4.rs | 450 ++++--- src/port1/iocr8.rs | 450 ++++--- src/port1/omr.rs | 175 +-- src/port1/out.rs | 486 +++++--- src/port1/pdisc.rs | 321 ++++- src/port1/pdr0.rs | 230 +++- src/port1/pdr1.rs | 230 +++- src/port1/pps.rs | 486 +++++--- src/port14.rs | 134 +- src/port14/hwsel.rs | 630 ++++++---- src/port14/in_.rs | 321 ++++- src/port14/iocr0.rs | 450 ++++--- src/port14/iocr12.rs | 450 ++++--- src/port14/iocr4.rs | 450 ++++--- src/port14/iocr8.rs | 450 ++++--- src/port14/omr.rs | 175 +-- src/port14/out.rs | 486 +++++--- src/port14/pdisc.rs | 486 +++++--- src/port14/pps.rs | 486 +++++--- src/port2.rs | 160 +-- src/port2/hwsel.rs | 630 ++++++---- src/port2/in_.rs | 321 ++++- src/port2/iocr0.rs | 450 ++++--- src/port2/iocr12.rs | 450 ++++--- src/port2/iocr4.rs | 450 ++++--- src/port2/iocr8.rs | 450 ++++--- src/port2/omr.rs | 175 +-- src/port2/out.rs | 486 +++++--- src/port2/pdisc.rs | 321 ++++- src/port2/pdr0.rs | 230 +++- src/port2/pdr1.rs | 230 +++- src/port2/pps.rs | 486 +++++--- src/port3.rs | 108 +- src/port3/hwsel.rs | 630 ++++++---- src/port3/in_.rs | 321 ++++- src/port3/iocr0.rs | 450 ++++--- src/port3/omr.rs | 175 +-- src/port3/out.rs | 486 +++++--- src/port3/pdisc.rs | 321 ++++- src/port3/pdr0.rs | 230 +++- src/port3/pps.rs | 486 +++++--- src/posif0.rs | 233 +--- src/posif0/halp.rs | 65 +- src/posif0/halps.rs | 108 +- src/posif0/mcm.rs | 49 +- src/posif0/mcmc.rs | 55 +- src/posif0/mcmf.rs | 51 +- src/posif0/mcms.rs | 59 +- src/posif0/mcsm.rs | 90 +- src/posif0/midr.rs | 81 +- src/posif0/pconf.rs | 528 +++++--- src/posif0/pdbg.rs | 145 ++- src/posif0/pflg.rs | 195 ++- src/posif0/pflge.rs | 538 +++++--- src/posif0/prun.rs | 51 +- src/posif0/prunc.rs | 55 +- src/posif0/pruns.rs | 51 +- src/posif0/psus.rs | 130 +- src/posif0/qdc.rs | 201 ++- src/posif0/rpflg.rs | 83 +- src/posif0/spflg.rs | 83 +- src/ppb.rs | 1114 ++++------------- src/ppb/actlr.rs | 170 ++- src/ppb/afsr.rs | 90 +- src/ppb/aircr.rs | 144 ++- src/ppb/bfar.rs | 90 +- src/ppb/ccr.rs | 226 +++- src/ppb/cfsr.rs | 564 ++++++--- src/ppb/cpacr.rs | 140 ++- src/ppb/cpuid.rs | 141 ++- src/ppb/fpcar.rs | 90 +- src/ppb/fpccr.rs | 304 +++-- src/ppb/fpdscr.rs | 150 ++- src/ppb/hfsr.rs | 142 ++- src/ppb/icsr.rs | 234 +++- src/ppb/mmfar.rs | 90 +- src/ppb/mpu_ctrl.rs | 148 ++- src/ppb/mpu_rasr.rs | 267 +++- src/ppb/mpu_rasr_a1.rs | 267 +++- src/ppb/mpu_rasr_a2.rs | 267 +++- src/ppb/mpu_rasr_a3.rs | 267 +++- src/ppb/mpu_rbar.rs | 136 +- src/ppb/mpu_rbar_a1.rs | 136 +- src/ppb/mpu_rbar_a2.rs | 136 +- src/ppb/mpu_rbar_a3.rs | 136 +- src/ppb/mpu_rnr.rs | 90 +- src/ppb/mpu_type.rs | 81 +- src/ppb/nvic_iabr0.rs | 101 +- src/ppb/nvic_iabr1.rs | 101 +- src/ppb/nvic_iabr2.rs | 101 +- src/ppb/nvic_iabr3.rs | 101 +- src/ppb/nvic_icer0.rs | 101 +- src/ppb/nvic_icer1.rs | 101 +- src/ppb/nvic_icer2.rs | 101 +- src/ppb/nvic_icer3.rs | 101 +- src/ppb/nvic_icpr0.rs | 101 +- src/ppb/nvic_icpr1.rs | 101 +- src/ppb/nvic_icpr2.rs | 101 +- src/ppb/nvic_icpr3.rs | 101 +- src/ppb/nvic_ipr0.rs | 150 ++- src/ppb/nvic_ipr1.rs | 150 ++- src/ppb/nvic_ipr10.rs | 150 ++- src/ppb/nvic_ipr11.rs | 150 ++- src/ppb/nvic_ipr12.rs | 150 ++- src/ppb/nvic_ipr13.rs | 150 ++- src/ppb/nvic_ipr14.rs | 150 ++- src/ppb/nvic_ipr15.rs | 150 ++- src/ppb/nvic_ipr16.rs | 150 ++- src/ppb/nvic_ipr17.rs | 150 ++- src/ppb/nvic_ipr18.rs | 150 ++- src/ppb/nvic_ipr19.rs | 150 ++- src/ppb/nvic_ipr2.rs | 150 ++- src/ppb/nvic_ipr20.rs | 150 ++- src/ppb/nvic_ipr21.rs | 150 ++- src/ppb/nvic_ipr22.rs | 150 ++- src/ppb/nvic_ipr23.rs | 150 ++- src/ppb/nvic_ipr24.rs | 150 ++- src/ppb/nvic_ipr25.rs | 150 ++- src/ppb/nvic_ipr26.rs | 150 ++- src/ppb/nvic_ipr27.rs | 150 ++- src/ppb/nvic_ipr3.rs | 150 ++- src/ppb/nvic_ipr4.rs | 150 ++- src/ppb/nvic_ipr5.rs | 150 ++- src/ppb/nvic_ipr6.rs | 150 ++- src/ppb/nvic_ipr7.rs | 150 ++- src/ppb/nvic_ipr8.rs | 150 ++- src/ppb/nvic_ipr9.rs | 150 ++- src/ppb/nvic_iser0.rs | 101 +- src/ppb/nvic_iser1.rs | 101 +- src/ppb/nvic_iser2.rs | 101 +- src/ppb/nvic_iser3.rs | 101 +- src/ppb/nvic_ispr0.rs | 101 +- src/ppb/nvic_ispr1.rs | 101 +- src/ppb/nvic_ispr2.rs | 101 +- src/ppb/nvic_ispr3.rs | 101 +- src/ppb/scr.rs | 148 ++- src/ppb/shcsr.rs | 350 +++++- src/ppb/shpr1.rs | 130 +- src/ppb/shpr2.rs | 90 +- src/ppb/shpr3.rs | 108 +- src/ppb/stir.rs | 51 +- src/ppb/syst_calib.rs | 142 ++- src/ppb/syst_csr.rs | 168 ++- src/ppb/syst_cvr.rs | 90 +- src/ppb/syst_rvr.rs | 90 +- src/ppb/vtor.rs | 90 +- src/pref.rs | 13 +- src/pref/pcon.rs | 130 +- src/rtc.rs | 122 +- src/rtc/atim0.rs | 150 ++- src/rtc/atim1.rs | 108 +- src/rtc/clrsr.rs | 75 +- src/rtc/ctr.rs | 250 +++- src/rtc/id.rs | 81 +- src/rtc/msksr.rs | 210 +++- src/rtc/rawstat.rs | 145 ++- src/rtc/stssr.rs | 145 ++- src/rtc/tim0.rs | 150 ++- src/rtc/tim1.rs | 130 +- src/scu_clk.rs | 266 +--- src/scu_clk/ccuclkcr.rs | 96 +- src/scu_clk/cgatclr0.rs | 111 +- src/scu_clk/cgatclr1.rs | 87 +- src/scu_clk/cgatclr2.rs | 79 +- src/scu_clk/cgatset0.rs | 111 +- src/scu_clk/cgatset1.rs | 87 +- src/scu_clk/cgatset2.rs | 79 +- src/scu_clk/cgatstat0.rs | 177 ++- src/scu_clk/cgatstat1.rs | 123 +- src/scu_clk/cgatstat2.rs | 105 +- src/scu_clk/clkclr.rs | 71 +- src/scu_clk/clkset.rs | 71 +- src/scu_clk/clkstat.rs | 87 +- src/scu_clk/cpuclkcr.rs | 96 +- src/scu_clk/dsleepcr.rs | 252 ++-- src/scu_clk/extclkcr.rs | 129 +- src/scu_clk/mlinkclkcr.rs | 249 +++- src/scu_clk/pbclkcr.rs | 96 +- src/scu_clk/sleepcr.rs | 174 ++- src/scu_clk/sysclkcr.rs | 116 +- src/scu_clk/usbclkcr.rs | 116 +- src/scu_clk/wdtclkcr.rs | 125 +- src/scu_general.rs | 230 +--- src/scu_general/ccucon.rs | 174 ++- src/scu_general/dtempalarm.rs | 69 +- src/scu_general/dtemplim.rs | 108 +- src/scu_general/dtscon.rs | 184 ++- src/scu_general/dtsstat.rs | 85 +- src/scu_general/g0orcen.rs | 122 +- src/scu_general/g1orcen.rs | 122 +- src/scu_general/gpr0.rs | 90 +- src/scu_general/gpr1.rs | 90 +- src/scu_general/id.rs | 81 +- src/scu_general/idchip.rs | 49 +- src/scu_general/idmanuf.rs | 65 +- src/scu_general/mirrallreq.rs | 55 +- src/scu_general/mirrallstat.rs | 51 +- src/scu_general/mirrsts.rs | 393 ++++-- src/scu_general/rmacr.rs | 116 +- src/scu_general/rmdata.rs | 90 +- src/scu_general/stcon.rs | 147 ++- src/scu_hibernate.rs | 190 +-- src/scu_hibernate/hdclr.rs | 111 +- src/scu_hibernate/hdcr.rs | 554 ++++++--- src/scu_hibernate/hdset.rs | 111 +- src/scu_hibernate/hdstat.rs | 195 ++- src/scu_hibernate/hintclr.rs | 91 +- src/scu_hibernate/hintset.rs | 99 +- src/scu_hibernate/hintst.rs | 139 ++- src/scu_hibernate/lpacclr.rs | 79 +- src/scu_hibernate/lpacconf.rs | 220 +++- src/scu_hibernate/lpacset.rs | 79 +- src/scu_hibernate/lpacst.rs | 105 +- src/scu_hibernate/lpacth0.rs | 108 +- src/scu_hibernate/lpacth1.rs | 108 +- src/scu_hibernate/oscsictrl.rs | 96 +- src/scu_hibernate/osculctrl.rs | 126 +- src/scu_hibernate/osculstat.rs | 49 +- src/scu_interrupt.rs | 70 +- src/scu_interrupt/nmireqen.rs | 252 ++-- src/scu_interrupt/srclr.rs | 239 ++-- src/scu_interrupt/srmsk.rs | 694 +++++++---- src/scu_interrupt/srraw.rs | 459 +++++-- src/scu_interrupt/srset.rs | 239 ++-- src/scu_interrupt/srstat.rs | 459 +++++-- src/scu_osc.rs | 39 +- src/scu_osc/clkcalconst.rs | 90 +- src/scu_osc/oschpctrl.rs | 172 ++- src/scu_osc/oschpstat.rs | 49 +- src/scu_parity.rs | 93 +- src/scu_parity/mchkcon.rs | 252 ++-- src/scu_parity/peen.rs | 252 ++-- src/scu_parity/peflag.rs | 252 ++-- src/scu_parity/persten.rs | 96 +- src/scu_parity/pete.rs | 252 ++-- src/scu_parity/pmtpr.rs | 106 +- src/scu_parity/pmtsr.rs | 252 ++-- src/scu_pll.rs | 87 +- src/scu_pll/clkmxstat.rs | 60 +- src/scu_pll/pllcon0.rs | 308 +++-- src/scu_pll/pllcon1.rs | 150 ++- src/scu_pll/pllcon2.rs | 122 +- src/scu_pll/pllstat.rs | 195 ++- src/scu_pll/usbpllcon.rs | 270 ++-- src/scu_pll/usbpllstat.rs | 123 +- src/scu_power.rs | 72 +- src/scu_power/evrstat.rs | 51 +- src/scu_power/evrvadcstat.rs | 65 +- src/scu_power/pwrclr.rs | 71 +- src/scu_power/pwrmon.rs | 130 +- src/scu_power/pwrset.rs | 71 +- src/scu_power/pwrstat.rs | 87 +- src/scu_reset.rs | 132 +- src/scu_reset/prclr0.rs | 111 +- src/scu_reset/prclr1.rs | 87 +- src/scu_reset/prclr2.rs | 79 +- src/scu_reset/prset0.rs | 111 +- src/scu_reset/prset1.rs | 87 +- src/scu_reset/prset2.rs | 79 +- src/scu_reset/prstat0.rs | 177 ++- src/scu_reset/prstat1.rs | 123 +- src/scu_reset/prstat2.rs | 105 +- src/scu_reset/rstclr.rs | 79 +- src/scu_reset/rstset.rs | 71 +- src/scu_reset/rststat.rs | 134 +- src/scu_trap.rs | 57 +- src/scu_trap/trapclr.rs | 127 +- src/scu_trap/trapdis.rs | 330 +++-- src/scu_trap/trapraw.rs | 213 +++- src/scu_trap/trapset.rs | 127 +- src/scu_trap/trapstat.rs | 213 +++- src/usb0.rs | 374 ++---- src/usb0/daint.rs | 65 +- src/usb0/daintmsk.rs | 108 +- src/usb0/dcfg.rs | 228 +++- src/usb0/dctl.rs | 270 ++-- src/usb0/diepempmsk.rs | 90 +- src/usb0/diepmsk.rs | 250 +++- src/usb0/dieptxf1.rs | 108 +- src/usb0/dieptxf2.rs | 108 +- src/usb0/dieptxf3.rs | 108 +- src/usb0/dieptxf4.rs | 108 +- src/usb0/dieptxf5.rs | 108 +- src/usb0/dieptxf6.rs | 108 +- src/usb0/doepmsk.rs | 290 ++++- src/usb0/dsts.rs | 104 +- src/usb0/dvbusdis.rs | 90 +- src/usb0/dvbuspulse.rs | 90 +- src/usb0/gahbcfg.rs | 217 +++- src/usb0/gdfifocfg.rs | 108 +- src/usb0/gintmsk.rs | 370 ++++-- src/usb0/gintsts.rs | 373 +++++- src/usb0/gnptxfsiz.rs | 108 +- src/usb0/grstctl.rs | 205 ++- src/usb0/grxfsiz.rs | 90 +- src/usb0/grxstsp.rs | 142 ++- src/usb0/grxstsr.rs | 142 ++- src/usb0/guid.rs | 130 +- src/usb0/gusbcfg.rs | 205 ++- src/usb0/pcgcctl.rs | 110 +- src/usb0_ep0.rs | 149 +-- src/usb0_ep0/diepctl0.rs | 238 +++- src/usb0_ep0/diepdma0.rs | 90 +- src/usb0_ep0/diepdmab0.rs | 49 +- src/usb0_ep0/diepint0.rs | 226 +++- src/usb0_ep0/dieptsiz0.rs | 108 +- src/usb0_ep0/doepctl0.rs | 226 +++- src/usb0_ep0/doepdma0.rs | 90 +- src/usb0_ep0/doepdmab0.rs | 49 +- src/usb0_ep0/doepint0.rs | 310 ++++- src/usb0_ep0/doeptsiz0.rs | 145 ++- src/usb0_ep0/dtxfsts0.rs | 64 +- src/usb0_ep1.rs | 236 +--- src/usb0_ep1/diepctl_intbulk.rs | 292 ++++- src/usb0_ep1/diepctl_isocont.rs | 292 ++++- src/usb0_ep1/diepdma.rs | 90 +- src/usb0_ep1/diepdmab.rs | 49 +- src/usb0_ep1/diepint.rs | 226 +++- src/usb0_ep1/dieptsiz.rs | 108 +- src/usb0_ep1/doepctl_intbulk.rs | 292 ++++- src/usb0_ep1/doepctl_isocont.rs | 292 ++++- src/usb0_ep1/doepdma.rs | 90 +- src/usb0_ep1/doepdmab.rs | 49 +- src/usb0_ep1/doepint.rs | 310 ++++- src/usb0_ep1/doeptsiz_control.rs | 145 ++- src/usb0_ep1/doeptsiz_iso.rs | 132 +- src/usb0_ep1/dtxfsts.rs | 64 +- src/usic0.rs | 11 +- src/usic0/id.rs | 81 +- src/usic0_ch0.rs | 630 +++------- src/usic0_ch0/brg.rs | 329 +++-- src/usic0_ch0/byp.rs | 90 +- src/usic0_ch0/bypcr.rs | 256 +++- src/usic0_ch0/ccfg.rs | 141 ++- src/usic0_ch0/ccr.rs | 360 ++++-- src/usic0_ch0/cmtr.rs | 90 +- src/usic0_ch0/dx0cr.rs | 286 +++-- src/usic0_ch0/dx1cr.rs | 312 +++-- src/usic0_ch0/dx2cr.rs | 286 +++-- src/usic0_ch0/dx3cr.rs | 286 +++-- src/usic0_ch0/dx4cr.rs | 286 +++-- src/usic0_ch0/dx5cr.rs | 286 +++-- src/usic0_ch0/fdr.rs | 136 +- src/usic0_ch0/fmr.rs | 123 +- src/usic0_ch0/in_.rs | 53 +- src/usic0_ch0/inpr.rs | 197 ++- src/usic0_ch0/kscfg.rs | 170 ++- src/usic0_ch0/outdr.rs | 65 +- src/usic0_ch0/outr.rs | 65 +- src/usic0_ch0/pcr.rs | 710 ++++++++--- src/usic0_ch0/pcr_ascmode.rs | 415 +++++-- src/usic0_ch0/pcr_iicmode.rs | 422 +++++-- src/usic0_ch0/pcr_iismode.rs | 298 +++-- src/usic0_ch0/pcr_sscmode.rs | 431 +++++-- src/usic0_ch0/pscr.rs | 183 ++- src/usic0_ch0/psr.rs | 452 +++++-- src/usic0_ch0/psr_ascmode.rs | 504 +++++--- src/usic0_ch0/psr_iicmode.rs | 512 +++++--- src/usic0_ch0/psr_iismode.rs | 408 ++++-- src/usic0_ch0/psr_sscmode.rs | 382 ++++-- src/usic0_ch0/rbctr.rs | 451 ++++--- src/usic0_ch0/rbuf.rs | 49 +- src/usic0_ch0/rbuf0.rs | 49 +- src/usic0_ch0/rbuf01sr.rs | 288 ++++- src/usic0_ch0/rbuf1.rs | 49 +- src/usic0_ch0/rbufd.rs | 49 +- src/usic0_ch0/rbufsr.rs | 145 ++- src/usic0_ch0/sctr.rs | 303 +++-- src/usic0_ch0/tbctr.rs | 369 ++++-- src/usic0_ch0/tbuf.rs | 92 +- src/usic0_ch0/tcsr.rs | 450 +++++-- src/usic0_ch0/trbptr.rs | 97 +- src/usic0_ch0/trbscr.rs | 111 +- src/usic0_ch0/trbsr.rs | 376 ++++-- src/vadc.rs | 255 ++-- src/vadc/brsctrl.rs | 223 +++- src/vadc/brsmr.rs | 264 ++-- src/vadc/brspnd.rs | 280 +++-- src/vadc/brssel.rs | 280 +++-- src/vadc/clc.rs | 140 ++- src/vadc/emuxsel.rs | 108 +- src/vadc/globbound.rs | 108 +- src/vadc/globcfg.rs | 285 +++-- src/vadc/globeflag.rs | 138 ++- src/vadc/globevnp.rs | 148 ++- src/vadc/globiclass.rs | 190 ++- src/vadc/globrcr.rs | 149 ++- src/vadc/globres.rs | 198 ++- src/vadc/globresd.rs | 198 ++- src/vadc/globtf.rs | 188 ++- src/vadc/id.rs | 81 +- src/vadc/ocs.rs | 192 ++- src/vadc_g0.rs | 540 +++----- src/vadc_g0/alias.rs | 108 +- src/vadc_g0/arbcfg.rs | 227 +++- src/vadc_g0/arbpr.rs | 319 +++-- src/vadc_g0/asctrl.rs | 257 ++-- src/vadc_g0/asmr.rs | 264 ++-- src/vadc_g0/aspnd.rs | 278 +++-- src/vadc_g0/assel.rs | 278 +++-- src/vadc_g0/bfl.rs | 350 ++++-- src/vadc_g0/bflc.rs | 226 ++-- src/vadc_g0/bflnp.rs | 242 ++-- src/vadc_g0/bfls.rs | 111 +- src/vadc_g0/bound.rs | 108 +- src/vadc_g0/cefclr.rs | 111 +- src/vadc_g0/ceflag.rs | 278 +++-- src/vadc_g0/cevnp0.rs | 382 ++++-- src/vadc_g0/chass.rs | 278 +++-- src/vadc_g0/chctr.rs | 384 ++++-- src/vadc_g0/emuxctr.rs | 234 +++- src/vadc_g0/iclass.rs | 190 ++- src/vadc_g0/q0r0.rs | 121 +- src/vadc_g0/qbur0.rs | 115 +- src/vadc_g0/qctrl0.rs | 257 ++-- src/vadc_g0/qinr0.rs | 75 +- src/vadc_g0/qmr0.rs | 184 ++- src/vadc_g0/qsr0.rs | 122 +- src/vadc_g0/rcr.rs | 210 +++- src/vadc_g0/refclr.rs | 175 +-- src/vadc_g0/reflag.rs | 486 +++++--- src/vadc_g0/res.rs | 207 +++- src/vadc_g0/resd.rs | 165 ++- src/vadc_g0/revnp0.rs | 382 ++++-- src/vadc_g0/revnp1.rs | 382 ++++-- src/vadc_g0/sefclr.rs | 63 +- src/vadc_g0/seflag.rs | 122 +- src/vadc_g0/sevnp.rs | 148 ++- src/vadc_g0/sract.rs | 111 +- src/vadc_g0/synctr.rs | 178 ++- src/vadc_g0/vfr.rs | 486 +++++--- src/wdt.rs | 94 +- src/wdt/ctr.rs | 150 ++- src/wdt/id.rs | 81 +- src/wdt/srv.rs | 51 +- src/wdt/tim.rs | 49 +- src/wdt/wdtclr.rs | 51 +- src/wdt/wdtsts.rs | 49 +- src/wdt/wlb.rs | 90 +- src/wdt/wub.rs | 90 +- 734 files changed, 97939 insertions(+), 39798 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8b550227..d741abb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,10 @@ repository = "https://github.com/xmc-rs/xmc4100" documentation = "https://docs.rs/xmc4100" keywords = ["cortex-m", "xmc4x", "no_std", "svd2rust", "embedded"] categories = ["embedded", "no-std"] +edition="2018" [dependencies] -cortex-m = "0.7.0" -bare-metal = "0.2.5" +cortex-m = "0.7.3" vcell = "0.1.2" [dependencies.cortex-m-rt] diff --git a/src/can.rs b/src/can.rs index dbd4a6c3..4e5c108b 100644 --- a/src/can.rs +++ b/src/can.rs @@ -2,130 +2,68 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - CAN Clock Control Register"] - pub clc: CLC, - _reserved1: [u8; 4usize], + pub clc: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Module Identification Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x0c - CAN Fractional Divider Register"] - pub fdr: FDR, - _reserved3: [u8; 240usize], - #[doc = "0x100 - List Register"] - pub list: [LIST; 8], - _reserved4: [u8; 32usize], - #[doc = "0x140 - Message Pending Register"] - pub mspnd: [MSPND; 8], - _reserved5: [u8; 32usize], - #[doc = "0x180 - Message Index Register"] - pub msid: [MSID; 8], - _reserved6: [u8; 32usize], + pub fdr: crate::Reg, + _reserved3: [u8; 0xf0], + #[doc = "0x100..0x120 - List Register"] + pub list: [crate::Reg; 8], + _reserved4: [u8; 0x20], + #[doc = "0x140..0x160 - Message Pending Register"] + pub mspnd: [crate::Reg; 8], + _reserved5: [u8; 0x20], + #[doc = "0x180..0x1a0 - Message Index Register"] + pub msid: [crate::Reg; 8], + _reserved6: [u8; 0x20], #[doc = "0x1c0 - Message Index Mask Register"] - pub msimask: MSIMASK, + pub msimask: crate::Reg, #[doc = "0x1c4 - Panel Control Register"] - pub panctr: PANCTR, + pub panctr: crate::Reg, #[doc = "0x1c8 - Module Control Register"] - pub mcr: MCR, + pub mcr: crate::Reg, #[doc = "0x1cc - Module Interrupt Trigger Register"] - pub mitr: MITR, + pub mitr: crate::Reg, } -#[doc = "CAN Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clc](clc) module"] -pub type CLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLC; -#[doc = "`read()` method returns [clc::R](clc::R) reader structure"] -impl crate::Readable for CLC {} -#[doc = "`write(|w| ..)` method takes [clc::W](clc::W) writer structure"] -impl crate::Writable for CLC {} +#[doc = "CLC register accessor: an alias for `Reg`"] +pub type CLC = crate::Reg; #[doc = "CAN Clock Control Register"] pub mod clc; -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "CAN Fractional Divider Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fdr](fdr) module"] -pub type FDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FDR; -#[doc = "`read()` method returns [fdr::R](fdr::R) reader structure"] -impl crate::Readable for FDR {} -#[doc = "`write(|w| ..)` method takes [fdr::W](fdr::W) writer structure"] -impl crate::Writable for FDR {} +#[doc = "FDR register accessor: an alias for `Reg`"] +pub type FDR = crate::Reg; #[doc = "CAN Fractional Divider Register"] pub mod fdr; -#[doc = "List Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](list) module"] -pub type LIST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LIST; -#[doc = "`read()` method returns [list::R](list::R) reader structure"] -impl crate::Readable for LIST {} +#[doc = "LIST register accessor: an alias for `Reg`"] +pub type LIST = crate::Reg; #[doc = "List Register"] pub mod list; -#[doc = "Message Pending Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mspnd](mspnd) module"] -pub type MSPND = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MSPND; -#[doc = "`read()` method returns [mspnd::R](mspnd::R) reader structure"] -impl crate::Readable for MSPND {} -#[doc = "`write(|w| ..)` method takes [mspnd::W](mspnd::W) writer structure"] -impl crate::Writable for MSPND {} +#[doc = "MSPND register accessor: an alias for `Reg`"] +pub type MSPND = crate::Reg; #[doc = "Message Pending Register"] pub mod mspnd; -#[doc = "Message Index Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [msid](msid) module"] -pub type MSID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MSID; -#[doc = "`read()` method returns [msid::R](msid::R) reader structure"] -impl crate::Readable for MSID {} +#[doc = "MSID register accessor: an alias for `Reg`"] +pub type MSID = crate::Reg; #[doc = "Message Index Register"] pub mod msid; -#[doc = "Message Index Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [msimask](msimask) module"] -pub type MSIMASK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MSIMASK; -#[doc = "`read()` method returns [msimask::R](msimask::R) reader structure"] -impl crate::Readable for MSIMASK {} -#[doc = "`write(|w| ..)` method takes [msimask::W](msimask::W) writer structure"] -impl crate::Writable for MSIMASK {} +#[doc = "MSIMASK register accessor: an alias for `Reg`"] +pub type MSIMASK = crate::Reg; #[doc = "Message Index Mask Register"] pub mod msimask; -#[doc = "Panel Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [panctr](panctr) module"] -pub type PANCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PANCTR; -#[doc = "`read()` method returns [panctr::R](panctr::R) reader structure"] -impl crate::Readable for PANCTR {} -#[doc = "`write(|w| ..)` method takes [panctr::W](panctr::W) writer structure"] -impl crate::Writable for PANCTR {} +#[doc = "PANCTR register accessor: an alias for `Reg`"] +pub type PANCTR = crate::Reg; #[doc = "Panel Control Register"] pub mod panctr; -#[doc = "Module Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcr](mcr) module"] -pub type MCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCR; -#[doc = "`read()` method returns [mcr::R](mcr::R) reader structure"] -impl crate::Readable for MCR {} -#[doc = "`write(|w| ..)` method takes [mcr::W](mcr::W) writer structure"] -impl crate::Writable for MCR {} +#[doc = "MCR register accessor: an alias for `Reg`"] +pub type MCR = crate::Reg; #[doc = "Module Control Register"] pub mod mcr; -#[doc = "Module Interrupt Trigger Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mitr](mitr) module"] -pub type MITR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MITR; -#[doc = "`write(|w| ..)` method takes [mitr::W](mitr::W) writer structure"] -impl crate::Writable for MITR {} +#[doc = "MITR register accessor: an alias for `Reg`"] +pub type MITR = crate::Reg; #[doc = "Module Interrupt Trigger Register"] pub mod mitr; diff --git a/src/can/clc.rs b/src/can/clc.rs index f3f117ee..f0f3e98f 100644 --- a/src/can/clc.rs +++ b/src/can/clc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CLC"] -pub type R = crate::R; -#[doc = "Writer for register CLC"] -pub type W = crate::W; -#[doc = "Register CLC `reset()`'s with value 0x03"] -impl crate::ResetValue for super::CLC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x03 +#[doc = "Register `CLC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DISR` reader - Module Disable Request Bit"] +pub struct DISR_R(crate::FieldReader); +impl DISR_R { + pub(crate) fn new(bits: bool) -> Self { + DISR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DISR`"] -pub type DISR_R = crate::R; -#[doc = "Write proxy for field `DISR`"] +#[doc = "Field `DISR` writer - Module Disable Request Bit"] pub struct DISR_W<'a> { w: &'a mut W, } @@ -30,15 +66,39 @@ impl<'a> DISR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `DISS`"] -pub type DISS_R = crate::R; -#[doc = "Reader of field `EDIS`"] -pub type EDIS_R = crate::R; -#[doc = "Write proxy for field `EDIS`"] +#[doc = "Field `DISS` reader - Module Disable Status Bit"] +pub struct DISS_R(crate::FieldReader); +impl DISS_R { + pub(crate) fn new(bits: bool) -> Self { + DISS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDIS` reader - Sleep Mode Enable Control"] +pub struct EDIS_R(crate::FieldReader); +impl EDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDIS` writer - Sleep Mode Enable Control"] pub struct EDIS_W<'a> { w: &'a mut W, } @@ -56,11 +116,11 @@ impl<'a> EDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SBWE`"] +#[doc = "Field `SBWE` writer - Module Suspend Bit Write Enable for OCDS"] pub struct SBWE_W<'a> { w: &'a mut W, } @@ -78,7 +138,7 @@ impl<'a> SBWE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -115,4 +175,30 @@ impl W { pub fn sbwe(&mut self) -> SBWE_W { SBWE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CAN Clock Control Register\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 [clc](index.html) module"] +pub struct CLC_SPEC; +impl crate::RegisterSpec for CLC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clc::R](R) reader structure"] +impl crate::Readable for CLC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [clc::W](W) writer structure"] +impl crate::Writable for CLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLC to value 0x03"] +impl crate::Resettable for CLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03 + } } diff --git a/src/can/fdr.rs b/src/can/fdr.rs index 42873d5b..2cce9d0d 100644 --- a/src/can/fdr.rs +++ b/src/can/fdr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FDR"] -pub type R = crate::R; -#[doc = "Writer for register FDR"] -pub type W = crate::W; -#[doc = "Register FDR `reset()`'s with value 0"] -impl crate::ResetValue for super::FDR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FDR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `STEP` reader - Step Value"] +pub struct STEP_R(crate::FieldReader); +impl STEP_R { + pub(crate) fn new(bits: u16) -> Self { + STEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `STEP`"] -pub type STEP_R = crate::R; -#[doc = "Write proxy for field `STEP`"] +#[doc = "Field `STEP` writer - Step Value"] pub struct STEP_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> STEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } -#[doc = "Reader of field `SM`"] -pub type SM_R = crate::R; -#[doc = "Write proxy for field `SM`"] +#[doc = "Field `SM` reader - Suspend Mode"] +pub struct SM_R(crate::FieldReader); +impl SM_R { + pub(crate) fn new(bits: bool) -> Self { + SM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SM` writer - Suspend Mode"] pub struct SM_W<'a> { w: &'a mut W, } @@ -44,13 +92,25 @@ impl<'a> SM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `SC`"] -pub type SC_R = crate::R; -#[doc = "Write proxy for field `SC`"] +#[doc = "Field `SC` reader - Suspend Control"] +pub struct SC_R(crate::FieldReader); +impl SC_R { + pub(crate) fn new(bits: u8) -> Self { + SC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SC` writer - Suspend Control"] pub struct SC_W<'a> { w: &'a mut W, } @@ -58,13 +118,25 @@ impl<'a> SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } -#[doc = "Reader of field `DM`"] -pub type DM_R = crate::R; -#[doc = "Write proxy for field `DM`"] +#[doc = "Field `DM` reader - Divider Mode"] +pub struct DM_R(crate::FieldReader); +impl DM_R { + pub(crate) fn new(bits: u8) -> Self { + DM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DM` writer - Divider Mode"] pub struct DM_W<'a> { w: &'a mut W, } @@ -72,19 +144,67 @@ impl<'a> DM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; -#[doc = "Reader of field `SUSACK`"] -pub type SUSACK_R = crate::R; -#[doc = "Reader of field `SUSREQ`"] -pub type SUSREQ_R = crate::R; -#[doc = "Reader of field `ENHW`"] -pub type ENHW_R = crate::R; -#[doc = "Write proxy for field `ENHW`"] +#[doc = "Field `RESULT` reader - Result Value"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSACK` reader - Suspend Mode Acknowledge"] +pub struct SUSACK_R(crate::FieldReader); +impl SUSACK_R { + pub(crate) fn new(bits: bool) -> Self { + SUSACK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SUSACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSREQ` reader - Suspend Mode Request"] +pub struct SUSREQ_R(crate::FieldReader); +impl SUSREQ_R { + pub(crate) fn new(bits: bool) -> Self { + SUSREQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SUSREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENHW` reader - Enable Hardware Clock Control"] +pub struct ENHW_R(crate::FieldReader); +impl ENHW_R { + pub(crate) fn new(bits: bool) -> Self { + ENHW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENHW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENHW` writer - Enable Hardware Clock Control"] pub struct ENHW_W<'a> { w: &'a mut W, } @@ -102,13 +222,25 @@ impl<'a> ENHW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `DISCLK`"] -pub type DISCLK_R = crate::R; -#[doc = "Write proxy for field `DISCLK`"] +#[doc = "Field `DISCLK` reader - Disable Clock"] +pub struct DISCLK_R(crate::FieldReader); +impl DISCLK_R { + pub(crate) fn new(bits: bool) -> Self { + DISCLK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISCLK` writer - Disable Clock"] pub struct DISCLK_W<'a> { w: &'a mut W, } @@ -126,7 +258,7 @@ impl<'a> DISCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -208,4 +340,30 @@ impl W { pub fn disclk(&mut self) -> DISCLK_W { DISCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CAN Fractional Divider Register\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 [fdr](index.html) module"] +pub struct FDR_SPEC; +impl crate::RegisterSpec for FDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fdr::R](R) reader structure"] +impl crate::Readable for FDR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fdr::W](W) writer structure"] +impl crate::Writable for FDR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FDR to value 0"] +impl crate::Resettable for FDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can/id.rs b/src/can/id.rs index cd599834..9c489089 100644 --- a/src/can/id.rs +++ b/src/can/id.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Module Type\n\nValue on reset: 192"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -15,26 +40,47 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 192 => Val(MOD_TYPE_A::VALUE1), - i => Res(i), + 192 => Some(MOD_TYPE_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MOD_TYPE_A::VALUE1 + **self == MOD_TYPE_A::VALUE1 + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -52,3 +98,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x002b_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x002b_c000 + } +} diff --git a/src/can/list.rs b/src/can/list.rs index 4d8324a4..bb29e17f 100644 --- a/src/can/list.rs +++ b/src/can/list.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register LIST[%s]"] -pub type R = crate::R; -#[doc = "Reader of field `BEGIN`"] -pub type BEGIN_R = crate::R; -#[doc = "Reader of field `END`"] -pub type END_R = crate::R; -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; +#[doc = "Register `LIST[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `BEGIN` reader - List Begin"] +pub struct BEGIN_R(crate::FieldReader); +impl BEGIN_R { + pub(crate) fn new(bits: u8) -> Self { + BEGIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BEGIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END` reader - List End"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: u8) -> Self { + END_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIZE` reader - List Size"] +pub struct SIZE_R(crate::FieldReader); +impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "List Empty Indication\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EMPTY_A { @@ -20,9 +69,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMPTY`"] -pub type EMPTY_R = crate::R; +#[doc = "Field `EMPTY` reader - List Empty Indication"] +pub struct EMPTY_R(crate::FieldReader); impl EMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + EMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMPTY_A { @@ -34,12 +86,19 @@ impl EMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMPTY_A::VALUE1 + **self == EMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMPTY_A::VALUE2 + **self == EMPTY_A::VALUE2 + } +} +impl core::ops::Deref for EMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -64,3 +123,20 @@ impl R { EMPTY_R::new(((self.bits >> 24) & 0x01) != 0) } } +#[doc = "List Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](index.html) module"] +pub struct LIST_SPEC; +impl crate::RegisterSpec for LIST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [list::R](R) reader structure"] +impl crate::Readable for LIST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LIST[%s] +to value 0"] +impl crate::Resettable for LIST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/can/mcr.rs b/src/can/mcr.rs index 46de49b4..ad94502c 100644 --- a/src/can/mcr.rs +++ b/src/can/mcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MCR"] -pub type R = crate::R; -#[doc = "Writer for register MCR"] -pub type W = crate::W; -#[doc = "Register MCR `reset()`'s with value 0"] -impl crate::ResetValue for super::MCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `MPSEL`"] -pub type MPSEL_R = crate::R; -#[doc = "Write proxy for field `MPSEL`"] +#[doc = "Field `MPSEL` reader - Message Pending Selector"] +pub struct MPSEL_R(crate::FieldReader); +impl MPSEL_R { + pub(crate) fn new(bits: u8) -> Self { + MPSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPSEL` writer - Message Pending Selector"] pub struct MPSEL_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> MPSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn mpsel(&mut self) -> MPSEL_W { MPSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Module Control Register\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 [mcr](index.html) module"] +pub struct MCR_SPEC; +impl crate::RegisterSpec for MCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mcr::R](R) reader structure"] +impl crate::Readable for MCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mcr::W](W) writer structure"] +impl crate::Writable for MCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCR to value 0"] +impl crate::Resettable for MCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can/mitr.rs b/src/can/mitr.rs index 5a3a7211..ee8079fd 100644 --- a/src/can/mitr.rs +++ b/src/can/mitr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register MITR"] -pub type W = crate::W; -#[doc = "Register MITR `reset()`'s with value 0"] -impl crate::ResetValue for super::MITR { - type Type = u32; +#[doc = "Register `MITR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `IT`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `IT` writer - Interrupt Trigger"] pub struct IT_W<'a> { w: &'a mut W, } @@ -16,7 +27,7 @@ impl<'a> IT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -26,4 +37,26 @@ impl W { pub fn it(&mut self) -> IT_W { IT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Module Interrupt Trigger Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mitr](index.html) module"] +pub struct MITR_SPEC; +impl crate::RegisterSpec for MITR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [mitr::W](W) writer structure"] +impl crate::Writable for MITR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MITR to value 0"] +impl crate::Resettable for MITR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can/msid.rs b/src/can/msid.rs index def75355..97b31a1d 100644 --- a/src/can/msid.rs +++ b/src/can/msid.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register MSID[%s]"] -pub type R = crate::R; -#[doc = "Reader of field `INDEX`"] -pub type INDEX_R = crate::R; +#[doc = "Register `MSID[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `INDEX` reader - Message Pending Index"] +pub struct INDEX_R(crate::FieldReader); +impl INDEX_R { + pub(crate) fn new(bits: u8) -> Self { + INDEX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INDEX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:5 - Message Pending Index"] #[inline(always)] @@ -9,3 +34,20 @@ impl R { INDEX_R::new((self.bits & 0x3f) as u8) } } +#[doc = "Message Index Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [msid](index.html) module"] +pub struct MSID_SPEC; +impl crate::RegisterSpec for MSID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [msid::R](R) reader structure"] +impl crate::Readable for MSID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MSID[%s] +to value 0x20"] +impl crate::Resettable for MSID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x20 + } +} diff --git a/src/can/msimask.rs b/src/can/msimask.rs index f6cba8ef..bad6c3ff 100644 --- a/src/can/msimask.rs +++ b/src/can/msimask.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MSIMASK"] -pub type R = crate::R; -#[doc = "Writer for register MSIMASK"] -pub type W = crate::W; -#[doc = "Register MSIMASK `reset()`'s with value 0"] -impl crate::ResetValue for super::MSIMASK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MSIMASK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MSIMASK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `IM`"] -pub type IM_R = crate::R; -#[doc = "Write proxy for field `IM`"] +#[doc = "Field `IM` reader - Message Index Mask"] +pub struct IM_R(crate::FieldReader); +impl IM_R { + pub(crate) fn new(bits: u32) -> Self { + IM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IM` writer - Message Index Mask"] pub struct IM_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> IM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn im(&mut self) -> IM_W { IM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Index Mask Register\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 [msimask](index.html) module"] +pub struct MSIMASK_SPEC; +impl crate::RegisterSpec for MSIMASK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [msimask::R](R) reader structure"] +impl crate::Readable for MSIMASK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [msimask::W](W) writer structure"] +impl crate::Writable for MSIMASK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MSIMASK to value 0"] +impl crate::Resettable for MSIMASK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can/mspnd.rs b/src/can/mspnd.rs index 7979e870..92c29de8 100644 --- a/src/can/mspnd.rs +++ b/src/can/mspnd.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register MSPND[%s]"] -pub type R = crate::R; -#[doc = "Writer for register MSPND[%s]"] -pub type W = crate::W; -#[doc = "Register MSPND[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::MSPND { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MSPND[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MSPND[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PND`"] -pub type PND_R = crate::R; -#[doc = "Write proxy for field `PND`"] +#[doc = "Field `PND` reader - Message Pending"] +pub struct PND_R(crate::FieldReader); +impl PND_R { + pub(crate) fn new(bits: u32) -> Self { + PND_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PND` writer - Message Pending"] pub struct PND_W<'a> { w: &'a mut W, } @@ -21,7 +56,7 @@ impl<'a> PND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -38,4 +73,31 @@ impl W { pub fn pnd(&mut self) -> PND_W { PND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Pending Register\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 [mspnd](index.html) module"] +pub struct MSPND_SPEC; +impl crate::RegisterSpec for MSPND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mspnd::R](R) reader structure"] +impl crate::Readable for MSPND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mspnd::W](W) writer structure"] +impl crate::Writable for MSPND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MSPND[%s] +to value 0"] +impl crate::Resettable for MSPND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can/panctr.rs b/src/can/panctr.rs index 1aeb27ff..a921d393 100644 --- a/src/can/panctr.rs +++ b/src/can/panctr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PANCTR"] -pub type R = crate::R; -#[doc = "Writer for register PANCTR"] -pub type W = crate::W; -#[doc = "Register PANCTR `reset()`'s with value 0x0301"] -impl crate::ResetValue for super::PANCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0301 +#[doc = "Register `PANCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PANCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PANCMD`"] -pub type PANCMD_R = crate::R; -#[doc = "Write proxy for field `PANCMD`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PANCMD` reader - Panel Command"] +pub struct PANCMD_R(crate::FieldReader); +impl PANCMD_R { + pub(crate) fn new(bits: u8) -> Self { + PANCMD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PANCMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PANCMD` writer - Panel Command"] pub struct PANCMD_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PANCMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BUSY`"] -pub type BUSY_R = crate::R; +#[doc = "Field `BUSY` reader - Panel Busy Flag"] +pub struct BUSY_R(crate::FieldReader); impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BUSY_A { @@ -52,12 +91,19 @@ impl BUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BUSY_A::VALUE1 + **self == BUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BUSY_A::VALUE2 + **self == BUSY_A::VALUE2 + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Result Busy Flag\n\nValue on reset: 1"] @@ -74,9 +120,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RBUSY`"] -pub type RBUSY_R = crate::R; +#[doc = "Field `RBUSY` reader - Result Busy Flag"] +pub struct RBUSY_R(crate::FieldReader); impl RBUSY_R { + pub(crate) fn new(bits: bool) -> Self { + RBUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RBUSY_A { @@ -88,17 +137,36 @@ impl RBUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RBUSY_A::VALUE1 + **self == RBUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RBUSY_A::VALUE2 + **self == RBUSY_A::VALUE2 + } +} +impl core::ops::Deref for RBUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PANAR1` reader - Panel Argument 1"] +pub struct PANAR1_R(crate::FieldReader); +impl PANAR1_R { + pub(crate) fn new(bits: u8) -> Self { + PANAR1_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PANAR1`"] -pub type PANAR1_R = crate::R; -#[doc = "Write proxy for field `PANAR1`"] +impl core::ops::Deref for PANAR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PANAR1` writer - Panel Argument 1"] pub struct PANAR1_W<'a> { w: &'a mut W, } @@ -106,13 +174,25 @@ impl<'a> PANAR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PANAR2`"] -pub type PANAR2_R = crate::R; -#[doc = "Write proxy for field `PANAR2`"] +#[doc = "Field `PANAR2` reader - Panel Argument 2"] +pub struct PANAR2_R(crate::FieldReader); +impl PANAR2_R { + pub(crate) fn new(bits: u8) -> Self { + PANAR2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PANAR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PANAR2` writer - Panel Argument 2"] pub struct PANAR2_W<'a> { w: &'a mut W, } @@ -120,7 +200,7 @@ impl<'a> PANAR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -167,4 +247,30 @@ impl W { pub fn panar2(&mut self) -> PANAR2_W { PANAR2_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Panel Control Register\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 [panctr](index.html) module"] +pub struct PANCTR_SPEC; +impl crate::RegisterSpec for PANCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [panctr::R](R) reader structure"] +impl crate::Readable for PANCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [panctr::W](W) writer structure"] +impl crate::Writable for PANCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PANCTR to value 0x0301"] +impl crate::Resettable for PANCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0301 + } } diff --git a/src/can_mo0.rs b/src/can_mo0.rs index b44db510..3e20d38b 100644 --- a/src/can_mo0.rs +++ b/src/can_mo0.rs @@ -2,135 +2,66 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Message Object Function Control Register"] - pub mofcr: MOFCR, + pub mofcr: crate::Reg, #[doc = "0x04 - Message Object FIFO/Gateway Pointer Register"] - pub mofgpr: MOFGPR, + pub mofgpr: crate::Reg, #[doc = "0x08 - Message Object Interrupt Pointer Register"] - pub moipr: MOIPR, + pub moipr: crate::Reg, #[doc = "0x0c - Message Object Acceptance Mask Register"] - pub moamr: MOAMR, + pub moamr: crate::Reg, #[doc = "0x10 - Message Object Data Register Low"] - pub modatal: MODATAL, + pub modatal: crate::Reg, #[doc = "0x14 - Message Object Data Register High"] - pub modatah: MODATAH, + pub modatah: crate::Reg, #[doc = "0x18 - Message Object Arbitration Register"] - pub moar: MOAR, - _reserved_7_moctr: [u8; 4usize], + pub moar: crate::Reg, + _reserved_7_moctr: [u8; 0x04], } impl RegisterBlock { #[doc = "0x1c - Message Object Status Register"] #[inline(always)] - pub fn mostat(&self) -> &MOSTAT { - unsafe { &*(((self as *const Self) as *const u8).add(28usize) as *const MOSTAT) } - } - #[doc = "0x1c - Message Object Status Register"] - #[inline(always)] - pub fn mostat_mut(&self) -> &mut MOSTAT { - unsafe { &mut *(((self as *const Self) as *mut u8).add(28usize) as *mut MOSTAT) } - } - #[doc = "0x1c - Message Object Control Register"] - #[inline(always)] - pub fn moctr(&self) -> &MOCTR { - unsafe { &*(((self as *const Self) as *const u8).add(28usize) as *const MOCTR) } + pub fn mostat(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(28usize) as *const crate::Reg) } } #[doc = "0x1c - Message Object Control Register"] #[inline(always)] - pub fn moctr_mut(&self) -> &mut MOCTR { - unsafe { &mut *(((self as *const Self) as *mut u8).add(28usize) as *mut MOCTR) } + pub fn moctr(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(28usize) as *const crate::Reg) } } } -#[doc = "Message Object Function Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mofcr](mofcr) module"] -pub type MOFCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOFCR; -#[doc = "`read()` method returns [mofcr::R](mofcr::R) reader structure"] -impl crate::Readable for MOFCR {} -#[doc = "`write(|w| ..)` method takes [mofcr::W](mofcr::W) writer structure"] -impl crate::Writable for MOFCR {} +#[doc = "MOFCR register accessor: an alias for `Reg`"] +pub type MOFCR = crate::Reg; #[doc = "Message Object Function Control Register"] pub mod mofcr; -#[doc = "Message Object FIFO/Gateway Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mofgpr](mofgpr) module"] -pub type MOFGPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOFGPR; -#[doc = "`read()` method returns [mofgpr::R](mofgpr::R) reader structure"] -impl crate::Readable for MOFGPR {} -#[doc = "`write(|w| ..)` method takes [mofgpr::W](mofgpr::W) writer structure"] -impl crate::Writable for MOFGPR {} +#[doc = "MOFGPR register accessor: an alias for `Reg`"] +pub type MOFGPR = crate::Reg; #[doc = "Message Object FIFO/Gateway Pointer Register"] pub mod mofgpr; -#[doc = "Message Object Interrupt Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [moipr](moipr) module"] -pub type MOIPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOIPR; -#[doc = "`read()` method returns [moipr::R](moipr::R) reader structure"] -impl crate::Readable for MOIPR {} -#[doc = "`write(|w| ..)` method takes [moipr::W](moipr::W) writer structure"] -impl crate::Writable for MOIPR {} +#[doc = "MOIPR register accessor: an alias for `Reg`"] +pub type MOIPR = crate::Reg; #[doc = "Message Object Interrupt Pointer Register"] pub mod moipr; -#[doc = "Message Object Acceptance Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [moamr](moamr) module"] -pub type MOAMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOAMR; -#[doc = "`read()` method returns [moamr::R](moamr::R) reader structure"] -impl crate::Readable for MOAMR {} -#[doc = "`write(|w| ..)` method takes [moamr::W](moamr::W) writer structure"] -impl crate::Writable for MOAMR {} +#[doc = "MOAMR register accessor: an alias for `Reg`"] +pub type MOAMR = crate::Reg; #[doc = "Message Object Acceptance Mask Register"] pub mod moamr; -#[doc = "Message Object Data Register Low\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [modatal](modatal) module"] -pub type MODATAL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MODATAL; -#[doc = "`read()` method returns [modatal::R](modatal::R) reader structure"] -impl crate::Readable for MODATAL {} -#[doc = "`write(|w| ..)` method takes [modatal::W](modatal::W) writer structure"] -impl crate::Writable for MODATAL {} +#[doc = "MODATAL register accessor: an alias for `Reg`"] +pub type MODATAL = crate::Reg; #[doc = "Message Object Data Register Low"] pub mod modatal; -#[doc = "Message Object Data Register High\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [modatah](modatah) module"] -pub type MODATAH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MODATAH; -#[doc = "`read()` method returns [modatah::R](modatah::R) reader structure"] -impl crate::Readable for MODATAH {} -#[doc = "`write(|w| ..)` method takes [modatah::W](modatah::W) writer structure"] -impl crate::Writable for MODATAH {} +#[doc = "MODATAH register accessor: an alias for `Reg`"] +pub type MODATAH = crate::Reg; #[doc = "Message Object Data Register High"] pub mod modatah; -#[doc = "Message Object Arbitration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [moar](moar) module"] -pub type MOAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOAR; -#[doc = "`read()` method returns [moar::R](moar::R) reader structure"] -impl crate::Readable for MOAR {} -#[doc = "`write(|w| ..)` method takes [moar::W](moar::W) writer structure"] -impl crate::Writable for MOAR {} +#[doc = "MOAR register accessor: an alias for `Reg`"] +pub type MOAR = crate::Reg; #[doc = "Message Object Arbitration Register"] pub mod moar; -#[doc = "Message Object Control Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [moctr](moctr) module"] -pub type MOCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOCTR; -#[doc = "`write(|w| ..)` method takes [moctr::W](moctr::W) writer structure"] -impl crate::Writable for MOCTR {} +#[doc = "MOCTR register accessor: an alias for `Reg`"] +pub type MOCTR = crate::Reg; #[doc = "Message Object Control Register"] pub mod moctr; -#[doc = "Message Object Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mostat](mostat) module"] -pub type MOSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MOSTAT; -#[doc = "`read()` method returns [mostat::R](mostat::R) reader structure"] -impl crate::Readable for MOSTAT {} +#[doc = "MOSTAT register accessor: an alias for `Reg`"] +pub type MOSTAT = crate::Reg; #[doc = "Message Object Status Register"] pub mod mostat; diff --git a/src/can_mo0/moamr.rs b/src/can_mo0/moamr.rs index e37d120b..6b6b8401 100644 --- a/src/can_mo0/moamr.rs +++ b/src/can_mo0/moamr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MOAMR"] -pub type R = crate::R; -#[doc = "Writer for register MOAMR"] -pub type W = crate::W; -#[doc = "Register MOAMR `reset()`'s with value 0x3fff_ffff"] -impl crate::ResetValue for super::MOAMR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x3fff_ffff +#[doc = "Register `MOAMR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `AM`"] -pub type AM_R = crate::R; -#[doc = "Write proxy for field `AM`"] +#[doc = "Register `MOAMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `AM` reader - Acceptance Mask for Message Identifier"] +pub struct AM_R(crate::FieldReader); +impl AM_R { + pub(crate) fn new(bits: u32) -> Self { + AM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AM` writer - Acceptance Mask for Message Identifier"] pub struct AM_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> AM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1fff_ffff) | ((value as u32) & 0x1fff_ffff); + self.w.bits = (self.w.bits & !0x1fff_ffff) | (value as u32 & 0x1fff_ffff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MIDE`"] -pub type MIDE_R = crate::R; +#[doc = "Field `MIDE` reader - Acceptance Mask Bit for Message IDE Bit"] +pub struct MIDE_R(crate::FieldReader); impl MIDE_R { + pub(crate) fn new(bits: bool) -> Self { + MIDE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MIDE_A { @@ -52,15 +91,22 @@ impl MIDE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MIDE_A::VALUE1 + **self == MIDE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MIDE_A::VALUE2 + **self == MIDE_A::VALUE2 + } +} +impl core::ops::Deref for MIDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MIDE`"] +#[doc = "Field `MIDE` writer - Acceptance Mask Bit for Message IDE Bit"] pub struct MIDE_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> MIDE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MIDE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Message object n accepts the reception of both, standard and extended frames."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> MIDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -122,4 +166,30 @@ impl W { pub fn mide(&mut self) -> MIDE_W { MIDE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Acceptance Mask Register\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 [moamr](index.html) module"] +pub struct MOAMR_SPEC; +impl crate::RegisterSpec for MOAMR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [moamr::R](R) reader structure"] +impl crate::Readable for MOAMR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [moamr::W](W) writer structure"] +impl crate::Writable for MOAMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOAMR to value 0x3fff_ffff"] +impl crate::Resettable for MOAMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3fff_ffff + } } diff --git a/src/can_mo0/moar.rs b/src/can_mo0/moar.rs index d37a48d0..2e4c5915 100644 --- a/src/can_mo0/moar.rs +++ b/src/can_mo0/moar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MOAR"] -pub type R = crate::R; -#[doc = "Writer for register MOAR"] -pub type W = crate::W; -#[doc = "Register MOAR `reset()`'s with value 0"] -impl crate::ResetValue for super::MOAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MOAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ID` reader - CAN Identifier of Message Object n"] +pub struct ID_R(crate::FieldReader); +impl ID_R { + pub(crate) fn new(bits: u32) -> Self { + ID_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ID`"] -pub type ID_R = crate::R; -#[doc = "Write proxy for field `ID`"] +#[doc = "Field `ID` writer - CAN Identifier of Message Object n"] pub struct ID_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> ID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1fff_ffff) | ((value as u32) & 0x1fff_ffff); + self.w.bits = (self.w.bits & !0x1fff_ffff) | (value as u32 & 0x1fff_ffff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IDE`"] -pub type IDE_R = crate::R; +#[doc = "Field `IDE` reader - Identifier Extension Bit of Message Object n"] +pub struct IDE_R(crate::FieldReader); impl IDE_R { + pub(crate) fn new(bits: bool) -> Self { + IDE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IDE_A { @@ -52,15 +91,22 @@ impl IDE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IDE_A::VALUE1 + **self == IDE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IDE_A::VALUE2 + **self == IDE_A::VALUE2 } } -#[doc = "Write proxy for field `IDE`"] +impl core::ops::Deref for IDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IDE` writer - Identifier Extension Bit of Message Object n"] pub struct IDE_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> IDE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IDE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Message object n handles standard frames with 11-bit identifier."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> IDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -118,9 +162,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRI`"] -pub type PRI_R = crate::R; +#[doc = "Field `PRI` reader - Priority Class"] +pub struct PRI_R(crate::FieldReader); impl PRI_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRI_A { @@ -135,25 +182,32 @@ impl PRI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRI_A::VALUE1 + **self == PRI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRI_A::VALUE2 + **self == PRI_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PRI_A::VALUE3 + **self == PRI_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PRI_A::VALUE4 + **self == PRI_A::VALUE4 } } -#[doc = "Write proxy for field `PRI`"] +impl core::ops::Deref for PRI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI` writer - Priority Class"] pub struct PRI_W<'a> { w: &'a mut W, } @@ -161,9 +215,7 @@ impl<'a> PRI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRI_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Applicable only if TTCAN is available."] #[inline(always)] @@ -188,7 +240,7 @@ impl<'a> PRI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -225,4 +277,30 @@ impl W { pub fn pri(&mut self) -> PRI_W { PRI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Arbitration Register\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 [moar](index.html) module"] +pub struct MOAR_SPEC; +impl crate::RegisterSpec for MOAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [moar::R](R) reader structure"] +impl crate::Readable for MOAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [moar::W](W) writer structure"] +impl crate::Writable for MOAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOAR to value 0"] +impl crate::Resettable for MOAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/moctr.rs b/src/can_mo0/moctr.rs index c9859626..5ca021d2 100644 --- a/src/can_mo0/moctr.rs +++ b/src/can_mo0/moctr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register MOCTR"] -pub type W = crate::W; -#[doc = "Register MOCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::MOCTR { - type Type = u32; +#[doc = "Register `MOCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `RESRXPND`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RESRXPND` writer - Reset/Set Receive Pending"] pub struct RESRXPND_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> RESRXPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SETRXPND`"] +#[doc = "Field `SETRXPND` writer - Reset/Set Receive Pending"] pub struct SETRXPND_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SETRXPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `RESTXPND`"] +#[doc = "Field `RESTXPND` writer - Reset/Set Transmit Pending"] pub struct RESTXPND_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> RESTXPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SETTXPND`"] +#[doc = "Field `SETTXPND` writer - Reset/Set Transmit Pending"] pub struct SETTXPND_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SETTXPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `RESRXUPD`"] +#[doc = "Field `RESRXUPD` writer - Reset/Set Receive Updating"] pub struct RESRXUPD_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> RESRXUPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SETRXUPD`"] +#[doc = "Field `SETRXUPD` writer - Reset/Set Receive Updating"] pub struct SETRXUPD_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SETRXUPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `RESNEWDAT`"] +#[doc = "Field `RESNEWDAT` writer - Reset/Set New Data"] pub struct RESNEWDAT_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> RESNEWDAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SETNEWDAT`"] +#[doc = "Field `SETNEWDAT` writer - Reset/Set New Data"] pub struct SETNEWDAT_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> SETNEWDAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `RESMSGLST`"] +#[doc = "Field `RESMSGLST` writer - Reset/Set Message Lost"] pub struct RESMSGLST_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> RESMSGLST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `SETMSGLST`"] +#[doc = "Field `SETMSGLST` writer - Reset/Set Message Lost"] pub struct SETMSGLST_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> SETMSGLST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `RESMSGVAL`"] +#[doc = "Field `RESMSGVAL` writer - Reset/Set Message Valid"] pub struct RESMSGVAL_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> RESMSGVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `SETMSGVAL`"] +#[doc = "Field `SETMSGVAL` writer - Reset/Set Message Valid"] pub struct SETMSGVAL_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> SETMSGVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `RESRTSEL`"] +#[doc = "Field `RESRTSEL` writer - Reset/Set Receive/Transmit Selected"] pub struct RESRTSEL_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> RESRTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `SETRTSEL`"] +#[doc = "Field `SETRTSEL` writer - Reset/Set Receive/Transmit Selected"] pub struct SETRTSEL_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> SETRTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `RESRXEN`"] +#[doc = "Field `RESRXEN` writer - Reset/Set Receive Enable"] pub struct RESRXEN_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> RESRXEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `SETRXEN`"] +#[doc = "Field `SETRXEN` writer - Reset/Set Receive Enable"] pub struct SETRXEN_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> SETRXEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `RESTXRQ`"] +#[doc = "Field `RESTXRQ` writer - Reset/Set Transmit Request"] pub struct RESTXRQ_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> RESTXRQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SETTXRQ`"] +#[doc = "Field `SETTXRQ` writer - Reset/Set Transmit Request"] pub struct SETTXRQ_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> SETTXRQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `RESTXEN0`"] +#[doc = "Field `RESTXEN0` writer - Reset/Set Transmit Enable 0"] pub struct RESTXEN0_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> RESTXEN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `SETTXEN0`"] +#[doc = "Field `SETTXEN0` writer - Reset/Set Transmit Enable 0"] pub struct SETTXEN0_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> SETTXEN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `RESTXEN1`"] +#[doc = "Field `RESTXEN1` writer - Reset/Set Transmit Enable 1"] pub struct RESTXEN1_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> RESTXEN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `SETTXEN1`"] +#[doc = "Field `SETTXEN1` writer - Reset/Set Transmit Enable 1"] pub struct SETTXEN1_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> SETTXEN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `RESDIR`"] +#[doc = "Field `RESDIR` writer - Reset/Set Message Direction"] pub struct RESDIR_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> RESDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `SETDIR`"] +#[doc = "Field `SETDIR` writer - Reset/Set Message Direction"] pub struct SETDIR_W<'a> { w: &'a mut W, } @@ -532,7 +543,7 @@ impl<'a> SETDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -657,4 +668,26 @@ impl W { pub fn setdir(&mut self) -> SETDIR_W { SETDIR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [moctr](index.html) module"] +pub struct MOCTR_SPEC; +impl crate::RegisterSpec for MOCTR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [moctr::W](W) writer structure"] +impl crate::Writable for MOCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOCTR to value 0"] +impl crate::Resettable for MOCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/modatah.rs b/src/can_mo0/modatah.rs index ac3975b8..e88ea39e 100644 --- a/src/can_mo0/modatah.rs +++ b/src/can_mo0/modatah.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MODATAH"] -pub type R = crate::R; -#[doc = "Writer for register MODATAH"] -pub type W = crate::W; -#[doc = "Register MODATAH `reset()`'s with value 0"] -impl crate::ResetValue for super::MODATAH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MODATAH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODATAH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `DB4`"] -pub type DB4_R = crate::R; -#[doc = "Write proxy for field `DB4`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DB4` reader - Data Byte 4 of Message Object n"] +pub struct DB4_R(crate::FieldReader); +impl DB4_R { + pub(crate) fn new(bits: u8) -> Self { + DB4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB4` writer - Data Byte 4 of Message Object n"] pub struct DB4_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DB4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `DB5`"] -pub type DB5_R = crate::R; -#[doc = "Write proxy for field `DB5`"] +#[doc = "Field `DB5` reader - Data Byte 5 of Message Object n"] +pub struct DB5_R(crate::FieldReader); +impl DB5_R { + pub(crate) fn new(bits: u8) -> Self { + DB5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB5` writer - Data Byte 5 of Message Object n"] pub struct DB5_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> DB5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `DB6`"] -pub type DB6_R = crate::R; -#[doc = "Write proxy for field `DB6`"] +#[doc = "Field `DB6` reader - Data Byte 6 of Message Object n"] +pub struct DB6_R(crate::FieldReader); +impl DB6_R { + pub(crate) fn new(bits: u8) -> Self { + DB6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB6` writer - Data Byte 6 of Message Object n"] pub struct DB6_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> DB6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `DB7`"] -pub type DB7_R = crate::R; -#[doc = "Write proxy for field `DB7`"] +#[doc = "Field `DB7` reader - Data Byte 7 of Message Object n"] +pub struct DB7_R(crate::FieldReader); +impl DB7_R { + pub(crate) fn new(bits: u8) -> Self { + DB7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB7` writer - Data Byte 7 of Message Object n"] pub struct DB7_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> DB7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn db7(&mut self) -> DB7_W { DB7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Data Register High\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 [modatah](index.html) module"] +pub struct MODATAH_SPEC; +impl crate::RegisterSpec for MODATAH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [modatah::R](R) reader structure"] +impl crate::Readable for MODATAH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [modatah::W](W) writer structure"] +impl crate::Writable for MODATAH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODATAH to value 0"] +impl crate::Resettable for MODATAH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/modatal.rs b/src/can_mo0/modatal.rs index 3baf4939..698738c6 100644 --- a/src/can_mo0/modatal.rs +++ b/src/can_mo0/modatal.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MODATAL"] -pub type R = crate::R; -#[doc = "Writer for register MODATAL"] -pub type W = crate::W; -#[doc = "Register MODATAL `reset()`'s with value 0"] -impl crate::ResetValue for super::MODATAL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MODATAL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODATAL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `DB0`"] -pub type DB0_R = crate::R; -#[doc = "Write proxy for field `DB0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DB0` reader - Data Byte 0 of Message Object n"] +pub struct DB0_R(crate::FieldReader); +impl DB0_R { + pub(crate) fn new(bits: u8) -> Self { + DB0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB0` writer - Data Byte 0 of Message Object n"] pub struct DB0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DB0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `DB1`"] -pub type DB1_R = crate::R; -#[doc = "Write proxy for field `DB1`"] +#[doc = "Field `DB1` reader - Data Byte 1 of Message Object n"] +pub struct DB1_R(crate::FieldReader); +impl DB1_R { + pub(crate) fn new(bits: u8) -> Self { + DB1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB1` writer - Data Byte 1 of Message Object n"] pub struct DB1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> DB1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `DB2`"] -pub type DB2_R = crate::R; -#[doc = "Write proxy for field `DB2`"] +#[doc = "Field `DB2` reader - Data Byte 2 of Message Object n"] +pub struct DB2_R(crate::FieldReader); +impl DB2_R { + pub(crate) fn new(bits: u8) -> Self { + DB2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB2` writer - Data Byte 2 of Message Object n"] pub struct DB2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> DB2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `DB3`"] -pub type DB3_R = crate::R; -#[doc = "Write proxy for field `DB3`"] +#[doc = "Field `DB3` reader - Data Byte 3 of Message Object n"] +pub struct DB3_R(crate::FieldReader); +impl DB3_R { + pub(crate) fn new(bits: u8) -> Self { + DB3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DB3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DB3` writer - Data Byte 3 of Message Object n"] pub struct DB3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> DB3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn db3(&mut self) -> DB3_W { DB3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Data Register Low\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 [modatal](index.html) module"] +pub struct MODATAL_SPEC; +impl crate::RegisterSpec for MODATAL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [modatal::R](R) reader structure"] +impl crate::Readable for MODATAL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [modatal::W](W) writer structure"] +impl crate::Writable for MODATAL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODATAL to value 0"] +impl crate::Resettable for MODATAL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/mofcr.rs b/src/can_mo0/mofcr.rs index 13c4d500..387e6904 100644 --- a/src/can_mo0/mofcr.rs +++ b/src/can_mo0/mofcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MOFCR"] -pub type R = crate::R; -#[doc = "Writer for register MOFCR"] -pub type W = crate::W; -#[doc = "Register MOFCR `reset()`'s with value 0"] -impl crate::ResetValue for super::MOFCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MOFCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOFCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Message Mode Control\n\nValue on reset: 0"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MMC`"] -pub type MMC_R = crate::R; +#[doc = "Field `MMC` reader - Message Mode Control"] +pub struct MMC_R(crate::FieldReader); impl MMC_R { + pub(crate) fn new(bits: u8) -> Self { + MMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MMC_A::VALUE1), - 1 => Val(MMC_A::VALUE2), - 2 => Val(MMC_A::VALUE3), - 3 => Val(MMC_A::VALUE4), - 4 => Val(MMC_A::VALUE5), - i => Res(i), + 0 => Some(MMC_A::VALUE1), + 1 => Some(MMC_A::VALUE2), + 2 => Some(MMC_A::VALUE3), + 3 => Some(MMC_A::VALUE4), + 4 => Some(MMC_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MMC_A::VALUE1 + **self == MMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MMC_A::VALUE2 + **self == MMC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MMC_A::VALUE3 + **self == MMC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MMC_A::VALUE4 + **self == MMC_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == MMC_A::VALUE5 + **self == MMC_A::VALUE5 } } -#[doc = "Write proxy for field `MMC`"] +impl core::ops::Deref for MMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MMC` writer - Message Mode Control"] pub struct MMC_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> MMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -129,9 +162,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GDFS`"] -pub type GDFS_R = crate::R; +#[doc = "Field `GDFS` reader - Gateway Data Frame Send"] +pub struct GDFS_R(crate::FieldReader); impl GDFS_R { + pub(crate) fn new(bits: bool) -> Self { + GDFS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GDFS_A { @@ -143,15 +179,22 @@ impl GDFS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GDFS_A::VALUE1 + **self == GDFS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GDFS_A::VALUE2 + **self == GDFS_A::VALUE2 + } +} +impl core::ops::Deref for GDFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GDFS`"] +#[doc = "Field `GDFS` writer - Gateway Data Frame Send"] pub struct GDFS_W<'a> { w: &'a mut W, } @@ -159,9 +202,7 @@ impl<'a> GDFS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GDFS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TXRQ is unchanged in the destination object."] #[inline(always)] @@ -186,7 +227,7 @@ impl<'a> GDFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -204,9 +245,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IDC`"] -pub type IDC_R = crate::R; +#[doc = "Field `IDC` reader - Identifier Copy"] +pub struct IDC_R(crate::FieldReader); impl IDC_R { + pub(crate) fn new(bits: bool) -> Self { + IDC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IDC_A { @@ -218,15 +262,22 @@ impl IDC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IDC_A::VALUE1 + **self == IDC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IDC_A::VALUE2 + **self == IDC_A::VALUE2 + } +} +impl core::ops::Deref for IDC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IDC`"] +#[doc = "Field `IDC` writer - Identifier Copy"] pub struct IDC_W<'a> { w: &'a mut W, } @@ -234,9 +285,7 @@ impl<'a> IDC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IDC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The identifier of the gateway source object is not copied."] #[inline(always)] @@ -261,7 +310,7 @@ impl<'a> IDC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -279,9 +328,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLCC`"] -pub type DLCC_R = crate::R; +#[doc = "Field `DLCC` reader - Data Length Code Copy"] +pub struct DLCC_R(crate::FieldReader); impl DLCC_R { + pub(crate) fn new(bits: bool) -> Self { + DLCC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLCC_A { @@ -293,15 +345,22 @@ impl DLCC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLCC_A::VALUE1 + **self == DLCC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLCC_A::VALUE2 + **self == DLCC_A::VALUE2 } } -#[doc = "Write proxy for field `DLCC`"] +impl core::ops::Deref for DLCC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLCC` writer - Data Length Code Copy"] pub struct DLCC_W<'a> { w: &'a mut W, } @@ -309,9 +368,7 @@ impl<'a> DLCC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLCC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Data length code is not copied."] #[inline(always)] @@ -336,7 +393,7 @@ impl<'a> DLCC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -354,9 +411,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DATC`"] -pub type DATC_R = crate::R; +#[doc = "Field `DATC` reader - Data Copy"] +pub struct DATC_R(crate::FieldReader); impl DATC_R { + pub(crate) fn new(bits: bool) -> Self { + DATC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DATC_A { @@ -368,15 +428,22 @@ impl DATC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DATC_A::VALUE1 + **self == DATC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DATC_A::VALUE2 + **self == DATC_A::VALUE2 + } +} +impl core::ops::Deref for DATC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DATC`"] +#[doc = "Field `DATC` writer - Data Copy"] pub struct DATC_W<'a> { w: &'a mut W, } @@ -384,9 +451,7 @@ impl<'a> DATC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DATC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Data fields are not copied."] #[inline(always)] @@ -411,7 +476,7 @@ impl<'a> DATC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -429,9 +494,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXIE`"] -pub type RXIE_R = crate::R; +#[doc = "Field `RXIE` reader - Receive Interrupt Enable"] +pub struct RXIE_R(crate::FieldReader); impl RXIE_R { + pub(crate) fn new(bits: bool) -> Self { + RXIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXIE_A { @@ -443,15 +511,22 @@ impl RXIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXIE_A::VALUE1 + **self == RXIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXIE_A::VALUE2 + **self == RXIE_A::VALUE2 } } -#[doc = "Write proxy for field `RXIE`"] +impl core::ops::Deref for RXIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXIE` writer - Receive Interrupt Enable"] pub struct RXIE_W<'a> { w: &'a mut W, } @@ -459,9 +534,7 @@ impl<'a> RXIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RXIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Message receive interrupt is disabled."] #[inline(always)] @@ -486,7 +559,7 @@ impl<'a> RXIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -504,9 +577,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXIE`"] -pub type TXIE_R = crate::R; +#[doc = "Field `TXIE` reader - Transmit Interrupt Enable"] +pub struct TXIE_R(crate::FieldReader); impl TXIE_R { + pub(crate) fn new(bits: bool) -> Self { + TXIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXIE_A { @@ -518,15 +594,22 @@ impl TXIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXIE_A::VALUE1 + **self == TXIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXIE_A::VALUE2 + **self == TXIE_A::VALUE2 } } -#[doc = "Write proxy for field `TXIE`"] +impl core::ops::Deref for TXIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXIE` writer - Transmit Interrupt Enable"] pub struct TXIE_W<'a> { w: &'a mut W, } @@ -534,9 +617,7 @@ impl<'a> TXIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TXIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Message transmit interrupt is disabled."] #[inline(always)] @@ -561,7 +642,7 @@ impl<'a> TXIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -579,9 +660,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OVIE`"] -pub type OVIE_R = crate::R; +#[doc = "Field `OVIE` reader - Overflow Interrupt Enable"] +pub struct OVIE_R(crate::FieldReader); impl OVIE_R { + pub(crate) fn new(bits: bool) -> Self { + OVIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OVIE_A { @@ -593,15 +677,22 @@ impl OVIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OVIE_A::VALUE1 + **self == OVIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OVIE_A::VALUE2 + **self == OVIE_A::VALUE2 } } -#[doc = "Write proxy for field `OVIE`"] +impl core::ops::Deref for OVIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVIE` writer - Overflow Interrupt Enable"] pub struct OVIE_W<'a> { w: &'a mut W, } @@ -609,9 +700,7 @@ impl<'a> OVIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OVIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "FIFO full interrupt is disabled."] #[inline(always)] @@ -636,7 +725,7 @@ impl<'a> OVIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -654,9 +743,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FRREN`"] -pub type FRREN_R = crate::R; +#[doc = "Field `FRREN` reader - Foreign Remote Request Enable"] +pub struct FRREN_R(crate::FieldReader); impl FRREN_R { + pub(crate) fn new(bits: bool) -> Self { + FRREN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FRREN_A { @@ -668,15 +760,22 @@ impl FRREN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FRREN_A::VALUE1 + **self == FRREN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FRREN_A::VALUE2 + **self == FRREN_A::VALUE2 + } +} +impl core::ops::Deref for FRREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FRREN`"] +#[doc = "Field `FRREN` writer - Foreign Remote Request Enable"] pub struct FRREN_W<'a> { w: &'a mut W, } @@ -684,9 +783,7 @@ impl<'a> FRREN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FRREN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TXRQ of message object n is set on reception of a matching Remote Frame."] #[inline(always)] @@ -711,7 +808,7 @@ impl<'a> FRREN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -729,9 +826,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RMM`"] -pub type RMM_R = crate::R; +#[doc = "Field `RMM` reader - Transmit Object Remote Monitoring"] +pub struct RMM_R(crate::FieldReader); impl RMM_R { + pub(crate) fn new(bits: bool) -> Self { + RMM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RMM_A { @@ -743,15 +843,22 @@ impl RMM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RMM_A::VALUE1 + **self == RMM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RMM_A::VALUE2 + **self == RMM_A::VALUE2 } } -#[doc = "Write proxy for field `RMM`"] +impl core::ops::Deref for RMM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RMM` writer - Transmit Object Remote Monitoring"] pub struct RMM_W<'a> { w: &'a mut W, } @@ -759,9 +866,7 @@ impl<'a> RMM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RMM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Remote monitoring is disabled: Identifier, IDE bit, and DLC of message object n remain unchanged upon the reception of a matching Remote Frame."] #[inline(always)] @@ -786,13 +891,25 @@ impl<'a> RMM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `SDT`"] -pub type SDT_R = crate::R; -#[doc = "Write proxy for field `SDT`"] +#[doc = "Field `SDT` reader - Single Data Transfer"] +pub struct SDT_R(crate::FieldReader); +impl SDT_R { + pub(crate) fn new(bits: bool) -> Self { + SDT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SDT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SDT` writer - Single Data Transfer"] pub struct SDT_W<'a> { w: &'a mut W, } @@ -810,13 +927,25 @@ impl<'a> SDT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Reader of field `STT`"] -pub type STT_R = crate::R; -#[doc = "Write proxy for field `STT`"] +#[doc = "Field `STT` reader - Single Transmit Trial"] +pub struct STT_R(crate::FieldReader); +impl STT_R { + pub(crate) fn new(bits: bool) -> Self { + STT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STT` writer - Single Transmit Trial"] pub struct STT_W<'a> { w: &'a mut W, } @@ -834,13 +963,25 @@ impl<'a> STT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Reader of field `DLC`"] -pub type DLC_R = crate::R; -#[doc = "Write proxy for field `DLC`"] +#[doc = "Field `DLC` reader - Data Length Code"] +pub struct DLC_R(crate::FieldReader); +impl DLC_R { + pub(crate) fn new(bits: u8) -> Self { + DLC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DLC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLC` writer - Data Length Code"] pub struct DLC_W<'a> { w: &'a mut W, } @@ -848,7 +989,7 @@ impl<'a> DLC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -985,4 +1126,30 @@ impl W { pub fn dlc(&mut self) -> DLC_W { DLC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Function Control Register\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 [mofcr](index.html) module"] +pub struct MOFCR_SPEC; +impl crate::RegisterSpec for MOFCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mofcr::R](R) reader structure"] +impl crate::Readable for MOFCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mofcr::W](W) writer structure"] +impl crate::Writable for MOFCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOFCR to value 0"] +impl crate::Resettable for MOFCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/mofgpr.rs b/src/can_mo0/mofgpr.rs index cb6e739b..2b8268ef 100644 --- a/src/can_mo0/mofgpr.rs +++ b/src/can_mo0/mofgpr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MOFGPR"] -pub type R = crate::R; -#[doc = "Writer for register MOFGPR"] -pub type W = crate::W; -#[doc = "Register MOFGPR `reset()`'s with value 0"] -impl crate::ResetValue for super::MOFGPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MOFGPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOFGPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `BOT`"] -pub type BOT_R = crate::R; -#[doc = "Write proxy for field `BOT`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BOT` reader - Bottom Pointer"] +pub struct BOT_R(crate::FieldReader); +impl BOT_R { + pub(crate) fn new(bits: u8) -> Self { + BOT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BOT` writer - Bottom Pointer"] pub struct BOT_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> BOT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `TOP`"] -pub type TOP_R = crate::R; -#[doc = "Write proxy for field `TOP`"] +#[doc = "Field `TOP` reader - Top Pointer"] +pub struct TOP_R(crate::FieldReader); +impl TOP_R { + pub(crate) fn new(bits: u8) -> Self { + TOP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TOP` writer - Top Pointer"] pub struct TOP_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> TOP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CUR`"] -pub type CUR_R = crate::R; -#[doc = "Write proxy for field `CUR`"] +#[doc = "Field `CUR` reader - Current Object Pointer"] +pub struct CUR_R(crate::FieldReader); +impl CUR_R { + pub(crate) fn new(bits: u8) -> Self { + CUR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CUR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CUR` writer - Current Object Pointer"] pub struct CUR_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> CUR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `SEL`"] -pub type SEL_R = crate::R; -#[doc = "Write proxy for field `SEL`"] +#[doc = "Field `SEL` reader - Object Select Pointer"] +pub struct SEL_R(crate::FieldReader); +impl SEL_R { + pub(crate) fn new(bits: u8) -> Self { + SEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEL` writer - Object Select Pointer"] pub struct SEL_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn sel(&mut self) -> SEL_W { SEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object FIFO/Gateway Pointer Register\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 [mofgpr](index.html) module"] +pub struct MOFGPR_SPEC; +impl crate::RegisterSpec for MOFGPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mofgpr::R](R) reader structure"] +impl crate::Readable for MOFGPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mofgpr::W](W) writer structure"] +impl crate::Writable for MOFGPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOFGPR to value 0"] +impl crate::Resettable for MOFGPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/moipr.rs b/src/can_mo0/moipr.rs index 0341bef0..1aecf609 100644 --- a/src/can_mo0/moipr.rs +++ b/src/can_mo0/moipr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MOIPR"] -pub type R = crate::R; -#[doc = "Writer for register MOIPR"] -pub type W = crate::W; -#[doc = "Register MOIPR `reset()`'s with value 0"] -impl crate::ResetValue for super::MOIPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MOIPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOIPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Receive Interrupt Node Pointer\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `RXINP`"] -pub type RXINP_R = crate::R; +#[doc = "Field `RXINP` reader - Receive Interrupt Node Pointer"] +pub struct RXINP_R(crate::FieldReader); impl RXINP_R { + pub(crate) fn new(bits: u8) -> Self { + RXINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(RXINP_A::VALUE1), - 1 => Val(RXINP_A::VALUE2), - 7 => Val(RXINP_A::VALUE3), - i => Res(i), + 0 => Some(RXINP_A::VALUE1), + 1 => Some(RXINP_A::VALUE2), + 7 => Some(RXINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXINP_A::VALUE1 + **self == RXINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXINP_A::VALUE2 + **self == RXINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == RXINP_A::VALUE3 + **self == RXINP_A::VALUE3 + } +} +impl core::ops::Deref for RXINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RXINP`"] +#[doc = "Field `RXINP` writer - Receive Interrupt Node Pointer"] pub struct RXINP_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> RXINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TXINP`"] -pub type TXINP_R = crate::R; +#[doc = "Field `TXINP` reader - Transmit Interrupt Node Pointer"] +pub struct TXINP_R(crate::FieldReader); impl TXINP_R { + pub(crate) fn new(bits: u8) -> Self { + TXINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TXINP_A::VALUE1), - 1 => Val(TXINP_A::VALUE2), - 7 => Val(TXINP_A::VALUE3), - i => Res(i), + 0 => Some(TXINP_A::VALUE1), + 1 => Some(TXINP_A::VALUE2), + 7 => Some(TXINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXINP_A::VALUE1 + **self == TXINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXINP_A::VALUE2 + **self == TXINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TXINP_A::VALUE3 + **self == TXINP_A::VALUE3 } } -#[doc = "Write proxy for field `TXINP`"] +impl core::ops::Deref for TXINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXINP` writer - Transmit Interrupt Node Pointer"] pub struct TXINP_W<'a> { w: &'a mut W, } @@ -164,13 +206,25 @@ impl<'a> TXINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `MPN`"] -pub type MPN_R = crate::R; -#[doc = "Write proxy for field `MPN`"] +#[doc = "Field `MPN` reader - Message Pending Number"] +pub struct MPN_R(crate::FieldReader); +impl MPN_R { + pub(crate) fn new(bits: u8) -> Self { + MPN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPN` writer - Message Pending Number"] pub struct MPN_W<'a> { w: &'a mut W, } @@ -178,13 +232,25 @@ impl<'a> MPN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CFCVAL`"] -pub type CFCVAL_R = crate::R; -#[doc = "Write proxy for field `CFCVAL`"] +#[doc = "Field `CFCVAL` reader - CAN Frame Counter Value"] +pub struct CFCVAL_R(crate::FieldReader); +impl CFCVAL_R { + pub(crate) fn new(bits: u16) -> Self { + CFCVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CFCVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CFCVAL` writer - CAN Frame Counter Value"] pub struct CFCVAL_W<'a> { w: &'a mut W, } @@ -192,7 +258,7 @@ impl<'a> CFCVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -239,4 +305,30 @@ impl W { pub fn cfcval(&mut self) -> CFCVAL_W { CFCVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Message Object Interrupt Pointer Register\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 [moipr](index.html) module"] +pub struct MOIPR_SPEC; +impl crate::RegisterSpec for MOIPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [moipr::R](R) reader structure"] +impl crate::Readable for MOIPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [moipr::W](W) writer structure"] +impl crate::Writable for MOIPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOIPR to value 0"] +impl crate::Resettable for MOIPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_mo0/mostat.rs b/src/can_mo0/mostat.rs index af386366..d9c61c19 100644 --- a/src/can_mo0/mostat.rs +++ b/src/can_mo0/mostat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register MOSTAT"] -pub type R = crate::R; +#[doc = "Register `MOSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Receive Pending\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RXPND_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXPND`"] -pub type RXPND_R = crate::R; +#[doc = "Field `RXPND` reader - Receive Pending"] +pub struct RXPND_R(crate::FieldReader); impl RXPND_R { + pub(crate) fn new(bits: bool) -> Self { + RXPND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXPND_A { @@ -28,12 +44,19 @@ impl RXPND_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXPND_A::VALUE1 + **self == RXPND_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXPND_A::VALUE2 + **self == RXPND_A::VALUE2 + } +} +impl core::ops::Deref for RXPND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Pending\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXPND`"] -pub type TXPND_R = crate::R; +#[doc = "Field `TXPND` reader - Transmit Pending"] +pub struct TXPND_R(crate::FieldReader); impl TXPND_R { + pub(crate) fn new(bits: bool) -> Self { + TXPND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXPND_A { @@ -64,12 +90,19 @@ impl TXPND_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXPND_A::VALUE1 + **self == TXPND_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXPND_A::VALUE2 + **self == TXPND_A::VALUE2 + } +} +impl core::ops::Deref for TXPND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Updating\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXUPD`"] -pub type RXUPD_R = crate::R; +#[doc = "Field `RXUPD` reader - Receive Updating"] +pub struct RXUPD_R(crate::FieldReader); impl RXUPD_R { + pub(crate) fn new(bits: bool) -> Self { + RXUPD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXUPD_A { @@ -100,12 +136,19 @@ impl RXUPD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXUPD_A::VALUE1 + **self == RXUPD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXUPD_A::VALUE2 + **self == RXUPD_A::VALUE2 + } +} +impl core::ops::Deref for RXUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "New Data\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NEWDAT`"] -pub type NEWDAT_R = crate::R; +#[doc = "Field `NEWDAT` reader - New Data"] +pub struct NEWDAT_R(crate::FieldReader); impl NEWDAT_R { + pub(crate) fn new(bits: bool) -> Self { + NEWDAT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NEWDAT_A { @@ -136,12 +182,19 @@ impl NEWDAT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NEWDAT_A::VALUE1 + **self == NEWDAT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NEWDAT_A::VALUE2 + **self == NEWDAT_A::VALUE2 + } +} +impl core::ops::Deref for NEWDAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Message Lost\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSGLST`"] -pub type MSGLST_R = crate::R; +#[doc = "Field `MSGLST` reader - Message Lost"] +pub struct MSGLST_R(crate::FieldReader); impl MSGLST_R { + pub(crate) fn new(bits: bool) -> Self { + MSGLST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSGLST_A { @@ -172,12 +228,19 @@ impl MSGLST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSGLST_A::VALUE1 + **self == MSGLST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSGLST_A::VALUE2 + **self == MSGLST_A::VALUE2 + } +} +impl core::ops::Deref for MSGLST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Message Valid\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSGVAL`"] -pub type MSGVAL_R = crate::R; +#[doc = "Field `MSGVAL` reader - Message Valid"] +pub struct MSGVAL_R(crate::FieldReader); impl MSGVAL_R { + pub(crate) fn new(bits: bool) -> Self { + MSGVAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSGVAL_A { @@ -208,12 +274,19 @@ impl MSGVAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSGVAL_A::VALUE1 + **self == MSGVAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSGVAL_A::VALUE2 + **self == MSGVAL_A::VALUE2 + } +} +impl core::ops::Deref for MSGVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive/Transmit Selected\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTSEL`"] -pub type RTSEL_R = crate::R; +#[doc = "Field `RTSEL` reader - Receive/Transmit Selected"] +pub struct RTSEL_R(crate::FieldReader); impl RTSEL_R { + pub(crate) fn new(bits: bool) -> Self { + RTSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTSEL_A { @@ -244,12 +320,19 @@ impl RTSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTSEL_A::VALUE1 + **self == RTSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTSEL_A::VALUE2 + **self == RTSEL_A::VALUE2 + } +} +impl core::ops::Deref for RTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Enable\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXEN`"] -pub type RXEN_R = crate::R; +#[doc = "Field `RXEN` reader - Receive Enable"] +pub struct RXEN_R(crate::FieldReader); impl RXEN_R { + pub(crate) fn new(bits: bool) -> Self { + RXEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXEN_A { @@ -280,12 +366,19 @@ impl RXEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXEN_A::VALUE1 + **self == RXEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXEN_A::VALUE2 + **self == RXEN_A::VALUE2 + } +} +impl core::ops::Deref for RXEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Request\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXRQ`"] -pub type TXRQ_R = crate::R; +#[doc = "Field `TXRQ` reader - Transmit Request"] +pub struct TXRQ_R(crate::FieldReader); impl TXRQ_R { + pub(crate) fn new(bits: bool) -> Self { + TXRQ_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXRQ_A { @@ -316,12 +412,19 @@ impl TXRQ_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXRQ_A::VALUE1 + **self == TXRQ_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXRQ_A::VALUE2 + **self == TXRQ_A::VALUE2 + } +} +impl core::ops::Deref for TXRQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Enable 0\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXEN0`"] -pub type TXEN0_R = crate::R; +#[doc = "Field `TXEN0` reader - Transmit Enable 0"] +pub struct TXEN0_R(crate::FieldReader); impl TXEN0_R { + pub(crate) fn new(bits: bool) -> Self { + TXEN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXEN0_A { @@ -352,12 +458,19 @@ impl TXEN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXEN0_A::VALUE1 + **self == TXEN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXEN0_A::VALUE2 + **self == TXEN0_A::VALUE2 + } +} +impl core::ops::Deref for TXEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Enable 1\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXEN1`"] -pub type TXEN1_R = crate::R; +#[doc = "Field `TXEN1` reader - Transmit Enable 1"] +pub struct TXEN1_R(crate::FieldReader); impl TXEN1_R { + pub(crate) fn new(bits: bool) -> Self { + TXEN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXEN1_A { @@ -388,12 +504,19 @@ impl TXEN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXEN1_A::VALUE1 + **self == TXEN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXEN1_A::VALUE2 + **self == TXEN1_A::VALUE2 + } +} +impl core::ops::Deref for TXEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Message Direction\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIR`"] -pub type DIR_R = crate::R; +#[doc = "Field `DIR` reader - Message Direction"] +pub struct DIR_R(crate::FieldReader); impl DIR_R { + pub(crate) fn new(bits: bool) -> Self { + DIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIR_A { @@ -424,20 +550,63 @@ impl DIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIR_A::VALUE1 + **self == DIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIR_A::VALUE2 + **self == DIR_A::VALUE2 + } +} +impl core::ops::Deref for DIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIST` reader - List Allocation"] +pub struct LIST_R(crate::FieldReader); +impl LIST_R { + pub(crate) fn new(bits: u8) -> Self { + LIST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LIST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPREV` reader - Pointer to Previous Message Object"] +pub struct PPREV_R(crate::FieldReader); +impl PPREV_R { + pub(crate) fn new(bits: u8) -> Self { + PPREV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PPREV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PNEXT` reader - Pointer to Next Message Object"] +pub struct PNEXT_R(crate::FieldReader); +impl PNEXT_R { + pub(crate) fn new(bits: u8) -> Self { + PNEXT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PNEXT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `LIST`"] -pub type LIST_R = crate::R; -#[doc = "Reader of field `PPREV`"] -pub type PPREV_R = crate::R; -#[doc = "Reader of field `PNEXT`"] -pub type PNEXT_R = crate::R; impl R { #[doc = "Bit 0 - Receive Pending"] #[inline(always)] @@ -515,3 +684,19 @@ impl R { PNEXT_R::new(((self.bits >> 24) & 0xff) as u8) } } +#[doc = "Message Object Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mostat](index.html) module"] +pub struct MOSTAT_SPEC; +impl crate::RegisterSpec for MOSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mostat::R](R) reader structure"] +impl crate::Readable for MOSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MOSTAT to value 0"] +impl crate::Resettable for MOSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/can_node0.rs b/src/can_node0.rs index 14aa3474..f79bb150 100644 --- a/src/can_node0.rs +++ b/src/can_node0.rs @@ -2,94 +2,45 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Node Control Register"] - pub ncr: NCR, + pub ncr: crate::Reg, #[doc = "0x04 - Node Status Register"] - pub nsr: NSR, + pub nsr: crate::Reg, #[doc = "0x08 - Node Interrupt Pointer Register"] - pub nipr: NIPR, + pub nipr: crate::Reg, #[doc = "0x0c - Node Port Control Register"] - pub npcr: NPCR, + pub npcr: crate::Reg, #[doc = "0x10 - Node Bit Timing Register"] - pub nbtr: NBTR, + pub nbtr: crate::Reg, #[doc = "0x14 - Node Error Counter Register"] - pub necnt: NECNT, + pub necnt: crate::Reg, #[doc = "0x18 - Node Frame Counter Register"] - pub nfcr: NFCR, + pub nfcr: crate::Reg, } -#[doc = "Node Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ncr](ncr) module"] -pub type NCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NCR; -#[doc = "`read()` method returns [ncr::R](ncr::R) reader structure"] -impl crate::Readable for NCR {} -#[doc = "`write(|w| ..)` method takes [ncr::W](ncr::W) writer structure"] -impl crate::Writable for NCR {} +#[doc = "NCR register accessor: an alias for `Reg`"] +pub type NCR = crate::Reg; #[doc = "Node Control Register"] pub mod ncr; -#[doc = "Node Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nsr](nsr) module"] -pub type NSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NSR; -#[doc = "`read()` method returns [nsr::R](nsr::R) reader structure"] -impl crate::Readable for NSR {} -#[doc = "`write(|w| ..)` method takes [nsr::W](nsr::W) writer structure"] -impl crate::Writable for NSR {} +#[doc = "NSR register accessor: an alias for `Reg`"] +pub type NSR = crate::Reg; #[doc = "Node Status Register"] pub mod nsr; -#[doc = "Node Interrupt Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nipr](nipr) module"] -pub type NIPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NIPR; -#[doc = "`read()` method returns [nipr::R](nipr::R) reader structure"] -impl crate::Readable for NIPR {} -#[doc = "`write(|w| ..)` method takes [nipr::W](nipr::W) writer structure"] -impl crate::Writable for NIPR {} +#[doc = "NIPR register accessor: an alias for `Reg`"] +pub type NIPR = crate::Reg; #[doc = "Node Interrupt Pointer Register"] pub mod nipr; -#[doc = "Node Port Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [npcr](npcr) module"] -pub type NPCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NPCR; -#[doc = "`read()` method returns [npcr::R](npcr::R) reader structure"] -impl crate::Readable for NPCR {} -#[doc = "`write(|w| ..)` method takes [npcr::W](npcr::W) writer structure"] -impl crate::Writable for NPCR {} +#[doc = "NPCR register accessor: an alias for `Reg`"] +pub type NPCR = crate::Reg; #[doc = "Node Port Control Register"] pub mod npcr; -#[doc = "Node Bit Timing Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nbtr](nbtr) module"] -pub type NBTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NBTR; -#[doc = "`read()` method returns [nbtr::R](nbtr::R) reader structure"] -impl crate::Readable for NBTR {} -#[doc = "`write(|w| ..)` method takes [nbtr::W](nbtr::W) writer structure"] -impl crate::Writable for NBTR {} +#[doc = "NBTR register accessor: an alias for `Reg`"] +pub type NBTR = crate::Reg; #[doc = "Node Bit Timing Register"] pub mod nbtr; -#[doc = "Node Error Counter Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [necnt](necnt) module"] -pub type NECNT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NECNT; -#[doc = "`read()` method returns [necnt::R](necnt::R) reader structure"] -impl crate::Readable for NECNT {} -#[doc = "`write(|w| ..)` method takes [necnt::W](necnt::W) writer structure"] -impl crate::Writable for NECNT {} +#[doc = "NECNT register accessor: an alias for `Reg`"] +pub type NECNT = crate::Reg; #[doc = "Node Error Counter Register"] pub mod necnt; -#[doc = "Node Frame Counter Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcr](nfcr) module"] -pub type NFCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NFCR; -#[doc = "`read()` method returns [nfcr::R](nfcr::R) reader structure"] -impl crate::Readable for NFCR {} -#[doc = "`write(|w| ..)` method takes [nfcr::W](nfcr::W) writer structure"] -impl crate::Writable for NFCR {} +#[doc = "NFCR register accessor: an alias for `Reg`"] +pub type NFCR = crate::Reg; #[doc = "Node Frame Counter Register"] pub mod nfcr; diff --git a/src/can_node0/nbtr.rs b/src/can_node0/nbtr.rs index 200cc48f..92a13eea 100644 --- a/src/can_node0/nbtr.rs +++ b/src/can_node0/nbtr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NBTR"] -pub type R = crate::R; -#[doc = "Writer for register NBTR"] -pub type W = crate::W; -#[doc = "Register NBTR `reset()`'s with value 0"] -impl crate::ResetValue for super::NBTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NBTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NBTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BRP` reader - Baud Rate Prescaler"] +pub struct BRP_R(crate::FieldReader); +impl BRP_R { + pub(crate) fn new(bits: u8) -> Self { + BRP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BRP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `BRP`"] -pub type BRP_R = crate::R; -#[doc = "Write proxy for field `BRP`"] +#[doc = "Field `BRP` writer - Baud Rate Prescaler"] pub struct BRP_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> BRP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `SJW`"] -pub type SJW_R = crate::R; -#[doc = "Write proxy for field `SJW`"] +#[doc = "Field `SJW` reader - (Re) Synchronization Jump Width"] +pub struct SJW_R(crate::FieldReader); +impl SJW_R { + pub(crate) fn new(bits: u8) -> Self { + SJW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SJW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SJW` writer - (Re) Synchronization Jump Width"] pub struct SJW_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> SJW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } -#[doc = "Reader of field `TSEG1`"] -pub type TSEG1_R = crate::R; -#[doc = "Write proxy for field `TSEG1`"] +#[doc = "Field `TSEG1` reader - Time Segment Before Sample Point"] +pub struct TSEG1_R(crate::FieldReader); +impl TSEG1_R { + pub(crate) fn new(bits: u8) -> Self { + TSEG1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSEG1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSEG1` writer - Time Segment Before Sample Point"] pub struct TSEG1_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> TSEG1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `TSEG2`"] -pub type TSEG2_R = crate::R; -#[doc = "Write proxy for field `TSEG2`"] +#[doc = "Field `TSEG2` reader - Time Segment After Sample Point"] +pub struct TSEG2_R(crate::FieldReader); +impl TSEG2_R { + pub(crate) fn new(bits: u8) -> Self { + TSEG2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSEG2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSEG2` writer - Time Segment After Sample Point"] pub struct TSEG2_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> TSEG2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } @@ -80,9 +152,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIV8`"] -pub type DIV8_R = crate::R; +#[doc = "Field `DIV8` reader - Divide Prescaler Clock by 8"] +pub struct DIV8_R(crate::FieldReader); impl DIV8_R { + pub(crate) fn new(bits: bool) -> Self { + DIV8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIV8_A { @@ -94,15 +169,22 @@ impl DIV8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIV8_A::VALUE1 + **self == DIV8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIV8_A::VALUE2 + **self == DIV8_A::VALUE2 + } +} +impl core::ops::Deref for DIV8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DIV8`"] +#[doc = "Field `DIV8` writer - Divide Prescaler Clock by 8"] pub struct DIV8_W<'a> { w: &'a mut W, } @@ -110,9 +192,7 @@ impl<'a> DIV8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIV8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A time quantum lasts (BRP+1) clock cycles."] #[inline(always)] @@ -137,7 +217,7 @@ impl<'a> DIV8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -194,4 +274,30 @@ impl W { pub fn div8(&mut self) -> DIV8_W { DIV8_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Bit Timing Register\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 [nbtr](index.html) module"] +pub struct NBTR_SPEC; +impl crate::RegisterSpec for NBTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nbtr::R](R) reader structure"] +impl crate::Readable for NBTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nbtr::W](W) writer structure"] +impl crate::Writable for NBTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NBTR to value 0"] +impl crate::Resettable for NBTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_node0/ncr.rs b/src/can_node0/ncr.rs index c65db9f4..8ab663fb 100644 --- a/src/can_node0/ncr.rs +++ b/src/can_node0/ncr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NCR"] -pub type R = crate::R; -#[doc = "Writer for register NCR"] -pub type W = crate::W; -#[doc = "Register NCR `reset()`'s with value 0x01"] -impl crate::ResetValue for super::NCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `NCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Node Initialization\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INIT`"] -pub type INIT_R = crate::R; +#[doc = "Field `INIT` reader - Node Initialization"] +pub struct INIT_R(crate::FieldReader); impl INIT_R { + pub(crate) fn new(bits: bool) -> Self { + INIT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INIT_A { @@ -38,15 +65,22 @@ impl INIT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INIT_A::VALUE1 + **self == INIT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INIT_A::VALUE2 + **self == INIT_A::VALUE2 + } +} +impl core::ops::Deref for INIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `INIT`"] +#[doc = "Field `INIT` writer - Node Initialization"] pub struct INIT_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> INIT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INIT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Resetting bit INIT enables the participation of the node in the CAN traffic. If the CAN node is in the bus-off state, the ongoing bus-off recovery (which does not depend on the INIT bit) is continued. With the end of the bus-off recovery sequence the CAN node is allowed to take part in the CAN traffic. If the CAN node is not in the bus-off state, a sequence of 11 consecutive recessive bits must be detected before the node is allowed to take part in the CAN traffic."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> INIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRIE`"] -pub type TRIE_R = crate::R; +#[doc = "Field `TRIE` reader - Transfer Interrupt Enable"] +pub struct TRIE_R(crate::FieldReader); impl TRIE_R { + pub(crate) fn new(bits: bool) -> Self { + TRIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRIE_A { @@ -113,15 +148,22 @@ impl TRIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRIE_A::VALUE1 + **self == TRIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRIE_A::VALUE2 + **self == TRIE_A::VALUE2 } } -#[doc = "Write proxy for field `TRIE`"] +impl core::ops::Deref for TRIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIE` writer - Transfer Interrupt Enable"] pub struct TRIE_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> TRIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Transfer interrupt is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> TRIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LECIE`"] -pub type LECIE_R = crate::R; +#[doc = "Field `LECIE` reader - LEC Indicated Error Interrupt Enable"] +pub struct LECIE_R(crate::FieldReader); impl LECIE_R { + pub(crate) fn new(bits: bool) -> Self { + LECIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LECIE_A { @@ -188,15 +231,22 @@ impl LECIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LECIE_A::VALUE1 + **self == LECIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LECIE_A::VALUE2 + **self == LECIE_A::VALUE2 + } +} +impl core::ops::Deref for LECIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LECIE`"] +#[doc = "Field `LECIE` writer - LEC Indicated Error Interrupt Enable"] pub struct LECIE_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> LECIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LECIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Last error code interrupt is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> LECIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ALIE`"] -pub type ALIE_R = crate::R; +#[doc = "Field `ALIE` reader - Alert Interrupt Enable"] +pub struct ALIE_R(crate::FieldReader); impl ALIE_R { + pub(crate) fn new(bits: bool) -> Self { + ALIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ALIE_A { @@ -263,15 +314,22 @@ impl ALIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ALIE_A::VALUE1 + **self == ALIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ALIE_A::VALUE2 + **self == ALIE_A::VALUE2 } } -#[doc = "Write proxy for field `ALIE`"] +impl core::ops::Deref for ALIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALIE` writer - Alert Interrupt Enable"] pub struct ALIE_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> ALIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ALIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Alert interrupt is disabled."] #[inline(always)] @@ -306,13 +362,25 @@ impl<'a> ALIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CANDIS`"] -pub type CANDIS_R = crate::R; -#[doc = "Write proxy for field `CANDIS`"] +#[doc = "Field `CANDIS` reader - CAN Disable"] +pub struct CANDIS_R(crate::FieldReader); +impl CANDIS_R { + pub(crate) fn new(bits: bool) -> Self { + CANDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CANDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CANDIS` writer - CAN Disable"] pub struct CANDIS_W<'a> { w: &'a mut W, } @@ -330,7 +398,7 @@ impl<'a> CANDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -348,9 +416,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCE`"] -pub type CCE_R = crate::R; +#[doc = "Field `CCE` reader - Configuration Change Enable"] +pub struct CCE_R(crate::FieldReader); impl CCE_R { + pub(crate) fn new(bits: bool) -> Self { + CCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCE_A { @@ -362,15 +433,22 @@ impl CCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCE_A::VALUE1 + **self == CCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCE_A::VALUE2 + **self == CCE_A::VALUE2 } } -#[doc = "Write proxy for field `CCE`"] +impl core::ops::Deref for CCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCE` writer - Configuration Change Enable"] pub struct CCE_W<'a> { w: &'a mut W, } @@ -378,9 +456,7 @@ impl<'a> CCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The Bit Timing Register, the Port Control Register, and the Error Counter Register may only be read. All attempts to modify them are ignored."] #[inline(always)] @@ -405,13 +481,25 @@ impl<'a> CCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CALM`"] -pub type CALM_R = crate::R; -#[doc = "Write proxy for field `CALM`"] +#[doc = "Field `CALM` reader - CAN Analyzer Mode"] +pub struct CALM_R(crate::FieldReader); +impl CALM_R { + pub(crate) fn new(bits: bool) -> Self { + CALM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CALM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CALM` writer - CAN Analyzer Mode"] pub struct CALM_W<'a> { w: &'a mut W, } @@ -429,7 +517,7 @@ impl<'a> CALM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -447,9 +535,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SUSEN`"] -pub type SUSEN_R = crate::R; +#[doc = "Field `SUSEN` reader - Suspend Enable"] +pub struct SUSEN_R(crate::FieldReader); impl SUSEN_R { + pub(crate) fn new(bits: bool) -> Self { + SUSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSEN_A { @@ -461,15 +552,22 @@ impl SUSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSEN_A::VALUE1 + **self == SUSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSEN_A::VALUE2 + **self == SUSEN_A::VALUE2 + } +} +impl core::ops::Deref for SUSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SUSEN`"] +#[doc = "Field `SUSEN` writer - Suspend Enable"] pub struct SUSEN_W<'a> { w: &'a mut W, } @@ -477,9 +575,7 @@ impl<'a> SUSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SUSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An OCDS suspend trigger is ignored by the CAN node."] #[inline(always)] @@ -504,7 +600,7 @@ impl<'a> SUSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -591,4 +687,30 @@ impl W { pub fn susen(&mut self) -> SUSEN_W { SUSEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Control Register\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 [ncr](index.html) module"] +pub struct NCR_SPEC; +impl crate::RegisterSpec for NCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ncr::R](R) reader structure"] +impl crate::Readable for NCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ncr::W](W) writer structure"] +impl crate::Writable for NCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NCR to value 0x01"] +impl crate::Resettable for NCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/can_node0/necnt.rs b/src/can_node0/necnt.rs index 67ec947c..8ed68b7e 100644 --- a/src/can_node0/necnt.rs +++ b/src/can_node0/necnt.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NECNT"] -pub type R = crate::R; -#[doc = "Writer for register NECNT"] -pub type W = crate::W; -#[doc = "Register NECNT `reset()`'s with value 0x0060_0000"] -impl crate::ResetValue for super::NECNT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0060_0000 +#[doc = "Register `NECNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NECNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `REC`"] -pub type REC_R = crate::R; -#[doc = "Write proxy for field `REC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REC` reader - Receive Error Counter"] +pub struct REC_R(crate::FieldReader); +impl REC_R { + pub(crate) fn new(bits: u8) -> Self { + REC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REC` writer - Receive Error Counter"] pub struct REC_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> REC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `TEC`"] -pub type TEC_R = crate::R; -#[doc = "Write proxy for field `TEC`"] +#[doc = "Field `TEC` reader - Transmit Error Counter"] +pub struct TEC_R(crate::FieldReader); +impl TEC_R { + pub(crate) fn new(bits: u8) -> Self { + TEC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEC` writer - Transmit Error Counter"] pub struct TEC_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> TEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `EWRNLVL`"] -pub type EWRNLVL_R = crate::R; -#[doc = "Write proxy for field `EWRNLVL`"] +#[doc = "Field `EWRNLVL` reader - Error Warning Level"] +pub struct EWRNLVL_R(crate::FieldReader); +impl EWRNLVL_R { + pub(crate) fn new(bits: u8) -> Self { + EWRNLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EWRNLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EWRNLVL` writer - Error Warning Level"] pub struct EWRNLVL_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> EWRNLVL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } @@ -66,9 +126,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LETD`"] -pub type LETD_R = crate::R; +#[doc = "Field `LETD` reader - Last Error Transfer Direction"] +pub struct LETD_R(crate::FieldReader); impl LETD_R { + pub(crate) fn new(bits: bool) -> Self { + LETD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LETD_A { @@ -80,12 +143,19 @@ impl LETD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LETD_A::VALUE1 + **self == LETD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LETD_A::VALUE2 + **self == LETD_A::VALUE2 + } +} +impl core::ops::Deref for LETD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Last Error Increment\n\nValue on reset: 0"] @@ -102,9 +172,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LEINC`"] -pub type LEINC_R = crate::R; +#[doc = "Field `LEINC` reader - Last Error Increment"] +pub struct LEINC_R(crate::FieldReader); impl LEINC_R { + pub(crate) fn new(bits: bool) -> Self { + LEINC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LEINC_A { @@ -116,12 +189,19 @@ impl LEINC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LEINC_A::VALUE1 + **self == LEINC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LEINC_A::VALUE2 + **self == LEINC_A::VALUE2 + } +} +impl core::ops::Deref for LEINC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -167,4 +247,30 @@ impl W { pub fn ewrnlvl(&mut self) -> EWRNLVL_W { EWRNLVL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Error Counter Register\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 [necnt](index.html) module"] +pub struct NECNT_SPEC; +impl crate::RegisterSpec for NECNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [necnt::R](R) reader structure"] +impl crate::Readable for NECNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [necnt::W](W) writer structure"] +impl crate::Writable for NECNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NECNT to value 0x0060_0000"] +impl crate::Resettable for NECNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0060_0000 + } } diff --git a/src/can_node0/nfcr.rs b/src/can_node0/nfcr.rs index 16df8636..3ca95206 100644 --- a/src/can_node0/nfcr.rs +++ b/src/can_node0/nfcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NFCR"] -pub type R = crate::R; -#[doc = "Writer for register NFCR"] -pub type W = crate::W; -#[doc = "Register NFCR `reset()`'s with value 0"] -impl crate::ResetValue for super::NFCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NFCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NFCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CFC`"] -pub type CFC_R = crate::R; -#[doc = "Write proxy for field `CFC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CFC` reader - CAN Frame Counter"] +pub struct CFC_R(crate::FieldReader); +impl CFC_R { + pub(crate) fn new(bits: u16) -> Self { + CFC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CFC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CFC` writer - CAN Frame Counter"] pub struct CFC_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CFC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,25 +73,34 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CFSEL`"] -pub type CFSEL_R = crate::R; +#[doc = "Field `CFSEL` reader - CAN Frame Count Selection"] +pub struct CFSEL_R(crate::FieldReader); impl CFSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CFSEL_A::VALUE1), - i => Res(i), + 0 => Some(CFSEL_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFSEL_A::VALUE1 + **self == CFSEL_A::VALUE1 + } +} +impl core::ops::Deref for CFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CFSEL`"] +#[doc = "Field `CFSEL` writer - CAN Frame Count Selection"] pub struct CFSEL_W<'a> { w: &'a mut W, } @@ -73,7 +118,7 @@ impl<'a> CFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -94,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CFMOD`"] -pub type CFMOD_R = crate::R; +#[doc = "Field `CFMOD` reader - CAN Frame Counter Mode"] +pub struct CFMOD_R(crate::FieldReader); impl CFMOD_R { + pub(crate) fn new(bits: u8) -> Self { + CFMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CFMOD_A::VALUE1), - 1 => Val(CFMOD_A::VALUE2), - 2 => Val(CFMOD_A::VALUE3), - i => Res(i), + 0 => Some(CFMOD_A::VALUE1), + 1 => Some(CFMOD_A::VALUE2), + 2 => Some(CFMOD_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFMOD_A::VALUE1 + **self == CFMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CFMOD_A::VALUE2 + **self == CFMOD_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CFMOD_A::VALUE3 + **self == CFMOD_A::VALUE3 + } +} +impl core::ops::Deref for CFMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CFMOD`"] +#[doc = "Field `CFMOD` writer - CAN Frame Counter Mode"] pub struct CFMOD_W<'a> { w: &'a mut W, } @@ -152,7 +206,7 @@ impl<'a> CFMOD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 19)) | (((value as u32) & 0x03) << 19); + self.w.bits = (self.w.bits & !(0x03 << 19)) | ((value as u32 & 0x03) << 19); self.w } } @@ -170,9 +224,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CFCIE`"] -pub type CFCIE_R = crate::R; +#[doc = "Field `CFCIE` reader - CAN Frame Count Interrupt Enable"] +pub struct CFCIE_R(crate::FieldReader); impl CFCIE_R { + pub(crate) fn new(bits: bool) -> Self { + CFCIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CFCIE_A { @@ -184,15 +241,22 @@ impl CFCIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFCIE_A::VALUE1 + **self == CFCIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CFCIE_A::VALUE2 + **self == CFCIE_A::VALUE2 + } +} +impl core::ops::Deref for CFCIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CFCIE`"] +#[doc = "Field `CFCIE` writer - CAN Frame Count Interrupt Enable"] pub struct CFCIE_W<'a> { w: &'a mut W, } @@ -200,9 +264,7 @@ impl<'a> CFCIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CFCIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CAN frame counter overflow interrupt is disabled."] #[inline(always)] @@ -227,7 +289,7 @@ impl<'a> CFCIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -245,9 +307,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CFCOV`"] -pub type CFCOV_R = crate::R; +#[doc = "Field `CFCOV` reader - CAN Frame Counter Overflow Flag"] +pub struct CFCOV_R(crate::FieldReader); impl CFCOV_R { + pub(crate) fn new(bits: bool) -> Self { + CFCOV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CFCOV_A { @@ -259,15 +324,22 @@ impl CFCOV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFCOV_A::VALUE1 + **self == CFCOV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CFCOV_A::VALUE2 + **self == CFCOV_A::VALUE2 } } -#[doc = "Write proxy for field `CFCOV`"] +impl core::ops::Deref for CFCOV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CFCOV` writer - CAN Frame Counter Overflow Flag"] pub struct CFCOV_W<'a> { w: &'a mut W, } @@ -275,9 +347,7 @@ impl<'a> CFCOV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CFCOV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No overflow has occurred since last flag reset."] #[inline(always)] @@ -302,7 +372,7 @@ impl<'a> CFCOV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -359,4 +429,30 @@ impl W { pub fn cfcov(&mut self) -> CFCOV_W { CFCOV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Frame Counter Register\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 [nfcr](index.html) module"] +pub struct NFCR_SPEC; +impl crate::RegisterSpec for NFCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nfcr::R](R) reader structure"] +impl crate::Readable for NFCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nfcr::W](W) writer structure"] +impl crate::Writable for NFCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NFCR to value 0"] +impl crate::Resettable for NFCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_node0/nipr.rs b/src/can_node0/nipr.rs index 3f6a4128..7c673b69 100644 --- a/src/can_node0/nipr.rs +++ b/src/can_node0/nipr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NIPR"] -pub type R = crate::R; -#[doc = "Writer for register NIPR"] -pub type W = crate::W; -#[doc = "Register NIPR `reset()`'s with value 0"] -impl crate::ResetValue for super::NIPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NIPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NIPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Alert Interrupt Node Pointer\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ALINP`"] -pub type ALINP_R = crate::R; +#[doc = "Field `ALINP` reader - Alert Interrupt Node Pointer"] +pub struct ALINP_R(crate::FieldReader); impl ALINP_R { + pub(crate) fn new(bits: u8) -> Self { + ALINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ALINP_A::VALUE1), - 1 => Val(ALINP_A::VALUE2), - 7 => Val(ALINP_A::VALUE3), - i => Res(i), + 0 => Some(ALINP_A::VALUE1), + 1 => Some(ALINP_A::VALUE2), + 7 => Some(ALINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ALINP_A::VALUE1 + **self == ALINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ALINP_A::VALUE2 + **self == ALINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ALINP_A::VALUE3 + **self == ALINP_A::VALUE3 } } -#[doc = "Write proxy for field `ALINP`"] +impl core::ops::Deref for ALINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALINP` writer - Alert Interrupt Node Pointer"] pub struct ALINP_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> ALINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LECINP`"] -pub type LECINP_R = crate::R; +#[doc = "Field `LECINP` reader - Last Error Code Interrupt Node Pointer"] +pub struct LECINP_R(crate::FieldReader); impl LECINP_R { + pub(crate) fn new(bits: u8) -> Self { + LECINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(LECINP_A::VALUE1), - 1 => Val(LECINP_A::VALUE2), - 7 => Val(LECINP_A::VALUE3), - i => Res(i), + 0 => Some(LECINP_A::VALUE1), + 1 => Some(LECINP_A::VALUE2), + 7 => Some(LECINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LECINP_A::VALUE1 + **self == LECINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LECINP_A::VALUE2 + **self == LECINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LECINP_A::VALUE3 + **self == LECINP_A::VALUE3 } } -#[doc = "Write proxy for field `LECINP`"] +impl core::ops::Deref for LECINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LECINP` writer - Last Error Code Interrupt Node Pointer"] pub struct LECINP_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> LECINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRINP`"] -pub type TRINP_R = crate::R; +#[doc = "Field `TRINP` reader - Transfer OK Interrupt Node Pointer"] +pub struct TRINP_R(crate::FieldReader); impl TRINP_R { + pub(crate) fn new(bits: u8) -> Self { + TRINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TRINP_A::VALUE1), - 1 => Val(TRINP_A::VALUE2), - 7 => Val(TRINP_A::VALUE3), - i => Res(i), + 0 => Some(TRINP_A::VALUE1), + 1 => Some(TRINP_A::VALUE2), + 7 => Some(TRINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRINP_A::VALUE1 + **self == TRINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRINP_A::VALUE2 + **self == TRINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRINP_A::VALUE3 + **self == TRINP_A::VALUE3 + } +} +impl core::ops::Deref for TRINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRINP`"] +#[doc = "Field `TRINP` writer - Transfer OK Interrupt Node Pointer"] pub struct TRINP_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> TRINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CFCINP`"] -pub type CFCINP_R = crate::R; +#[doc = "Field `CFCINP` reader - Frame Counter Interrupt Node Pointer"] +pub struct CFCINP_R(crate::FieldReader); impl CFCINP_R { + pub(crate) fn new(bits: u8) -> Self { + CFCINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CFCINP_A::VALUE1), - 1 => Val(CFCINP_A::VALUE2), - 7 => Val(CFCINP_A::VALUE3), - i => Res(i), + 0 => Some(CFCINP_A::VALUE1), + 1 => Some(CFCINP_A::VALUE2), + 7 => Some(CFCINP_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFCINP_A::VALUE1 + **self == CFCINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CFCINP_A::VALUE2 + **self == CFCINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CFCINP_A::VALUE3 + **self == CFCINP_A::VALUE3 + } +} +impl core::ops::Deref for CFCINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CFCINP`"] +#[doc = "Field `CFCINP` writer - Frame Counter Interrupt Node Pointer"] pub struct CFCINP_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> CFCINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } @@ -369,4 +429,30 @@ impl W { pub fn cfcinp(&mut self) -> CFCINP_W { CFCINP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Interrupt Pointer Register\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 [nipr](index.html) module"] +pub struct NIPR_SPEC; +impl crate::RegisterSpec for NIPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nipr::R](R) reader structure"] +impl crate::Readable for NIPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nipr::W](W) writer structure"] +impl crate::Writable for NIPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NIPR to value 0"] +impl crate::Resettable for NIPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_node0/npcr.rs b/src/can_node0/npcr.rs index 766b7366..f5e5eaff 100644 --- a/src/can_node0/npcr.rs +++ b/src/can_node0/npcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NPCR"] -pub type R = crate::R; -#[doc = "Writer for register NPCR"] -pub type W = crate::W; -#[doc = "Register NPCR `reset()`'s with value 0"] -impl crate::ResetValue for super::NPCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NPCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `RXSEL`"] -pub type RXSEL_R = crate::R; -#[doc = "Write proxy for field `RXSEL`"] +#[doc = "Register `NPCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RXSEL` reader - Receive Select"] +pub struct RXSEL_R(crate::FieldReader); +impl RXSEL_R { + pub(crate) fn new(bits: u8) -> Self { + RXSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXSEL` writer - Receive Select"] pub struct RXSEL_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> RXSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LBM`"] -pub type LBM_R = crate::R; +#[doc = "Field `LBM` reader - Loop-Back Mode"] +pub struct LBM_R(crate::FieldReader); impl LBM_R { + pub(crate) fn new(bits: bool) -> Self { + LBM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LBM_A { @@ -52,15 +91,22 @@ impl LBM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LBM_A::VALUE1 + **self == LBM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LBM_A::VALUE2 + **self == LBM_A::VALUE2 + } +} +impl core::ops::Deref for LBM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LBM`"] +#[doc = "Field `LBM` writer - Loop-Back Mode"] pub struct LBM_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> LBM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LBM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Loop-Back Mode is disabled."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> LBM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -122,4 +166,30 @@ impl W { pub fn lbm(&mut self) -> LBM_W { LBM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Port Control Register\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 [npcr](index.html) module"] +pub struct NPCR_SPEC; +impl crate::RegisterSpec for NPCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [npcr::R](R) reader structure"] +impl crate::Readable for NPCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [npcr::W](W) writer structure"] +impl crate::Writable for NPCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NPCR to value 0"] +impl crate::Resettable for NPCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/can_node0/nsr.rs b/src/can_node0/nsr.rs index b2d9d8fd..189c64d2 100644 --- a/src/can_node0/nsr.rs +++ b/src/can_node0/nsr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NSR"] -pub type R = crate::R; -#[doc = "Writer for register NSR"] -pub type W = crate::W; -#[doc = "Register NSR `reset()`'s with value 0"] -impl crate::ResetValue for super::NSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `LEC`"] -pub type LEC_R = crate::R; -#[doc = "Write proxy for field `LEC`"] +#[doc = "Register `NSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LEC` reader - Last Error Code"] +pub struct LEC_R(crate::FieldReader); +impl LEC_R { + pub(crate) fn new(bits: u8) -> Self { + LEC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LEC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEC` writer - Last Error Code"] pub struct LEC_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> LEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXOK`"] -pub type TXOK_R = crate::R; +#[doc = "Field `TXOK` reader - Message Transmitted Successfully"] +pub struct TXOK_R(crate::FieldReader); impl TXOK_R { + pub(crate) fn new(bits: bool) -> Self { + TXOK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXOK_A { @@ -52,15 +91,22 @@ impl TXOK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXOK_A::VALUE1 + **self == TXOK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXOK_A::VALUE2 + **self == TXOK_A::VALUE2 + } +} +impl core::ops::Deref for TXOK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TXOK`"] +#[doc = "Field `TXOK` writer - Message Transmitted Successfully"] pub struct TXOK_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> TXOK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TXOK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No successful transmission since last (most recent) flag reset."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> TXOK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -113,9 +157,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXOK`"] -pub type RXOK_R = crate::R; +#[doc = "Field `RXOK` reader - Message Received Successfully"] +pub struct RXOK_R(crate::FieldReader); impl RXOK_R { + pub(crate) fn new(bits: bool) -> Self { + RXOK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXOK_A { @@ -127,15 +174,22 @@ impl RXOK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXOK_A::VALUE1 + **self == RXOK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXOK_A::VALUE2 + **self == RXOK_A::VALUE2 } } -#[doc = "Write proxy for field `RXOK`"] +impl core::ops::Deref for RXOK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXOK` writer - Message Received Successfully"] pub struct RXOK_W<'a> { w: &'a mut W, } @@ -143,9 +197,7 @@ impl<'a> RXOK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RXOK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No successful reception since last (most recent) flag reset."] #[inline(always)] @@ -170,13 +222,25 @@ impl<'a> RXOK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ALERT`"] -pub type ALERT_R = crate::R; -#[doc = "Write proxy for field `ALERT`"] +#[doc = "Field `ALERT` reader - Alert Warning"] +pub struct ALERT_R(crate::FieldReader); +impl ALERT_R { + pub(crate) fn new(bits: bool) -> Self { + ALERT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ALERT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALERT` writer - Alert Warning"] pub struct ALERT_W<'a> { w: &'a mut W, } @@ -194,7 +258,7 @@ impl<'a> ALERT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -212,9 +276,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EWRN`"] -pub type EWRN_R = crate::R; +#[doc = "Field `EWRN` reader - Error Warning Status"] +pub struct EWRN_R(crate::FieldReader); impl EWRN_R { + pub(crate) fn new(bits: bool) -> Self { + EWRN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EWRN_A { @@ -226,12 +293,19 @@ impl EWRN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EWRN_A::VALUE1 + **self == EWRN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EWRN_A::VALUE2 + **self == EWRN_A::VALUE2 + } +} +impl core::ops::Deref for EWRN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Bus-off Status\n\nValue on reset: 0"] @@ -248,9 +322,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BOFF`"] -pub type BOFF_R = crate::R; +#[doc = "Field `BOFF` reader - Bus-off Status"] +pub struct BOFF_R(crate::FieldReader); impl BOFF_R { + pub(crate) fn new(bits: bool) -> Self { + BOFF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BOFF_A { @@ -262,12 +339,19 @@ impl BOFF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BOFF_A::VALUE1 + **self == BOFF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BOFF_A::VALUE2 + **self == BOFF_A::VALUE2 + } +} +impl core::ops::Deref for BOFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "List Length Error\n\nValue on reset: 0"] @@ -284,9 +368,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LLE`"] -pub type LLE_R = crate::R; +#[doc = "Field `LLE` reader - List Length Error"] +pub struct LLE_R(crate::FieldReader); impl LLE_R { + pub(crate) fn new(bits: bool) -> Self { + LLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LLE_A { @@ -298,15 +385,22 @@ impl LLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LLE_A::VALUE1 + **self == LLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LLE_A::VALUE2 + **self == LLE_A::VALUE2 + } +} +impl core::ops::Deref for LLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LLE`"] +#[doc = "Field `LLE` writer - List Length Error"] pub struct LLE_W<'a> { w: &'a mut W, } @@ -314,9 +408,7 @@ impl<'a> LLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No List Length Error since last (most recent) flag reset."] #[inline(always)] @@ -341,7 +433,7 @@ impl<'a> LLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -359,9 +451,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LOE`"] -pub type LOE_R = crate::R; +#[doc = "Field `LOE` reader - List Object Error"] +pub struct LOE_R(crate::FieldReader); impl LOE_R { + pub(crate) fn new(bits: bool) -> Self { + LOE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOE_A { @@ -373,15 +468,22 @@ impl LOE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOE_A::VALUE1 + **self == LOE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOE_A::VALUE2 + **self == LOE_A::VALUE2 + } +} +impl core::ops::Deref for LOE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOE`"] +#[doc = "Field `LOE` writer - List Object Error"] pub struct LOE_W<'a> { w: &'a mut W, } @@ -389,9 +491,7 @@ impl<'a> LOE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LOE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No List Object Error since last (most recent) flag reset."] #[inline(always)] @@ -416,7 +516,7 @@ impl<'a> LOE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -434,9 +534,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SUSACK`"] -pub type SUSACK_R = crate::R; +#[doc = "Field `SUSACK` reader - Suspend Acknowledge"] +pub struct SUSACK_R(crate::FieldReader); impl SUSACK_R { + pub(crate) fn new(bits: bool) -> Self { + SUSACK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSACK_A { @@ -448,12 +551,19 @@ impl SUSACK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSACK_A::VALUE1 + **self == SUSACK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSACK_A::VALUE2 + **self == SUSACK_A::VALUE2 + } +} +impl core::ops::Deref for SUSACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -534,4 +644,30 @@ impl W { pub fn loe(&mut self) -> LOE_W { LOE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Node Status Register\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 [nsr](index.html) module"] +pub struct NSR_SPEC; +impl crate::RegisterSpec for NSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nsr::R](R) reader structure"] +impl crate::Readable for NSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nsr::W](W) writer structure"] +impl crate::Writable for NSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NSR to value 0"] +impl crate::Resettable for NSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40.rs b/src/ccu40.rs index 8b9db959..527a2267 100644 --- a/src/ccu40.rs +++ b/src/ccu40.rs @@ -2,106 +2,59 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Global Control Register"] - pub gctrl: GCTRL, + pub gctrl: crate::Reg, #[doc = "0x04 - Global Status Register"] - pub gstat: GSTAT, + pub gstat: crate::Reg, #[doc = "0x08 - Global Idle Set"] - pub gidls: GIDLS, + pub gidls: crate::Reg, #[doc = "0x0c - Global Idle Clear"] - pub gidlc: GIDLC, + pub gidlc: crate::Reg, #[doc = "0x10 - Global Channel Set"] - pub gcss: GCSS, + pub gcss: crate::Reg, #[doc = "0x14 - Global Channel Clear"] - pub gcsc: GCSC, + pub gcsc: crate::Reg, #[doc = "0x18 - Global Channel Status"] - pub gcst: GCST, - _reserved7: [u8; 52usize], + pub gcst: crate::Reg, + _reserved7: [u8; 0x34], #[doc = "0x50 - Extended Capture Mode Read"] - pub ecrd: ECRD, - _reserved8: [u8; 44usize], + pub ecrd: crate::Reg, + _reserved8: [u8; 0x2c], #[doc = "0x80 - Module Identification"] - pub midr: MIDR, + pub midr: crate::Reg, } -#[doc = "Global Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gctrl](gctrl) module"] -pub type GCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCTRL; -#[doc = "`read()` method returns [gctrl::R](gctrl::R) reader structure"] -impl crate::Readable for GCTRL {} -#[doc = "`write(|w| ..)` method takes [gctrl::W](gctrl::W) writer structure"] -impl crate::Writable for GCTRL {} +#[doc = "GCTRL register accessor: an alias for `Reg`"] +pub type GCTRL = crate::Reg; #[doc = "Global Control Register"] pub mod gctrl; -#[doc = "Global Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gstat](gstat) module"] -pub type GSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GSTAT; -#[doc = "`read()` method returns [gstat::R](gstat::R) reader structure"] -impl crate::Readable for GSTAT {} +#[doc = "GSTAT register accessor: an alias for `Reg`"] +pub type GSTAT = crate::Reg; #[doc = "Global Status Register"] pub mod gstat; -#[doc = "Global Idle Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidls](gidls) module"] -pub type GIDLS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GIDLS; -#[doc = "`write(|w| ..)` method takes [gidls::W](gidls::W) writer structure"] -impl crate::Writable for GIDLS {} +#[doc = "GIDLS register accessor: an alias for `Reg`"] +pub type GIDLS = crate::Reg; #[doc = "Global Idle Set"] pub mod gidls; -#[doc = "Global Idle Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidlc](gidlc) module"] -pub type GIDLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GIDLC; -#[doc = "`write(|w| ..)` method takes [gidlc::W](gidlc::W) writer structure"] -impl crate::Writable for GIDLC {} +#[doc = "GIDLC register accessor: an alias for `Reg`"] +pub type GIDLC = crate::Reg; #[doc = "Global Idle Clear"] pub mod gidlc; -#[doc = "Global Channel Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcss](gcss) module"] -pub type GCSS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCSS; -#[doc = "`write(|w| ..)` method takes [gcss::W](gcss::W) writer structure"] -impl crate::Writable for GCSS {} +#[doc = "GCSS register accessor: an alias for `Reg`"] +pub type GCSS = crate::Reg; #[doc = "Global Channel Set"] pub mod gcss; -#[doc = "Global Channel Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcsc](gcsc) module"] -pub type GCSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCSC; -#[doc = "`write(|w| ..)` method takes [gcsc::W](gcsc::W) writer structure"] -impl crate::Writable for GCSC {} +#[doc = "GCSC register accessor: an alias for `Reg`"] +pub type GCSC = crate::Reg; #[doc = "Global Channel Clear"] pub mod gcsc; -#[doc = "Global Channel Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcst](gcst) module"] -pub type GCST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCST; -#[doc = "`read()` method returns [gcst::R](gcst::R) reader structure"] -impl crate::Readable for GCST {} +#[doc = "GCST register accessor: an alias for `Reg`"] +pub type GCST = crate::Reg; #[doc = "Global Channel Status"] pub mod gcst; -#[doc = "Extended Capture Mode Read\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ecrd](ecrd) module"] -pub type ECRD = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ECRD; -#[doc = "`read()` method returns [ecrd::R](ecrd::R) reader structure"] -impl crate::Readable for ECRD {} +#[doc = "ECRD register accessor: an alias for `Reg`"] +pub type ECRD = crate::Reg; #[doc = "Extended Capture Mode Read"] pub mod ecrd; -#[doc = "Module Identification\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](midr) module"] -pub type MIDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIDR; -#[doc = "`read()` method returns [midr::R](midr::R) reader structure"] -impl crate::Readable for MIDR {} +#[doc = "MIDR register accessor: an alias for `Reg`"] +pub type MIDR = crate::Reg; #[doc = "Module Identification"] pub mod midr; diff --git a/src/ccu40/ecrd.rs b/src/ccu40/ecrd.rs index 45a43c8e..223fadd1 100644 --- a/src/ccu40/ecrd.rs +++ b/src/ccu40/ecrd.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register ECRD"] -pub type R = crate::R; -#[doc = "Reader of field `CAPV`"] -pub type CAPV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `ECRD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPV` reader - Timer Capture Value"] +pub struct CAPV_R(crate::FieldReader); +impl CAPV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Capture value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Slice pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -23,9 +60,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SPTR`"] -pub type SPTR_R = crate::R; +#[doc = "Field `SPTR` reader - Slice pointer"] +pub struct SPTR_R(crate::FieldReader); impl SPTR_R { + pub(crate) fn new(bits: u8) -> Self { + SPTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SPTR_A { @@ -40,22 +80,29 @@ impl SPTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SPTR_A::VALUE1 + **self == SPTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SPTR_A::VALUE2 + **self == SPTR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SPTR_A::VALUE3 + **self == SPTR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SPTR_A::VALUE4 + **self == SPTR_A::VALUE4 + } +} +impl core::ops::Deref for SPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Capture register pointer\n\nValue on reset: 0"] @@ -77,9 +124,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `VPTR`"] -pub type VPTR_R = crate::R; +#[doc = "Field `VPTR` reader - Capture register pointer"] +pub struct VPTR_R(crate::FieldReader); impl VPTR_R { + pub(crate) fn new(bits: u8) -> Self { + VPTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VPTR_A { @@ -94,22 +144,29 @@ impl VPTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VPTR_A::VALUE1 + **self == VPTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VPTR_A::VALUE2 + **self == VPTR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == VPTR_A::VALUE3 + **self == VPTR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == VPTR_A::VALUE4 + **self == VPTR_A::VALUE4 + } +} +impl core::ops::Deref for VPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Full Flag\n\nValue on reset: 0"] @@ -126,9 +183,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -140,12 +200,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -175,3 +242,19 @@ impl R { FFL_R::new(((self.bits >> 24) & 0x01) != 0) } } +#[doc = "Extended Capture Mode Read\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ecrd](index.html) module"] +pub struct ECRD_SPEC; +impl crate::RegisterSpec for ECRD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ecrd::R](R) reader structure"] +impl crate::Readable for ECRD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ECRD to value 0"] +impl crate::Resettable for ECRD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40/gcsc.rs b/src/ccu40/gcsc.rs index c5c2b266..7a142224 100644 --- a/src/ccu40/gcsc.rs +++ b/src/ccu40/gcsc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GCSC"] -pub type W = crate::W; -#[doc = "Register GCSC `reset()`'s with value 0"] -impl crate::ResetValue for super::GCSC { - type Type = u32; +#[doc = "Register `GCSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `S0SC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `S0SC` writer - Slice 0 shadow transfer clear"] pub struct S0SC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> S0SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `S0DSC`"] +#[doc = "Field `S0DSC` writer - Slice 0 Dither shadow transfer clear"] pub struct S0DSC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> S0DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `S0PSC`"] +#[doc = "Field `S0PSC` writer - Slice 0 Prescaler shadow transfer clear"] pub struct S0PSC_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> S0PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `S1SC`"] +#[doc = "Field `S1SC` writer - Slice 1 shadow transfer clear"] pub struct S1SC_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> S1SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `S1DSC`"] +#[doc = "Field `S1DSC` writer - Slice 1 Dither shadow transfer clear"] pub struct S1DSC_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> S1DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `S1PSC`"] +#[doc = "Field `S1PSC` writer - Slice 1 Prescaler shadow transfer clear"] pub struct S1PSC_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> S1PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `S2SC`"] +#[doc = "Field `S2SC` writer - Slice 2 shadow transfer clear"] pub struct S2SC_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> S2SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `S2DSC`"] +#[doc = "Field `S2DSC` writer - Slice 2 Dither shadow transfer clear"] pub struct S2DSC_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> S2DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `S2PSC`"] +#[doc = "Field `S2PSC` writer - Slice 2 Prescaler shadow transfer clear"] pub struct S2PSC_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> S2PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `S3SC`"] +#[doc = "Field `S3SC` writer - Slice 3 shadow transfer clear"] pub struct S3SC_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> S3SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `S3DSC`"] +#[doc = "Field `S3DSC` writer - Slice 3 Dither shadow transfer clear"] pub struct S3DSC_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> S3DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `S3PSC`"] +#[doc = "Field `S3PSC` writer - Slice 3 Prescaler shadow transfer clear"] pub struct S3PSC_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> S3PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `S0STC`"] +#[doc = "Field `S0STC` writer - Slice 0 status bit clear"] pub struct S0STC_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> S0STC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `S1STC`"] +#[doc = "Field `S1STC` writer - Slice 1 status bit clear"] pub struct S1STC_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> S1STC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `S2STC`"] +#[doc = "Field `S2STC` writer - Slice 2 status bit clear"] pub struct S2STC_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> S2STC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `S3STC`"] +#[doc = "Field `S3STC` writer - Slice 3 status bit clear"] pub struct S3STC_W<'a> { w: &'a mut W, } @@ -356,7 +367,7 @@ impl<'a> S3STC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -441,4 +452,26 @@ impl W { pub fn s3stc(&mut self) -> S3STC_W { S3STC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Channel Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcsc](index.html) module"] +pub struct GCSC_SPEC; +impl crate::RegisterSpec for GCSC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gcsc::W](W) writer structure"] +impl crate::Writable for GCSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCSC to value 0"] +impl crate::Resettable for GCSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40/gcss.rs b/src/ccu40/gcss.rs index f8300978..1db4da31 100644 --- a/src/ccu40/gcss.rs +++ b/src/ccu40/gcss.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GCSS"] -pub type W = crate::W; -#[doc = "Register GCSS `reset()`'s with value 0"] -impl crate::ResetValue for super::GCSS { - type Type = u32; +#[doc = "Register `GCSS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `S0SE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `S0SE` writer - Slice 0 shadow transfer set enable"] pub struct S0SE_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> S0SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `S0DSE`"] +#[doc = "Field `S0DSE` writer - Slice 0 Dither shadow transfer set enable"] pub struct S0DSE_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> S0DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `S0PSE`"] +#[doc = "Field `S0PSE` writer - Slice 0 Prescaler shadow transfer set enable"] pub struct S0PSE_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> S0PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `S1SE`"] +#[doc = "Field `S1SE` writer - Slice 1 shadow transfer set enable"] pub struct S1SE_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> S1SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `S1DSE`"] +#[doc = "Field `S1DSE` writer - Slice 1 Dither shadow transfer set enable"] pub struct S1DSE_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> S1DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `S1PSE`"] +#[doc = "Field `S1PSE` writer - Slice 1 Prescaler shadow transfer set enable"] pub struct S1PSE_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> S1PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `S2SE`"] +#[doc = "Field `S2SE` writer - Slice 2 shadow transfer set enable"] pub struct S2SE_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> S2SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `S2DSE`"] +#[doc = "Field `S2DSE` writer - Slice 2 Dither shadow transfer set enable"] pub struct S2DSE_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> S2DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `S2PSE`"] +#[doc = "Field `S2PSE` writer - Slice 2 Prescaler shadow transfer set enable"] pub struct S2PSE_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> S2PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `S3SE`"] +#[doc = "Field `S3SE` writer - Slice 3 shadow transfer set enable"] pub struct S3SE_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> S3SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `S3DSE`"] +#[doc = "Field `S3DSE` writer - Slice 3 Dither shadow transfer set enable"] pub struct S3DSE_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> S3DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `S3PSE`"] +#[doc = "Field `S3PSE` writer - Slice 3 Prescaler shadow transfer set enable"] pub struct S3PSE_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> S3PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `S0STS`"] +#[doc = "Field `S0STS` writer - Slice 0 status bit set"] pub struct S0STS_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> S0STS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `S1STS`"] +#[doc = "Field `S1STS` writer - Slice 1 status bit set"] pub struct S1STS_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> S1STS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `S2STS`"] +#[doc = "Field `S2STS` writer - Slice 2 status bit set"] pub struct S2STS_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> S2STS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `S3STS`"] +#[doc = "Field `S3STS` writer - Slice 3 status bit set"] pub struct S3STS_W<'a> { w: &'a mut W, } @@ -356,7 +367,7 @@ impl<'a> S3STS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -441,4 +452,26 @@ impl W { pub fn s3sts(&mut self) -> S3STS_W { S3STS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Channel Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcss](index.html) module"] +pub struct GCSS_SPEC; +impl crate::RegisterSpec for GCSS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gcss::W](W) writer structure"] +impl crate::Writable for GCSS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCSS to value 0"] +impl crate::Resettable for GCSS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40/gcst.rs b/src/ccu40/gcst.rs index 6bb9d670..577fe4e1 100644 --- a/src/ccu40/gcst.rs +++ b/src/ccu40/gcst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register GCST"] -pub type R = crate::R; +#[doc = "Register `GCST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Slice 0 shadow transfer status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0SS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0SS`"] -pub type S0SS_R = crate::R; +#[doc = "Field `S0SS` reader - Slice 0 shadow transfer status"] +pub struct S0SS_R(crate::FieldReader); impl S0SS_R { + pub(crate) fn new(bits: bool) -> Self { + S0SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0SS_A { @@ -28,12 +44,19 @@ impl S0SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0SS_A::VALUE1 + **self == S0SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0SS_A::VALUE2 + **self == S0SS_A::VALUE2 + } +} +impl core::ops::Deref for S0SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 0 Dither shadow transfer status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0DSS`"] -pub type S0DSS_R = crate::R; +#[doc = "Field `S0DSS` reader - Slice 0 Dither shadow transfer status"] +pub struct S0DSS_R(crate::FieldReader); impl S0DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S0DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0DSS_A { @@ -64,12 +90,19 @@ impl S0DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0DSS_A::VALUE1 + **self == S0DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0DSS_A::VALUE2 + **self == S0DSS_A::VALUE2 + } +} +impl core::ops::Deref for S0DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 0 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0PSS`"] -pub type S0PSS_R = crate::R; +#[doc = "Field `S0PSS` reader - Slice 0 Prescaler shadow transfer status"] +pub struct S0PSS_R(crate::FieldReader); impl S0PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S0PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0PSS_A { @@ -100,12 +136,19 @@ impl S0PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0PSS_A::VALUE1 + **self == S0PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0PSS_A::VALUE2 + **self == S0PSS_A::VALUE2 + } +} +impl core::ops::Deref for S0PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 shadow transfer status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1SS`"] -pub type S1SS_R = crate::R; +#[doc = "Field `S1SS` reader - Slice 1 shadow transfer status"] +pub struct S1SS_R(crate::FieldReader); impl S1SS_R { + pub(crate) fn new(bits: bool) -> Self { + S1SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1SS_A { @@ -136,12 +182,19 @@ impl S1SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1SS_A::VALUE1 + **self == S1SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1SS_A::VALUE2 + **self == S1SS_A::VALUE2 + } +} +impl core::ops::Deref for S1SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 Dither shadow transfer status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1DSS`"] -pub type S1DSS_R = crate::R; +#[doc = "Field `S1DSS` reader - Slice 1 Dither shadow transfer status"] +pub struct S1DSS_R(crate::FieldReader); impl S1DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S1DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1DSS_A { @@ -172,12 +228,19 @@ impl S1DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1DSS_A::VALUE1 + **self == S1DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1DSS_A::VALUE2 + **self == S1DSS_A::VALUE2 + } +} +impl core::ops::Deref for S1DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1PSS`"] -pub type S1PSS_R = crate::R; +#[doc = "Field `S1PSS` reader - Slice 1 Prescaler shadow transfer status"] +pub struct S1PSS_R(crate::FieldReader); impl S1PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S1PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1PSS_A { @@ -208,12 +274,19 @@ impl S1PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1PSS_A::VALUE1 + **self == S1PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1PSS_A::VALUE2 + **self == S1PSS_A::VALUE2 + } +} +impl core::ops::Deref for S1PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 shadow transfer status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2SS`"] -pub type S2SS_R = crate::R; +#[doc = "Field `S2SS` reader - Slice 2 shadow transfer status"] +pub struct S2SS_R(crate::FieldReader); impl S2SS_R { + pub(crate) fn new(bits: bool) -> Self { + S2SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2SS_A { @@ -244,12 +320,19 @@ impl S2SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2SS_A::VALUE1 + **self == S2SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2SS_A::VALUE2 + **self == S2SS_A::VALUE2 + } +} +impl core::ops::Deref for S2SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 Dither shadow transfer status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2DSS`"] -pub type S2DSS_R = crate::R; +#[doc = "Field `S2DSS` reader - Slice 2 Dither shadow transfer status"] +pub struct S2DSS_R(crate::FieldReader); impl S2DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S2DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2DSS_A { @@ -280,12 +366,19 @@ impl S2DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2DSS_A::VALUE1 + **self == S2DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2DSS_A::VALUE2 + **self == S2DSS_A::VALUE2 + } +} +impl core::ops::Deref for S2DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2PSS`"] -pub type S2PSS_R = crate::R; +#[doc = "Field `S2PSS` reader - Slice 2 Prescaler shadow transfer status"] +pub struct S2PSS_R(crate::FieldReader); impl S2PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S2PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2PSS_A { @@ -316,12 +412,19 @@ impl S2PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2PSS_A::VALUE1 + **self == S2PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2PSS_A::VALUE2 + **self == S2PSS_A::VALUE2 + } +} +impl core::ops::Deref for S2PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 shadow transfer status\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3SS`"] -pub type S3SS_R = crate::R; +#[doc = "Field `S3SS` reader - Slice 3 shadow transfer status"] +pub struct S3SS_R(crate::FieldReader); impl S3SS_R { + pub(crate) fn new(bits: bool) -> Self { + S3SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3SS_A { @@ -352,12 +458,19 @@ impl S3SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3SS_A::VALUE1 + **self == S3SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3SS_A::VALUE2 + **self == S3SS_A::VALUE2 + } +} +impl core::ops::Deref for S3SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 Dither shadow transfer status\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3DSS`"] -pub type S3DSS_R = crate::R; +#[doc = "Field `S3DSS` reader - Slice 3 Dither shadow transfer status"] +pub struct S3DSS_R(crate::FieldReader); impl S3DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S3DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3DSS_A { @@ -388,12 +504,19 @@ impl S3DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3DSS_A::VALUE1 + **self == S3DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3DSS_A::VALUE2 + **self == S3DSS_A::VALUE2 + } +} +impl core::ops::Deref for S3DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3PSS`"] -pub type S3PSS_R = crate::R; +#[doc = "Field `S3PSS` reader - Slice 3 Prescaler shadow transfer status"] +pub struct S3PSS_R(crate::FieldReader); impl S3PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S3PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3PSS_A { @@ -424,22 +550,77 @@ impl S3PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3PSS_A::VALUE1 + **self == S3PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3PSS_A::VALUE2 + **self == S3PSS_A::VALUE2 + } +} +impl core::ops::Deref for S3PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC40ST` reader - Slice 0 status bit"] +pub struct CC40ST_R(crate::FieldReader); +impl CC40ST_R { + pub(crate) fn new(bits: bool) -> Self { + CC40ST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC40ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC41ST` reader - Slice 1 status bit"] +pub struct CC41ST_R(crate::FieldReader); +impl CC41ST_R { + pub(crate) fn new(bits: bool) -> Self { + CC41ST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC41ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC42ST` reader - Slice 2 status bit"] +pub struct CC42ST_R(crate::FieldReader); +impl CC42ST_R { + pub(crate) fn new(bits: bool) -> Self { + CC42ST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC42ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC43ST` reader - Slice 3 status bit"] +pub struct CC43ST_R(crate::FieldReader); +impl CC43ST_R { + pub(crate) fn new(bits: bool) -> Self { + CC43ST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC43ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `CC40ST`"] -pub type CC40ST_R = crate::R; -#[doc = "Reader of field `CC41ST`"] -pub type CC41ST_R = crate::R; -#[doc = "Reader of field `CC42ST`"] -pub type CC42ST_R = crate::R; -#[doc = "Reader of field `CC43ST`"] -pub type CC43ST_R = crate::R; impl R { #[doc = "Bit 0 - Slice 0 shadow transfer status"] #[inline(always)] @@ -522,3 +703,19 @@ impl R { CC43ST_R::new(((self.bits >> 19) & 0x01) != 0) } } +#[doc = "Global Channel Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcst](index.html) module"] +pub struct GCST_SPEC; +impl crate::RegisterSpec for GCST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gcst::R](R) reader structure"] +impl crate::Readable for GCST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GCST to value 0"] +impl crate::Resettable for GCST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40/gctrl.rs b/src/ccu40/gctrl.rs index 4c71c7d2..80871a17 100644 --- a/src/ccu40/gctrl.rs +++ b/src/ccu40/gctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GCTRL"] -pub type R = crate::R; -#[doc = "Writer for register GCTRL"] -pub type W = crate::W; -#[doc = "Register GCTRL `reset()`'s with value 0"] -impl crate::ResetValue for super::GCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Prescaler Clear Configuration\n\nValue on reset: 0"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRBC`"] -pub type PRBC_R = crate::R; +#[doc = "Field `PRBC` reader - Prescaler Clear Configuration"] +pub struct PRBC_R(crate::FieldReader); impl PRBC_R { + pub(crate) fn new(bits: u8) -> Self { + PRBC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PRBC_A::VALUE1), - 1 => Val(PRBC_A::VALUE2), - 2 => Val(PRBC_A::VALUE3), - 3 => Val(PRBC_A::VALUE4), - 4 => Val(PRBC_A::VALUE5), - i => Res(i), + 0 => Some(PRBC_A::VALUE1), + 1 => Some(PRBC_A::VALUE2), + 2 => Some(PRBC_A::VALUE3), + 3 => Some(PRBC_A::VALUE4), + 4 => Some(PRBC_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRBC_A::VALUE1 + **self == PRBC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRBC_A::VALUE2 + **self == PRBC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PRBC_A::VALUE3 + **self == PRBC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PRBC_A::VALUE4 + **self == PRBC_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PRBC_A::VALUE5 + **self == PRBC_A::VALUE5 } } -#[doc = "Write proxy for field `PRBC`"] +impl core::ops::Deref for PRBC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRBC` writer - Prescaler Clear Configuration"] pub struct PRBC_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> PRBC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -134,9 +167,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PCIS`"] -pub type PCIS_R = crate::R; +#[doc = "Field `PCIS` reader - Prescaler Input Clock Selection"] +pub struct PCIS_R(crate::FieldReader); impl PCIS_R { + pub(crate) fn new(bits: u8) -> Self { + PCIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCIS_A { @@ -151,25 +187,32 @@ impl PCIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCIS_A::VALUE1 + **self == PCIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCIS_A::VALUE2 + **self == PCIS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PCIS_A::VALUE3 + **self == PCIS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PCIS_A::VALUE4 + **self == PCIS_A::VALUE4 + } +} +impl core::ops::Deref for PCIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PCIS`"] +#[doc = "Field `PCIS` writer - Prescaler Input Clock Selection"] pub struct PCIS_W<'a> { w: &'a mut W, } @@ -177,9 +220,7 @@ impl<'a> PCIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCIS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Module clock"] #[inline(always)] @@ -204,7 +245,7 @@ impl<'a> PCIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -227,9 +268,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUSCFG`"] -pub type SUSCFG_R = crate::R; +#[doc = "Field `SUSCFG` reader - Suspend Mode Configuration"] +pub struct SUSCFG_R(crate::FieldReader); impl SUSCFG_R { + pub(crate) fn new(bits: u8) -> Self { + SUSCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSCFG_A { @@ -244,25 +288,32 @@ impl SUSCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSCFG_A::VALUE1 + **self == SUSCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSCFG_A::VALUE2 + **self == SUSCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUSCFG_A::VALUE3 + **self == SUSCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SUSCFG_A::VALUE4 + **self == SUSCFG_A::VALUE4 } } -#[doc = "Write proxy for field `SUSCFG`"] +impl core::ops::Deref for SUSCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSCFG` writer - Suspend Mode Configuration"] pub struct SUSCFG_W<'a> { w: &'a mut W, } @@ -270,9 +321,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SUSCFG_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] @@ -297,7 +346,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -315,9 +364,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE0`"] -pub type MSE0_R = crate::R; +#[doc = "Field `MSE0` reader - Slice 0 Multi Channel shadow transfer enable"] +pub struct MSE0_R(crate::FieldReader); impl MSE0_R { + pub(crate) fn new(bits: bool) -> Self { + MSE0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE0_A { @@ -329,15 +381,22 @@ impl MSE0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE0_A::VALUE1 + **self == MSE0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE0_A::VALUE2 + **self == MSE0_A::VALUE2 } } -#[doc = "Write proxy for field `MSE0`"] +impl core::ops::Deref for MSE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSE0` writer - Slice 0 Multi Channel shadow transfer enable"] pub struct MSE0_W<'a> { w: &'a mut W, } @@ -345,9 +404,7 @@ impl<'a> MSE0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -372,7 +429,7 @@ impl<'a> MSE0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -390,9 +447,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE1`"] -pub type MSE1_R = crate::R; +#[doc = "Field `MSE1` reader - Slice 1 Multi Channel shadow transfer enable"] +pub struct MSE1_R(crate::FieldReader); impl MSE1_R { + pub(crate) fn new(bits: bool) -> Self { + MSE1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE1_A { @@ -404,15 +464,22 @@ impl MSE1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE1_A::VALUE1 + **self == MSE1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE1_A::VALUE2 + **self == MSE1_A::VALUE2 + } +} +impl core::ops::Deref for MSE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSE1`"] +#[doc = "Field `MSE1` writer - Slice 1 Multi Channel shadow transfer enable"] pub struct MSE1_W<'a> { w: &'a mut W, } @@ -420,9 +487,7 @@ impl<'a> MSE1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -447,7 +512,7 @@ impl<'a> MSE1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -465,9 +530,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE2`"] -pub type MSE2_R = crate::R; +#[doc = "Field `MSE2` reader - Slice 2 Multi Channel shadow transfer enable"] +pub struct MSE2_R(crate::FieldReader); impl MSE2_R { + pub(crate) fn new(bits: bool) -> Self { + MSE2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE2_A { @@ -479,15 +547,22 @@ impl MSE2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE2_A::VALUE1 + **self == MSE2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE2_A::VALUE2 + **self == MSE2_A::VALUE2 } } -#[doc = "Write proxy for field `MSE2`"] +impl core::ops::Deref for MSE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSE2` writer - Slice 2 Multi Channel shadow transfer enable"] pub struct MSE2_W<'a> { w: &'a mut W, } @@ -495,9 +570,7 @@ impl<'a> MSE2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -522,7 +595,7 @@ impl<'a> MSE2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -540,9 +613,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE3`"] -pub type MSE3_R = crate::R; +#[doc = "Field `MSE3` reader - Slice 3 Multi Channel shadow transfer enable"] +pub struct MSE3_R(crate::FieldReader); impl MSE3_R { + pub(crate) fn new(bits: bool) -> Self { + MSE3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE3_A { @@ -554,15 +630,22 @@ impl MSE3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE3_A::VALUE1 + **self == MSE3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE3_A::VALUE2 + **self == MSE3_A::VALUE2 + } +} +impl core::ops::Deref for MSE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSE3`"] +#[doc = "Field `MSE3` writer - Slice 3 Multi Channel shadow transfer enable"] pub struct MSE3_W<'a> { w: &'a mut W, } @@ -570,9 +653,7 @@ impl<'a> MSE3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -597,7 +678,7 @@ impl<'a> MSE3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -618,37 +699,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MSDE`"] -pub type MSDE_R = crate::R; +#[doc = "Field `MSDE` reader - Multi Channel shadow transfer request configuration"] +pub struct MSDE_R(crate::FieldReader); impl MSDE_R { + pub(crate) fn new(bits: u8) -> Self { + MSDE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MSDE_A::VALUE1), - 1 => Val(MSDE_A::VALUE2), - 3 => Val(MSDE_A::VALUE4), - i => Res(i), + 0 => Some(MSDE_A::VALUE1), + 1 => Some(MSDE_A::VALUE2), + 3 => Some(MSDE_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSDE_A::VALUE1 + **self == MSDE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSDE_A::VALUE2 + **self == MSDE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MSDE_A::VALUE4 + **self == MSDE_A::VALUE4 + } +} +impl core::ops::Deref for MSDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSDE`"] +#[doc = "Field `MSDE` writer - Multi Channel shadow transfer request configuration"] pub struct MSDE_W<'a> { w: &'a mut W, } @@ -676,7 +766,7 @@ impl<'a> MSDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -763,4 +853,30 @@ impl W { pub fn msde(&mut self) -> MSDE_W { MSDE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Control Register\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 [gctrl](index.html) module"] +pub struct GCTRL_SPEC; +impl crate::RegisterSpec for GCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gctrl::R](R) reader structure"] +impl crate::Readable for GCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gctrl::W](W) writer structure"] +impl crate::Writable for GCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCTRL to value 0"] +impl crate::Resettable for GCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40/gidlc.rs b/src/ccu40/gidlc.rs index febff2d4..2193aa3f 100644 --- a/src/ccu40/gidlc.rs +++ b/src/ccu40/gidlc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GIDLC"] -pub type W = crate::W; -#[doc = "Register GIDLC `reset()`'s with value 0"] -impl crate::ResetValue for super::GIDLC { - type Type = u32; +#[doc = "Register `GIDLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `CS0I`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CS0I` writer - CC40 IDLE mode clear"] pub struct CS0I_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> CS0I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `CS1I`"] +#[doc = "Field `CS1I` writer - CC41 IDLE mode clear"] pub struct CS1I_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> CS1I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `CS2I`"] +#[doc = "Field `CS2I` writer - CC42 IDLE mode clear"] pub struct CS2I_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> CS2I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `CS3I`"] +#[doc = "Field `CS3I` writer - CC43 IDLE mode clear"] pub struct CS3I_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> CS3I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SPRB`"] +#[doc = "Field `SPRB` writer - Prescaler Run Bit Set"] pub struct SPRB_W<'a> { w: &'a mut W, } @@ -114,7 +125,7 @@ impl<'a> SPRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -144,4 +155,26 @@ impl W { pub fn sprb(&mut self) -> SPRB_W { SPRB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Idle Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidlc](index.html) module"] +pub struct GIDLC_SPEC; +impl crate::RegisterSpec for GIDLC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gidlc::W](W) writer structure"] +impl crate::Writable for GIDLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GIDLC to value 0"] +impl crate::Resettable for GIDLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40/gidls.rs b/src/ccu40/gidls.rs index 0ec7de5e..81fa1f42 100644 --- a/src/ccu40/gidls.rs +++ b/src/ccu40/gidls.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GIDLS"] -pub type W = crate::W; -#[doc = "Register GIDLS `reset()`'s with value 0"] -impl crate::ResetValue for super::GIDLS { - type Type = u32; +#[doc = "Register `GIDLS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SS0I`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SS0I` writer - CC40 IDLE mode set"] pub struct SS0I_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SS0I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SS1I`"] +#[doc = "Field `SS1I` writer - CC41 IDLE mode set"] pub struct SS1I_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SS1I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SS2I`"] +#[doc = "Field `SS2I` writer - CC42 IDLE mode set"] pub struct SS2I_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SS2I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SS3I`"] +#[doc = "Field `SS3I` writer - CC43 IDLE mode set"] pub struct SS3I_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SS3I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `CPRB`"] +#[doc = "Field `CPRB` writer - Prescaler Run Bit Clear"] pub struct CPRB_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> CPRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PSIC`"] +#[doc = "Field `PSIC` writer - Prescaler clear"] pub struct PSIC_W<'a> { w: &'a mut W, } @@ -136,7 +147,7 @@ impl<'a> PSIC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -171,4 +182,26 @@ impl W { pub fn psic(&mut self) -> PSIC_W { PSIC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Idle Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidls](index.html) module"] +pub struct GIDLS_SPEC; +impl crate::RegisterSpec for GIDLS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gidls::W](W) writer structure"] +impl crate::Writable for GIDLS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GIDLS to value 0"] +impl crate::Resettable for GIDLS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40/gstat.rs b/src/ccu40/gstat.rs index a00c4213..f56e9b2a 100644 --- a/src/ccu40/gstat.rs +++ b/src/ccu40/gstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register GSTAT"] -pub type R = crate::R; +#[doc = "Register `GSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "CC40 IDLE status\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0I_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0I`"] -pub type S0I_R = crate::R; +#[doc = "Field `S0I` reader - CC40 IDLE status"] +pub struct S0I_R(crate::FieldReader); impl S0I_R { + pub(crate) fn new(bits: bool) -> Self { + S0I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0I_A { @@ -28,12 +44,19 @@ impl S0I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0I_A::VALUE1 + **self == S0I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0I_A::VALUE2 + **self == S0I_A::VALUE2 + } +} +impl core::ops::Deref for S0I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC41 IDLE status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1I`"] -pub type S1I_R = crate::R; +#[doc = "Field `S1I` reader - CC41 IDLE status"] +pub struct S1I_R(crate::FieldReader); impl S1I_R { + pub(crate) fn new(bits: bool) -> Self { + S1I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1I_A { @@ -64,12 +90,19 @@ impl S1I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1I_A::VALUE1 + **self == S1I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1I_A::VALUE2 + **self == S1I_A::VALUE2 + } +} +impl core::ops::Deref for S1I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC42 IDLE status\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2I`"] -pub type S2I_R = crate::R; +#[doc = "Field `S2I` reader - CC42 IDLE status"] +pub struct S2I_R(crate::FieldReader); impl S2I_R { + pub(crate) fn new(bits: bool) -> Self { + S2I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2I_A { @@ -100,12 +136,19 @@ impl S2I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2I_A::VALUE1 + **self == S2I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2I_A::VALUE2 + **self == S2I_A::VALUE2 + } +} +impl core::ops::Deref for S2I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC43 IDLE status\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3I`"] -pub type S3I_R = crate::R; +#[doc = "Field `S3I` reader - CC43 IDLE status"] +pub struct S3I_R(crate::FieldReader); impl S3I_R { + pub(crate) fn new(bits: bool) -> Self { + S3I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3I_A { @@ -136,12 +182,19 @@ impl S3I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3I_A::VALUE1 + **self == S3I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3I_A::VALUE2 + **self == S3I_A::VALUE2 + } +} +impl core::ops::Deref for S3I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Prescaler Run Bit\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRB`"] -pub type PRB_R = crate::R; +#[doc = "Field `PRB` reader - Prescaler Run Bit"] +pub struct PRB_R(crate::FieldReader); impl PRB_R { + pub(crate) fn new(bits: bool) -> Self { + PRB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRB_A { @@ -172,12 +228,19 @@ impl PRB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRB_A::VALUE1 + **self == PRB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRB_A::VALUE2 + **self == PRB_A::VALUE2 + } +} +impl core::ops::Deref for PRB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -207,3 +270,19 @@ impl R { PRB_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Global Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gstat](index.html) module"] +pub struct GSTAT_SPEC; +impl crate::RegisterSpec for GSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gstat::R](R) reader structure"] +impl crate::Readable for GSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GSTAT to value 0x0f"] +impl crate::Resettable for GSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0f + } +} diff --git a/src/ccu40/midr.rs b/src/ccu40/midr.rs index ca2a62bb..0f8d83ad 100644 --- a/src/ccu40/midr.rs +++ b/src/ccu40/midr.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register MIDR"] -pub type R = crate::R; -#[doc = "Reader of field `MODR`"] -pub type MODR_R = crate::R; -#[doc = "Reader of field `MODT`"] -pub type MODT_R = crate::R; -#[doc = "Reader of field `MODN`"] -pub type MODN_R = crate::R; +#[doc = "Register `MIDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MODR` reader - Module Revision"] +pub struct MODR_R(crate::FieldReader); +impl MODR_R { + pub(crate) fn new(bits: u8) -> Self { + MODR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODT` reader - Module Type"] +pub struct MODT_R(crate::FieldReader); +impl MODT_R { + pub(crate) fn new(bits: u8) -> Self { + MODT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODN` reader - Module Number"] +pub struct MODN_R(crate::FieldReader); +impl MODN_R { + pub(crate) fn new(bits: u16) -> Self { + MODN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MODN_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](index.html) module"] +pub struct MIDR_SPEC; +impl crate::RegisterSpec for MIDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [midr::R](R) reader structure"] +impl crate::Readable for MIDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIDR to value 0x00a6_c000"] +impl crate::Resettable for MIDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a6_c000 + } +} diff --git a/src/ccu40_cc40.rs b/src/ccu40_cc40.rs index ce6d0a4f..6821bffd 100644 --- a/src/ccu40_cc40.rs +++ b/src/ccu40_cc40.rs @@ -2,317 +2,161 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Input Selector Configuration"] - pub ins: INS, + pub ins: crate::Reg, #[doc = "0x04 - Connection Matrix Control"] - pub cmc: CMC, + pub cmc: crate::Reg, #[doc = "0x08 - Slice Timer Status"] - pub tcst: TCST, + pub tcst: crate::Reg, #[doc = "0x0c - Slice Timer Run Set"] - pub tcset: TCSET, + pub tcset: crate::Reg, #[doc = "0x10 - Slice Timer Clear"] - pub tcclr: TCCLR, + pub tcclr: crate::Reg, #[doc = "0x14 - Slice Timer Control"] - pub tc: TC, + pub tc: crate::Reg, #[doc = "0x18 - Passive Level Config"] - pub psl: PSL, + pub psl: crate::Reg, #[doc = "0x1c - Dither Config"] - pub dit: DIT, + pub dit: crate::Reg, #[doc = "0x20 - Dither Shadow Register"] - pub dits: DITS, + pub dits: crate::Reg, #[doc = "0x24 - Prescaler Control"] - pub psc: PSC, + pub psc: crate::Reg, #[doc = "0x28 - Floating Prescaler Control"] - pub fpc: FPC, + pub fpc: crate::Reg, #[doc = "0x2c - Floating Prescaler Shadow"] - pub fpcs: FPCS, + pub fpcs: crate::Reg, #[doc = "0x30 - Timer Period Value"] - pub pr: PR, + pub pr: crate::Reg, #[doc = "0x34 - Timer Shadow Period Value"] - pub prs: PRS, + pub prs: crate::Reg, #[doc = "0x38 - Timer Compare Value"] - pub cr: CR, + pub cr: crate::Reg, #[doc = "0x3c - Timer Shadow Compare Value"] - pub crs: CRS, - _reserved16: [u8; 48usize], + pub crs: crate::Reg, + _reserved16: [u8; 0x30], #[doc = "0x70 - Timer Value"] - pub timer: TIMER, + pub timer: crate::Reg, #[doc = "0x74 - Capture Register 0"] - pub c0v: C0V, + pub c0v: crate::Reg, #[doc = "0x78 - Capture Register 1"] - pub c1v: C1V, + pub c1v: crate::Reg, #[doc = "0x7c - Capture Register 2"] - pub c2v: C2V, + pub c2v: crate::Reg, #[doc = "0x80 - Capture Register 3"] - pub c3v: C3V, - _reserved21: [u8; 28usize], + pub c3v: crate::Reg, + _reserved21: [u8; 0x1c], #[doc = "0xa0 - Interrupt Status"] - pub ints: INTS, + pub ints: crate::Reg, #[doc = "0xa4 - Interrupt Enable Control"] - pub inte: INTE, + pub inte: crate::Reg, #[doc = "0xa8 - Service Request Selector"] - pub srs: SRS, + pub srs: crate::Reg, #[doc = "0xac - Interrupt Status Set"] - pub sws: SWS, + pub sws: crate::Reg, #[doc = "0xb0 - Interrupt Status Clear"] - pub swr: SWR, + pub swr: crate::Reg, } -#[doc = "Input Selector Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ins](ins) module"] -pub type INS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INS; -#[doc = "`read()` method returns [ins::R](ins::R) reader structure"] -impl crate::Readable for INS {} -#[doc = "`write(|w| ..)` method takes [ins::W](ins::W) writer structure"] -impl crate::Writable for INS {} +#[doc = "INS register accessor: an alias for `Reg`"] +pub type INS = crate::Reg; #[doc = "Input Selector Configuration"] pub mod ins; -#[doc = "Connection Matrix Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cmc](cmc) module"] -pub type CMC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CMC; -#[doc = "`read()` method returns [cmc::R](cmc::R) reader structure"] -impl crate::Readable for CMC {} -#[doc = "`write(|w| ..)` method takes [cmc::W](cmc::W) writer structure"] -impl crate::Writable for CMC {} +#[doc = "CMC register accessor: an alias for `Reg`"] +pub type CMC = crate::Reg; #[doc = "Connection Matrix Control"] pub mod cmc; -#[doc = "Slice Timer Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcst](tcst) module"] -pub type TCST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCST; -#[doc = "`read()` method returns [tcst::R](tcst::R) reader structure"] -impl crate::Readable for TCST {} +#[doc = "TCST register accessor: an alias for `Reg`"] +pub type TCST = crate::Reg; #[doc = "Slice Timer Status"] pub mod tcst; -#[doc = "Slice Timer Run Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcset](tcset) module"] -pub type TCSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCSET; -#[doc = "`write(|w| ..)` method takes [tcset::W](tcset::W) writer structure"] -impl crate::Writable for TCSET {} +#[doc = "TCSET register accessor: an alias for `Reg`"] +pub type TCSET = crate::Reg; #[doc = "Slice Timer Run Set"] pub mod tcset; -#[doc = "Slice Timer Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcclr](tcclr) module"] -pub type TCCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCCLR; -#[doc = "`write(|w| ..)` method takes [tcclr::W](tcclr::W) writer structure"] -impl crate::Writable for TCCLR {} +#[doc = "TCCLR register accessor: an alias for `Reg`"] +pub type TCCLR = crate::Reg; #[doc = "Slice Timer Clear"] pub mod tcclr; -#[doc = "Slice Timer Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tc](tc) module"] -pub type TC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TC; -#[doc = "`read()` method returns [tc::R](tc::R) reader structure"] -impl crate::Readable for TC {} -#[doc = "`write(|w| ..)` method takes [tc::W](tc::W) writer structure"] -impl crate::Writable for TC {} +#[doc = "TC register accessor: an alias for `Reg`"] +pub type TC = crate::Reg; #[doc = "Slice Timer Control"] pub mod tc; -#[doc = "Passive Level Config\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psl](psl) module"] -pub type PSL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSL; -#[doc = "`read()` method returns [psl::R](psl::R) reader structure"] -impl crate::Readable for PSL {} -#[doc = "`write(|w| ..)` method takes [psl::W](psl::W) writer structure"] -impl crate::Writable for PSL {} +#[doc = "PSL register accessor: an alias for `Reg`"] +pub type PSL = crate::Reg; #[doc = "Passive Level Config"] pub mod psl; -#[doc = "Dither Config\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dit](dit) module"] -pub type DIT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIT; -#[doc = "`read()` method returns [dit::R](dit::R) reader structure"] -impl crate::Readable for DIT {} +#[doc = "DIT register accessor: an alias for `Reg`"] +pub type DIT = crate::Reg; #[doc = "Dither Config"] pub mod dit; -#[doc = "Dither Shadow Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dits](dits) module"] -pub type DITS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DITS; -#[doc = "`read()` method returns [dits::R](dits::R) reader structure"] -impl crate::Readable for DITS {} -#[doc = "`write(|w| ..)` method takes [dits::W](dits::W) writer structure"] -impl crate::Writable for DITS {} +#[doc = "DITS register accessor: an alias for `Reg`"] +pub type DITS = crate::Reg; #[doc = "Dither Shadow Register"] pub mod dits; -#[doc = "Prescaler Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psc](psc) module"] -pub type PSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSC; -#[doc = "`read()` method returns [psc::R](psc::R) reader structure"] -impl crate::Readable for PSC {} -#[doc = "`write(|w| ..)` method takes [psc::W](psc::W) writer structure"] -impl crate::Writable for PSC {} +#[doc = "PSC register accessor: an alias for `Reg`"] +pub type PSC = crate::Reg; #[doc = "Prescaler Control"] pub mod psc; -#[doc = "Floating Prescaler Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpc](fpc) module"] -pub type FPC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPC; -#[doc = "`read()` method returns [fpc::R](fpc::R) reader structure"] -impl crate::Readable for FPC {} -#[doc = "`write(|w| ..)` method takes [fpc::W](fpc::W) writer structure"] -impl crate::Writable for FPC {} +#[doc = "FPC register accessor: an alias for `Reg`"] +pub type FPC = crate::Reg; #[doc = "Floating Prescaler Control"] pub mod fpc; -#[doc = "Floating Prescaler Shadow\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpcs](fpcs) module"] -pub type FPCS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPCS; -#[doc = "`read()` method returns [fpcs::R](fpcs::R) reader structure"] -impl crate::Readable for FPCS {} -#[doc = "`write(|w| ..)` method takes [fpcs::W](fpcs::W) writer structure"] -impl crate::Writable for FPCS {} +#[doc = "FPCS register accessor: an alias for `Reg`"] +pub type FPCS = crate::Reg; #[doc = "Floating Prescaler Shadow"] pub mod fpcs; -#[doc = "Timer Period Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pr](pr) module"] -pub type PR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PR; -#[doc = "`read()` method returns [pr::R](pr::R) reader structure"] -impl crate::Readable for PR {} +#[doc = "PR register accessor: an alias for `Reg`"] +pub type PR = crate::Reg; #[doc = "Timer Period Value"] pub mod pr; -#[doc = "Timer Shadow Period Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prs](prs) module"] -pub type PRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRS; -#[doc = "`read()` method returns [prs::R](prs::R) reader structure"] -impl crate::Readable for PRS {} -#[doc = "`write(|w| ..)` method takes [prs::W](prs::W) writer structure"] -impl crate::Writable for PRS {} +#[doc = "PRS register accessor: an alias for `Reg`"] +pub type PRS = crate::Reg; #[doc = "Timer Shadow Period Value"] pub mod prs; -#[doc = "Timer Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](cr) module"] -pub type CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR; -#[doc = "`read()` method returns [cr::R](cr::R) reader structure"] -impl crate::Readable for CR {} +#[doc = "CR register accessor: an alias for `Reg`"] +pub type CR = crate::Reg; #[doc = "Timer Compare Value"] pub mod cr; -#[doc = "Timer Shadow Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crs](crs) module"] -pub type CRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CRS; -#[doc = "`read()` method returns [crs::R](crs::R) reader structure"] -impl crate::Readable for CRS {} -#[doc = "`write(|w| ..)` method takes [crs::W](crs::W) writer structure"] -impl crate::Writable for CRS {} +#[doc = "CRS register accessor: an alias for `Reg`"] +pub type CRS = crate::Reg; #[doc = "Timer Shadow Compare Value"] pub mod crs; -#[doc = "Timer Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [timer](timer) module"] -pub type TIMER = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TIMER; -#[doc = "`read()` method returns [timer::R](timer::R) reader structure"] -impl crate::Readable for TIMER {} -#[doc = "`write(|w| ..)` method takes [timer::W](timer::W) writer structure"] -impl crate::Writable for TIMER {} +#[doc = "TIMER register accessor: an alias for `Reg`"] +pub type TIMER = crate::Reg; #[doc = "Timer Value"] pub mod timer; -#[doc = "Capture Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c0v](c0v) module"] -pub type C0V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C0V; -#[doc = "`read()` method returns [c0v::R](c0v::R) reader structure"] -impl crate::Readable for C0V {} +#[doc = "C0V register accessor: an alias for `Reg`"] +pub type C0V = crate::Reg; #[doc = "Capture Register 0"] pub mod c0v; -#[doc = "Capture Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c1v](c1v) module"] -pub type C1V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C1V; -#[doc = "`read()` method returns [c1v::R](c1v::R) reader structure"] -impl crate::Readable for C1V {} +#[doc = "C1V register accessor: an alias for `Reg`"] +pub type C1V = crate::Reg; #[doc = "Capture Register 1"] pub mod c1v; -#[doc = "Capture Register 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c2v](c2v) module"] -pub type C2V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C2V; -#[doc = "`read()` method returns [c2v::R](c2v::R) reader structure"] -impl crate::Readable for C2V {} +#[doc = "C2V register accessor: an alias for `Reg`"] +pub type C2V = crate::Reg; #[doc = "Capture Register 2"] pub mod c2v; -#[doc = "Capture Register 3\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c3v](c3v) module"] -pub type C3V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C3V; -#[doc = "`read()` method returns [c3v::R](c3v::R) reader structure"] -impl crate::Readable for C3V {} +#[doc = "C3V register accessor: an alias for `Reg`"] +pub type C3V = crate::Reg; #[doc = "Capture Register 3"] pub mod c3v; -#[doc = "Interrupt Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ints](ints) module"] -pub type INTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INTS; -#[doc = "`read()` method returns [ints::R](ints::R) reader structure"] -impl crate::Readable for INTS {} +#[doc = "INTS register accessor: an alias for `Reg`"] +pub type INTS = crate::Reg; #[doc = "Interrupt Status"] pub mod ints; -#[doc = "Interrupt Enable Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inte](inte) module"] -pub type INTE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INTE; -#[doc = "`read()` method returns [inte::R](inte::R) reader structure"] -impl crate::Readable for INTE {} -#[doc = "`write(|w| ..)` method takes [inte::W](inte::W) writer structure"] -impl crate::Writable for INTE {} +#[doc = "INTE register accessor: an alias for `Reg`"] +pub type INTE = crate::Reg; #[doc = "Interrupt Enable Control"] pub mod inte; -#[doc = "Service Request Selector\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srs](srs) module"] -pub type SRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRS; -#[doc = "`read()` method returns [srs::R](srs::R) reader structure"] -impl crate::Readable for SRS {} -#[doc = "`write(|w| ..)` method takes [srs::W](srs::W) writer structure"] -impl crate::Writable for SRS {} +#[doc = "SRS register accessor: an alias for `Reg`"] +pub type SRS = crate::Reg; #[doc = "Service Request Selector"] pub mod srs; -#[doc = "Interrupt Status Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](sws) module"] -pub type SWS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWS; -#[doc = "`write(|w| ..)` method takes [sws::W](sws::W) writer structure"] -impl crate::Writable for SWS {} +#[doc = "SWS register accessor: an alias for `Reg`"] +pub type SWS = crate::Reg; #[doc = "Interrupt Status Set"] pub mod sws; -#[doc = "Interrupt Status Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swr](swr) module"] -pub type SWR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWR; -#[doc = "`write(|w| ..)` method takes [swr::W](swr::W) writer structure"] -impl crate::Writable for SWR {} +#[doc = "SWR register accessor: an alias for `Reg`"] +pub type SWR = crate::Reg; #[doc = "Interrupt Status Clear"] pub mod swr; diff --git a/src/ccu40_cc40/c0v.rs b/src/ccu40_cc40/c0v.rs index eb72260b..2364170c 100644 --- a/src/ccu40_cc40/c0v.rs +++ b/src/ccu40_cc40/c0v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C0V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C0V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c0v](index.html) module"] +pub struct C0V_SPEC; +impl crate::RegisterSpec for C0V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c0v::R](R) reader structure"] +impl crate::Readable for C0V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C0V to value 0"] +impl crate::Resettable for C0V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/c1v.rs b/src/ccu40_cc40/c1v.rs index 10012a33..55710fd5 100644 --- a/src/ccu40_cc40/c1v.rs +++ b/src/ccu40_cc40/c1v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C1V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C1V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c1v](index.html) module"] +pub struct C1V_SPEC; +impl crate::RegisterSpec for C1V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c1v::R](R) reader structure"] +impl crate::Readable for C1V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C1V to value 0"] +impl crate::Resettable for C1V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/c2v.rs b/src/ccu40_cc40/c2v.rs index b5f91bd6..1f42e7e5 100644 --- a/src/ccu40_cc40/c2v.rs +++ b/src/ccu40_cc40/c2v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C2V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C2V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c2v](index.html) module"] +pub struct C2V_SPEC; +impl crate::RegisterSpec for C2V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c2v::R](R) reader structure"] +impl crate::Readable for C2V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C2V to value 0"] +impl crate::Resettable for C2V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/c3v.rs b/src/ccu40_cc40/c3v.rs index 5899571b..16fb0f42 100644 --- a/src/ccu40_cc40/c3v.rs +++ b/src/ccu40_cc40/c3v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C3V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C3V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 3\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c3v](index.html) module"] +pub struct C3V_SPEC; +impl crate::RegisterSpec for C3V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c3v::R](R) reader structure"] +impl crate::Readable for C3V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C3V to value 0"] +impl crate::Resettable for C3V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/cmc.rs b/src/ccu40_cc40/cmc.rs index c8d61c76..b003fe98 100644 --- a/src/ccu40_cc40/cmc.rs +++ b/src/ccu40_cc40/cmc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CMC"] -pub type R = crate::R; -#[doc = "Writer for register CMC"] -pub type W = crate::W; -#[doc = "Register CMC `reset()`'s with value 0"] -impl crate::ResetValue for super::CMC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CMC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CMC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "External Start Functionality Selector\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STRTS`"] -pub type STRTS_R = crate::R; +#[doc = "Field `STRTS` reader - External Start Functionality Selector"] +pub struct STRTS_R(crate::FieldReader); impl STRTS_R { + pub(crate) fn new(bits: u8) -> Self { + STRTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRTS_A { @@ -46,25 +73,32 @@ impl STRTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRTS_A::VALUE1 + **self == STRTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRTS_A::VALUE2 + **self == STRTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STRTS_A::VALUE3 + **self == STRTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STRTS_A::VALUE4 + **self == STRTS_A::VALUE4 + } +} +impl core::ops::Deref for STRTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STRTS`"] +#[doc = "Field `STRTS` writer - External Start Functionality Selector"] pub struct STRTS_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> STRTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STRTS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Start Function deactivated"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> STRTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENDS`"] -pub type ENDS_R = crate::R; +#[doc = "Field `ENDS` reader - External Stop Functionality Selector"] +pub struct ENDS_R(crate::FieldReader); impl ENDS_R { + pub(crate) fn new(bits: u8) -> Self { + ENDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENDS_A { @@ -139,25 +174,32 @@ impl ENDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDS_A::VALUE1 + **self == ENDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDS_A::VALUE2 + **self == ENDS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENDS_A::VALUE3 + **self == ENDS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENDS_A::VALUE4 + **self == ENDS_A::VALUE4 + } +} +impl core::ops::Deref for ENDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENDS`"] +#[doc = "Field `ENDS` writer - External Stop Functionality Selector"] pub struct ENDS_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> ENDS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENDS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Stop Function deactivated"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> ENDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAP0S`"] -pub type CAP0S_R = crate::R; +#[doc = "Field `CAP0S` reader - External Capture 0 Functionality Selector"] +pub struct CAP0S_R(crate::FieldReader); impl CAP0S_R { + pub(crate) fn new(bits: u8) -> Self { + CAP0S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAP0S_A { @@ -232,25 +275,32 @@ impl CAP0S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAP0S_A::VALUE1 + **self == CAP0S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAP0S_A::VALUE2 + **self == CAP0S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAP0S_A::VALUE3 + **self == CAP0S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAP0S_A::VALUE4 + **self == CAP0S_A::VALUE4 } } -#[doc = "Write proxy for field `CAP0S`"] +impl core::ops::Deref for CAP0S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAP0S` writer - External Capture 0 Functionality Selector"] pub struct CAP0S_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> CAP0S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAP0S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Capture 0 Function deactivated"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> CAP0S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAP1S`"] -pub type CAP1S_R = crate::R; +#[doc = "Field `CAP1S` reader - External Capture 1 Functionality Selector"] +pub struct CAP1S_R(crate::FieldReader); impl CAP1S_R { + pub(crate) fn new(bits: u8) -> Self { + CAP1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAP1S_A { @@ -325,25 +376,32 @@ impl CAP1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAP1S_A::VALUE1 + **self == CAP1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAP1S_A::VALUE2 + **self == CAP1S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAP1S_A::VALUE3 + **self == CAP1S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAP1S_A::VALUE4 + **self == CAP1S_A::VALUE4 } } -#[doc = "Write proxy for field `CAP1S`"] +impl core::ops::Deref for CAP1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAP1S` writer - External Capture 1 Functionality Selector"] pub struct CAP1S_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> CAP1S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAP1S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Capture 1 Function deactivated"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> CAP1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `GATES`"] -pub type GATES_R = crate::R; +#[doc = "Field `GATES` reader - External Gate Functionality Selector"] +pub struct GATES_R(crate::FieldReader); impl GATES_R { + pub(crate) fn new(bits: u8) -> Self { + GATES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GATES_A { @@ -418,25 +477,32 @@ impl GATES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GATES_A::VALUE1 + **self == GATES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GATES_A::VALUE2 + **self == GATES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == GATES_A::VALUE3 + **self == GATES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == GATES_A::VALUE4 + **self == GATES_A::VALUE4 + } +} +impl core::ops::Deref for GATES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GATES`"] +#[doc = "Field `GATES` writer - External Gate Functionality Selector"] pub struct GATES_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> GATES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GATES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Gating Function deactivated"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> GATES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -494,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `UDS`"] -pub type UDS_R = crate::R; +#[doc = "Field `UDS` reader - External Up/Down Functionality Selector"] +pub struct UDS_R(crate::FieldReader); impl UDS_R { + pub(crate) fn new(bits: u8) -> Self { + UDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UDS_A { @@ -511,25 +578,32 @@ impl UDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UDS_A::VALUE1 + **self == UDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UDS_A::VALUE2 + **self == UDS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == UDS_A::VALUE3 + **self == UDS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == UDS_A::VALUE4 + **self == UDS_A::VALUE4 } } -#[doc = "Write proxy for field `UDS`"] +impl core::ops::Deref for UDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UDS` writer - External Up/Down Functionality Selector"] pub struct UDS_W<'a> { w: &'a mut W, } @@ -537,9 +611,7 @@ impl<'a> UDS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UDS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Up/Down Function deactivated"] #[inline(always)] @@ -564,13 +636,25 @@ impl<'a> UDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } -#[doc = "Reader of field `LDS`"] -pub type LDS_R = crate::R; -#[doc = "Write proxy for field `LDS`"] +#[doc = "Field `LDS` reader - External Timer Load Functionality Selector"] +pub struct LDS_R(crate::FieldReader); +impl LDS_R { + pub(crate) fn new(bits: u8) -> Self { + LDS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LDS` writer - External Timer Load Functionality Selector"] pub struct LDS_W<'a> { w: &'a mut W, } @@ -578,7 +662,7 @@ impl<'a> LDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -601,9 +685,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CNTS`"] -pub type CNTS_R = crate::R; +#[doc = "Field `CNTS` reader - External Count Selector"] +pub struct CNTS_R(crate::FieldReader); impl CNTS_R { + pub(crate) fn new(bits: u8) -> Self { + CNTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CNTS_A { @@ -618,25 +705,32 @@ impl CNTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CNTS_A::VALUE1 + **self == CNTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CNTS_A::VALUE2 + **self == CNTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CNTS_A::VALUE3 + **self == CNTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CNTS_A::VALUE4 + **self == CNTS_A::VALUE4 + } +} +impl core::ops::Deref for CNTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CNTS`"] +#[doc = "Field `CNTS` writer - External Count Selector"] pub struct CNTS_W<'a> { w: &'a mut W, } @@ -644,9 +738,7 @@ impl<'a> CNTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CNTS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Count Function deactivated"] #[inline(always)] @@ -671,7 +763,7 @@ impl<'a> CNTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -689,9 +781,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OFS`"] -pub type OFS_R = crate::R; +#[doc = "Field `OFS` reader - Override Function Selector"] +pub struct OFS_R(crate::FieldReader); impl OFS_R { + pub(crate) fn new(bits: bool) -> Self { + OFS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OFS_A { @@ -703,15 +798,22 @@ impl OFS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OFS_A::VALUE1 + **self == OFS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OFS_A::VALUE2 + **self == OFS_A::VALUE2 + } +} +impl core::ops::Deref for OFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OFS`"] +#[doc = "Field `OFS` writer - Override Function Selector"] pub struct OFS_W<'a> { w: &'a mut W, } @@ -719,9 +821,7 @@ impl<'a> OFS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OFS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Override functionality disabled"] #[inline(always)] @@ -746,7 +846,7 @@ impl<'a> OFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -764,9 +864,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TS`"] -pub type TS_R = crate::R; +#[doc = "Field `TS` reader - Trap Function Selector"] +pub struct TS_R(crate::FieldReader); impl TS_R { + pub(crate) fn new(bits: bool) -> Self { + TS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TS_A { @@ -778,15 +881,22 @@ impl TS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TS_A::VALUE1 + **self == TS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TS_A::VALUE2 + **self == TS_A::VALUE2 + } +} +impl core::ops::Deref for TS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TS`"] +#[doc = "Field `TS` writer - Trap Function Selector"] pub struct TS_W<'a> { w: &'a mut W, } @@ -794,9 +904,7 @@ impl<'a> TS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap function disabled"] #[inline(always)] @@ -821,13 +929,25 @@ impl<'a> TS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `MOS`"] -pub type MOS_R = crate::R; -#[doc = "Write proxy for field `MOS`"] +#[doc = "Field `MOS` reader - External Modulation Functionality Selector"] +pub struct MOS_R(crate::FieldReader); +impl MOS_R { + pub(crate) fn new(bits: u8) -> Self { + MOS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOS` writer - External Modulation Functionality Selector"] pub struct MOS_W<'a> { w: &'a mut W, } @@ -835,7 +955,7 @@ impl<'a> MOS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -853,9 +973,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TCE`"] -pub type TCE_R = crate::R; +#[doc = "Field `TCE` reader - Timer Concatenation Enable"] +pub struct TCE_R(crate::FieldReader); impl TCE_R { + pub(crate) fn new(bits: bool) -> Self { + TCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TCE_A { @@ -867,15 +990,22 @@ impl TCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TCE_A::VALUE1 + **self == TCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TCE_A::VALUE2 + **self == TCE_A::VALUE2 + } +} +impl core::ops::Deref for TCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TCE`"] +#[doc = "Field `TCE` writer - Timer Concatenation Enable"] pub struct TCE_W<'a> { w: &'a mut W, } @@ -883,9 +1013,7 @@ impl<'a> TCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Timer concatenation is disabled"] #[inline(always)] @@ -910,7 +1038,7 @@ impl<'a> TCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -1037,4 +1165,30 @@ impl W { pub fn tce(&mut self) -> TCE_W { TCE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Connection Matrix Control\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 [cmc](index.html) module"] +pub struct CMC_SPEC; +impl crate::RegisterSpec for CMC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cmc::R](R) reader structure"] +impl crate::Readable for CMC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cmc::W](W) writer structure"] +impl crate::Writable for CMC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CMC to value 0"] +impl crate::Resettable for CMC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/cr.rs b/src/ccu40_cc40/cr.rs index bc29e143..419d5160 100644 --- a/src/ccu40_cc40/cr.rs +++ b/src/ccu40_cc40/cr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register CR"] -pub type R = crate::R; -#[doc = "Reader of field `CR`"] -pub type CR_R = crate::R; +#[doc = "Register `CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CR` reader - Compare Register"] +pub struct CR_R(crate::FieldReader); +impl CR_R { + pub(crate) fn new(bits: u16) -> Self { + CR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Compare Register"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { CR_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Timer Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"] +pub struct CR_SPEC; +impl crate::RegisterSpec for CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr::R](R) reader structure"] +impl crate::Readable for CR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CR to value 0"] +impl crate::Resettable for CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/crs.rs b/src/ccu40_cc40/crs.rs index 912b599b..10462aed 100644 --- a/src/ccu40_cc40/crs.rs +++ b/src/ccu40_cc40/crs.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CRS"] -pub type R = crate::R; -#[doc = "Writer for register CRS"] -pub type W = crate::W; -#[doc = "Register CRS `reset()`'s with value 0"] -impl crate::ResetValue for super::CRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CRS`"] -pub type CRS_R = crate::R; -#[doc = "Write proxy for field `CRS`"] +#[doc = "Field `CRS` reader - Compare Register"] +pub struct CRS_R(crate::FieldReader); +impl CRS_R { + pub(crate) fn new(bits: u16) -> Self { + CRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRS` writer - Compare Register"] pub struct CRS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn crs(&mut self) -> CRS_W { CRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer Shadow Compare Value\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 [crs](index.html) module"] +pub struct CRS_SPEC; +impl crate::RegisterSpec for CRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crs::R](R) reader structure"] +impl crate::Readable for CRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crs::W](W) writer structure"] +impl crate::Writable for CRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRS to value 0"] +impl crate::Resettable for CRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/dit.rs b/src/ccu40_cc40/dit.rs index 7b74829e..d5b75291 100644 --- a/src/ccu40_cc40/dit.rs +++ b/src/ccu40_cc40/dit.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register DIT"] -pub type R = crate::R; -#[doc = "Reader of field `DCV`"] -pub type DCV_R = crate::R; -#[doc = "Reader of field `DCNT`"] -pub type DCNT_R = crate::R; +#[doc = "Register `DIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DCV` reader - Dither compare Value"] +pub struct DCV_R(crate::FieldReader); +impl DCV_R { + pub(crate) fn new(bits: u8) -> Self { + DCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCNT` reader - Dither counter actual value"] +pub struct DCNT_R(crate::FieldReader); +impl DCNT_R { + pub(crate) fn new(bits: u8) -> Self { + DCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:3 - Dither compare Value"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { DCNT_R::new(((self.bits >> 8) & 0x0f) as u8) } } +#[doc = "Dither Config\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dit](index.html) module"] +pub struct DIT_SPEC; +impl crate::RegisterSpec for DIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dit::R](R) reader structure"] +impl crate::Readable for DIT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DIT to value 0"] +impl crate::Resettable for DIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/dits.rs b/src/ccu40_cc40/dits.rs index c5c9267e..e7ee6a09 100644 --- a/src/ccu40_cc40/dits.rs +++ b/src/ccu40_cc40/dits.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DITS"] -pub type R = crate::R; -#[doc = "Writer for register DITS"] -pub type W = crate::W; -#[doc = "Register DITS `reset()`'s with value 0"] -impl crate::ResetValue for super::DITS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DITS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DITS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DCVS`"] -pub type DCVS_R = crate::R; -#[doc = "Write proxy for field `DCVS`"] +#[doc = "Field `DCVS` reader - Dither Shadow Compare Value"] +pub struct DCVS_R(crate::FieldReader); +impl DCVS_R { + pub(crate) fn new(bits: u8) -> Self { + DCVS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCVS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCVS` writer - Dither Shadow Compare Value"] pub struct DCVS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DCVS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dcvs(&mut self) -> DCVS_W { DCVS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Dither Shadow Register\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 [dits](index.html) module"] +pub struct DITS_SPEC; +impl crate::RegisterSpec for DITS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dits::R](R) reader structure"] +impl crate::Readable for DITS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dits::W](W) writer structure"] +impl crate::Writable for DITS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DITS to value 0"] +impl crate::Resettable for DITS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/fpc.rs b/src/ccu40_cc40/fpc.rs index 8c7437c7..0ac6545f 100644 --- a/src/ccu40_cc40/fpc.rs +++ b/src/ccu40_cc40/fpc.rs @@ -1,20 +1,68 @@ -#[doc = "Reader of register FPC"] -pub type R = crate::R; -#[doc = "Writer for register FPC"] -pub type W = crate::W; -#[doc = "Register FPC `reset()`'s with value 0"] -impl crate::ResetValue for super::FPC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `PCMP`"] -pub type PCMP_R = crate::R; -#[doc = "Reader of field `PVAL`"] -pub type PVAL_R = crate::R; -#[doc = "Write proxy for field `PVAL`"] +#[doc = "Register `FPC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PCMP` reader - Floating Prescaler Compare Value"] +pub struct PCMP_R(crate::FieldReader); +impl PCMP_R { + pub(crate) fn new(bits: u8) -> Self { + PCMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PVAL` reader - Actual Prescaler Value"] +pub struct PVAL_R(crate::FieldReader); +impl PVAL_R { + pub(crate) fn new(bits: u8) -> Self { + PVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PVAL` writer - Actual Prescaler Value"] pub struct PVAL_W<'a> { w: &'a mut W, } @@ -22,7 +70,7 @@ impl<'a> PVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -44,4 +92,30 @@ impl W { pub fn pval(&mut self) -> PVAL_W { PVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating Prescaler Control\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 [fpc](index.html) module"] +pub struct FPC_SPEC; +impl crate::RegisterSpec for FPC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpc::R](R) reader structure"] +impl crate::Readable for FPC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpc::W](W) writer structure"] +impl crate::Writable for FPC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPC to value 0"] +impl crate::Resettable for FPC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/fpcs.rs b/src/ccu40_cc40/fpcs.rs index aee1a033..1e6b5f15 100644 --- a/src/ccu40_cc40/fpcs.rs +++ b/src/ccu40_cc40/fpcs.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FPCS"] -pub type R = crate::R; -#[doc = "Writer for register FPCS"] -pub type W = crate::W; -#[doc = "Register FPCS `reset()`'s with value 0"] -impl crate::ResetValue for super::FPCS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPCS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FPCS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PCMP`"] -pub type PCMP_R = crate::R; -#[doc = "Write proxy for field `PCMP`"] +#[doc = "Field `PCMP` reader - Floating Prescaler Shadow Compare Value"] +pub struct PCMP_R(crate::FieldReader); +impl PCMP_R { + pub(crate) fn new(bits: u8) -> Self { + PCMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCMP` writer - Floating Prescaler Shadow Compare Value"] pub struct PCMP_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn pcmp(&mut self) -> PCMP_W { PCMP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating Prescaler Shadow\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 [fpcs](index.html) module"] +pub struct FPCS_SPEC; +impl crate::RegisterSpec for FPCS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpcs::R](R) reader structure"] +impl crate::Readable for FPCS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpcs::W](W) writer structure"] +impl crate::Writable for FPCS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPCS to value 0"] +impl crate::Resettable for FPCS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/ins.rs b/src/ccu40_cc40/ins.rs index bf2321ef..d84de8cf 100644 --- a/src/ccu40_cc40/ins.rs +++ b/src/ccu40_cc40/ins.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register INS"] -pub type R = crate::R; -#[doc = "Writer for register INS"] -pub type W = crate::W; -#[doc = "Register INS `reset()`'s with value 0"] -impl crate::ResetValue for super::INS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `INS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Event 0 signal selection\n\nValue on reset: 0"] @@ -53,9 +77,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV0IS`"] -pub type EV0IS_R = crate::R; +#[doc = "Field `EV0IS` reader - Event 0 signal selection"] +pub struct EV0IS_R(crate::FieldReader); impl EV0IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV0IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0IS_A { @@ -82,85 +109,92 @@ impl EV0IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0IS_A::VALUE1 + **self == EV0IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0IS_A::VALUE2 + **self == EV0IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV0IS_A::VALUE3 + **self == EV0IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV0IS_A::VALUE4 + **self == EV0IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV0IS_A::VALUE5 + **self == EV0IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV0IS_A::VALUE6 + **self == EV0IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV0IS_A::VALUE7 + **self == EV0IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV0IS_A::VALUE8 + **self == EV0IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV0IS_A::VALUE9 + **self == EV0IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV0IS_A::VALUE10 + **self == EV0IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV0IS_A::VALUE11 + **self == EV0IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV0IS_A::VALUE12 + **self == EV0IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV0IS_A::VALUE13 + **self == EV0IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV0IS_A::VALUE14 + **self == EV0IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV0IS_A::VALUE15 + **self == EV0IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV0IS_A::VALUE16 + **self == EV0IS_A::VALUE16 + } +} +impl core::ops::Deref for EV0IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV0IS`"] +#[doc = "Field `EV0IS` writer - Event 0 signal selection"] pub struct EV0IS_W<'a> { w: &'a mut W, } @@ -168,9 +202,7 @@ impl<'a> EV0IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU4x.INyA"] #[inline(always)] @@ -255,7 +287,7 @@ impl<'a> EV0IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -302,9 +334,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV1IS`"] -pub type EV1IS_R = crate::R; +#[doc = "Field `EV1IS` reader - Event 1 signal selection"] +pub struct EV1IS_R(crate::FieldReader); impl EV1IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV1IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1IS_A { @@ -331,85 +366,92 @@ impl EV1IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1IS_A::VALUE1 + **self == EV1IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1IS_A::VALUE2 + **self == EV1IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV1IS_A::VALUE3 + **self == EV1IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV1IS_A::VALUE4 + **self == EV1IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV1IS_A::VALUE5 + **self == EV1IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV1IS_A::VALUE6 + **self == EV1IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV1IS_A::VALUE7 + **self == EV1IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV1IS_A::VALUE8 + **self == EV1IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV1IS_A::VALUE9 + **self == EV1IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV1IS_A::VALUE10 + **self == EV1IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV1IS_A::VALUE11 + **self == EV1IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV1IS_A::VALUE12 + **self == EV1IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV1IS_A::VALUE13 + **self == EV1IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV1IS_A::VALUE14 + **self == EV1IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV1IS_A::VALUE15 + **self == EV1IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV1IS_A::VALUE16 + **self == EV1IS_A::VALUE16 + } +} +impl core::ops::Deref for EV1IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1IS`"] +#[doc = "Field `EV1IS` writer - Event 1 signal selection"] pub struct EV1IS_W<'a> { w: &'a mut W, } @@ -417,9 +459,7 @@ impl<'a> EV1IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU4x.INyA"] #[inline(always)] @@ -504,7 +544,7 @@ impl<'a> EV1IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -551,9 +591,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV2IS`"] -pub type EV2IS_R = crate::R; +#[doc = "Field `EV2IS` reader - Event 2 signal selection"] +pub struct EV2IS_R(crate::FieldReader); impl EV2IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV2IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2IS_A { @@ -580,85 +623,92 @@ impl EV2IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2IS_A::VALUE1 + **self == EV2IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2IS_A::VALUE2 + **self == EV2IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV2IS_A::VALUE3 + **self == EV2IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV2IS_A::VALUE4 + **self == EV2IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV2IS_A::VALUE5 + **self == EV2IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV2IS_A::VALUE6 + **self == EV2IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV2IS_A::VALUE7 + **self == EV2IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV2IS_A::VALUE8 + **self == EV2IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV2IS_A::VALUE9 + **self == EV2IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV2IS_A::VALUE10 + **self == EV2IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV2IS_A::VALUE11 + **self == EV2IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV2IS_A::VALUE12 + **self == EV2IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV2IS_A::VALUE13 + **self == EV2IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV2IS_A::VALUE14 + **self == EV2IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV2IS_A::VALUE15 + **self == EV2IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV2IS_A::VALUE16 + **self == EV2IS_A::VALUE16 } } -#[doc = "Write proxy for field `EV2IS`"] +impl core::ops::Deref for EV2IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV2IS` writer - Event 2 signal selection"] pub struct EV2IS_W<'a> { w: &'a mut W, } @@ -666,9 +716,7 @@ impl<'a> EV2IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU4x.INyA"] #[inline(always)] @@ -753,7 +801,7 @@ impl<'a> EV2IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -776,9 +824,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV0EM`"] -pub type EV0EM_R = crate::R; +#[doc = "Field `EV0EM` reader - Event 0 Edge Selection"] +pub struct EV0EM_R(crate::FieldReader); impl EV0EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV0EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0EM_A { @@ -793,25 +844,32 @@ impl EV0EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0EM_A::VALUE1 + **self == EV0EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0EM_A::VALUE2 + **self == EV0EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV0EM_A::VALUE3 + **self == EV0EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV0EM_A::VALUE4 + **self == EV0EM_A::VALUE4 } } -#[doc = "Write proxy for field `EV0EM`"] +impl core::ops::Deref for EV0EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV0EM` writer - Event 0 Edge Selection"] pub struct EV0EM_W<'a> { w: &'a mut W, } @@ -819,9 +877,7 @@ impl<'a> EV0EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -846,7 +902,7 @@ impl<'a> EV0EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -869,9 +925,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV1EM`"] -pub type EV1EM_R = crate::R; +#[doc = "Field `EV1EM` reader - Event 1 Edge Selection"] +pub struct EV1EM_R(crate::FieldReader); impl EV1EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV1EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1EM_A { @@ -886,25 +945,32 @@ impl EV1EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1EM_A::VALUE1 + **self == EV1EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1EM_A::VALUE2 + **self == EV1EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV1EM_A::VALUE3 + **self == EV1EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV1EM_A::VALUE4 + **self == EV1EM_A::VALUE4 + } +} +impl core::ops::Deref for EV1EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1EM`"] +#[doc = "Field `EV1EM` writer - Event 1 Edge Selection"] pub struct EV1EM_W<'a> { w: &'a mut W, } @@ -912,9 +978,7 @@ impl<'a> EV1EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -939,7 +1003,7 @@ impl<'a> EV1EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -962,9 +1026,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV2EM`"] -pub type EV2EM_R = crate::R; +#[doc = "Field `EV2EM` reader - Event 2 Edge Selection"] +pub struct EV2EM_R(crate::FieldReader); impl EV2EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV2EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2EM_A { @@ -979,25 +1046,32 @@ impl EV2EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2EM_A::VALUE1 + **self == EV2EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2EM_A::VALUE2 + **self == EV2EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV2EM_A::VALUE3 + **self == EV2EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV2EM_A::VALUE4 + **self == EV2EM_A::VALUE4 } } -#[doc = "Write proxy for field `EV2EM`"] +impl core::ops::Deref for EV2EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV2EM` writer - Event 2 Edge Selection"] pub struct EV2EM_W<'a> { w: &'a mut W, } @@ -1005,9 +1079,7 @@ impl<'a> EV2EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -1032,7 +1104,7 @@ impl<'a> EV2EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -1050,9 +1122,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV0LM`"] -pub type EV0LM_R = crate::R; +#[doc = "Field `EV0LM` reader - Event 0 Level Selection"] +pub struct EV0LM_R(crate::FieldReader); impl EV0LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV0LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0LM_A { @@ -1064,15 +1139,22 @@ impl EV0LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0LM_A::VALUE1 + **self == EV0LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0LM_A::VALUE2 + **self == EV0LM_A::VALUE2 + } +} +impl core::ops::Deref for EV0LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV0LM`"] +#[doc = "Field `EV0LM` writer - Event 0 Level Selection"] pub struct EV0LM_W<'a> { w: &'a mut W, } @@ -1080,9 +1162,7 @@ impl<'a> EV0LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1107,7 +1187,7 @@ impl<'a> EV0LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -1125,9 +1205,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV1LM`"] -pub type EV1LM_R = crate::R; +#[doc = "Field `EV1LM` reader - Event 1 Level Selection"] +pub struct EV1LM_R(crate::FieldReader); impl EV1LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV1LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1LM_A { @@ -1139,15 +1222,22 @@ impl EV1LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1LM_A::VALUE1 + **self == EV1LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1LM_A::VALUE2 + **self == EV1LM_A::VALUE2 + } +} +impl core::ops::Deref for EV1LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1LM`"] +#[doc = "Field `EV1LM` writer - Event 1 Level Selection"] pub struct EV1LM_W<'a> { w: &'a mut W, } @@ -1155,9 +1245,7 @@ impl<'a> EV1LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1182,7 +1270,7 @@ impl<'a> EV1LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -1200,9 +1288,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV2LM`"] -pub type EV2LM_R = crate::R; +#[doc = "Field `EV2LM` reader - Event 2 Level Selection"] +pub struct EV2LM_R(crate::FieldReader); impl EV2LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV2LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2LM_A { @@ -1214,15 +1305,22 @@ impl EV2LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2LM_A::VALUE1 + **self == EV2LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2LM_A::VALUE2 + **self == EV2LM_A::VALUE2 + } +} +impl core::ops::Deref for EV2LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV2LM`"] +#[doc = "Field `EV2LM` writer - Event 2 Level Selection"] pub struct EV2LM_W<'a> { w: &'a mut W, } @@ -1230,9 +1328,7 @@ impl<'a> EV2LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1257,7 +1353,7 @@ impl<'a> EV2LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1280,9 +1376,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF0M`"] -pub type LPF0M_R = crate::R; +#[doc = "Field `LPF0M` reader - Event 0 Low Pass Filter Configuration"] +pub struct LPF0M_R(crate::FieldReader); impl LPF0M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF0M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF0M_A { @@ -1297,25 +1396,32 @@ impl LPF0M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF0M_A::VALUE1 + **self == LPF0M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF0M_A::VALUE2 + **self == LPF0M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF0M_A::VALUE3 + **self == LPF0M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF0M_A::VALUE4 + **self == LPF0M_A::VALUE4 + } +} +impl core::ops::Deref for LPF0M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF0M`"] +#[doc = "Field `LPF0M` writer - Event 0 Low Pass Filter Configuration"] pub struct LPF0M_W<'a> { w: &'a mut W, } @@ -1323,9 +1429,7 @@ impl<'a> LPF0M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF0M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1350,7 +1454,7 @@ impl<'a> LPF0M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 25)) | (((value as u32) & 0x03) << 25); + self.w.bits = (self.w.bits & !(0x03 << 25)) | ((value as u32 & 0x03) << 25); self.w } } @@ -1373,9 +1477,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF1M`"] -pub type LPF1M_R = crate::R; +#[doc = "Field `LPF1M` reader - Event 1 Low Pass Filter Configuration"] +pub struct LPF1M_R(crate::FieldReader); impl LPF1M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF1M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF1M_A { @@ -1390,25 +1497,32 @@ impl LPF1M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF1M_A::VALUE1 + **self == LPF1M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF1M_A::VALUE2 + **self == LPF1M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF1M_A::VALUE3 + **self == LPF1M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF1M_A::VALUE4 + **self == LPF1M_A::VALUE4 + } +} +impl core::ops::Deref for LPF1M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF1M`"] +#[doc = "Field `LPF1M` writer - Event 1 Low Pass Filter Configuration"] pub struct LPF1M_W<'a> { w: &'a mut W, } @@ -1416,9 +1530,7 @@ impl<'a> LPF1M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF1M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1443,7 +1555,7 @@ impl<'a> LPF1M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 27)) | (((value as u32) & 0x03) << 27); + self.w.bits = (self.w.bits & !(0x03 << 27)) | ((value as u32 & 0x03) << 27); self.w } } @@ -1466,9 +1578,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF2M`"] -pub type LPF2M_R = crate::R; +#[doc = "Field `LPF2M` reader - Event 2 Low Pass Filter Configuration"] +pub struct LPF2M_R(crate::FieldReader); impl LPF2M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF2M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF2M_A { @@ -1483,25 +1598,32 @@ impl LPF2M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF2M_A::VALUE1 + **self == LPF2M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF2M_A::VALUE2 + **self == LPF2M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF2M_A::VALUE3 + **self == LPF2M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF2M_A::VALUE4 + **self == LPF2M_A::VALUE4 + } +} +impl core::ops::Deref for LPF2M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF2M`"] +#[doc = "Field `LPF2M` writer - Event 2 Low Pass Filter Configuration"] pub struct LPF2M_W<'a> { w: &'a mut W, } @@ -1509,9 +1631,7 @@ impl<'a> LPF2M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF2M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1536,7 +1656,7 @@ impl<'a> LPF2M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29); + self.w.bits = (self.w.bits & !(0x03 << 29)) | ((value as u32 & 0x03) << 29); self.w } } @@ -1663,4 +1783,30 @@ impl W { pub fn lpf2m(&mut self) -> LPF2M_W { LPF2M_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Selector Configuration\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 [ins](index.html) module"] +pub struct INS_SPEC; +impl crate::RegisterSpec for INS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ins::R](R) reader structure"] +impl crate::Readable for INS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ins::W](W) writer structure"] +impl crate::Writable for INS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INS to value 0"] +impl crate::Resettable for INS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/inte.rs b/src/ccu40_cc40/inte.rs index c27af40e..7904c100 100644 --- a/src/ccu40_cc40/inte.rs +++ b/src/ccu40_cc40/inte.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register INTE"] -pub type R = crate::R; -#[doc = "Writer for register INTE"] -pub type W = crate::W; -#[doc = "Register INTE `reset()`'s with value 0"] -impl crate::ResetValue for super::INTE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `INTE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Period match while counting up enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PME`"] -pub type PME_R = crate::R; +#[doc = "Field `PME` reader - Period match while counting up enable"] +pub struct PME_R(crate::FieldReader); impl PME_R { + pub(crate) fn new(bits: bool) -> Self { + PME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PME_A { @@ -38,15 +65,22 @@ impl PME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PME_A::VALUE1 + **self == PME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PME_A::VALUE2 + **self == PME_A::VALUE2 } } -#[doc = "Write proxy for field `PME`"] +impl core::ops::Deref for PME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PME` writer - Period match while counting up enable"] pub struct PME_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PME_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Period Match interrupt is disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OME`"] -pub type OME_R = crate::R; +#[doc = "Field `OME` reader - One match while counting down enable"] +pub struct OME_R(crate::FieldReader); impl OME_R { + pub(crate) fn new(bits: bool) -> Self { + OME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OME_A { @@ -113,15 +148,22 @@ impl OME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OME_A::VALUE1 + **self == OME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OME_A::VALUE2 + **self == OME_A::VALUE2 + } +} +impl core::ops::Deref for OME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OME`"] +#[doc = "Field `OME` writer - One match while counting down enable"] pub struct OME_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> OME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OME_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "One Match interrupt is disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> OME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMUE`"] -pub type CMUE_R = crate::R; +#[doc = "Field `CMUE` reader - Compare match while counting up enable"] +pub struct CMUE_R(crate::FieldReader); impl CMUE_R { + pub(crate) fn new(bits: bool) -> Self { + CMUE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMUE_A { @@ -188,15 +231,22 @@ impl CMUE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMUE_A::VALUE1 + **self == CMUE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMUE_A::VALUE2 + **self == CMUE_A::VALUE2 } } -#[doc = "Write proxy for field `CMUE`"] +impl core::ops::Deref for CMUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMUE` writer - Compare match while counting up enable"] pub struct CMUE_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CMUE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMUE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CMUE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMDE`"] -pub type CMDE_R = crate::R; +#[doc = "Field `CMDE` reader - Compare match while counting down enable"] +pub struct CMDE_R(crate::FieldReader); impl CMDE_R { + pub(crate) fn new(bits: bool) -> Self { + CMDE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMDE_A { @@ -263,15 +314,22 @@ impl CMDE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMDE_A::VALUE1 + **self == CMDE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMDE_A::VALUE2 + **self == CMDE_A::VALUE2 + } +} +impl core::ops::Deref for CMDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CMDE`"] +#[doc = "Field `CMDE` writer - Compare match while counting down enable"] pub struct CMDE_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> CMDE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMDE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> CMDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E0AE`"] -pub type E0AE_R = crate::R; +#[doc = "Field `E0AE` reader - Event 0 interrupt enable"] +pub struct E0AE_R(crate::FieldReader); impl E0AE_R { + pub(crate) fn new(bits: bool) -> Self { + E0AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0AE_A { @@ -338,15 +397,22 @@ impl E0AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0AE_A::VALUE1 + **self == E0AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0AE_A::VALUE2 + **self == E0AE_A::VALUE2 } } -#[doc = "Write proxy for field `E0AE`"] +impl core::ops::Deref for E0AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E0AE` writer - Event 0 interrupt enable"] pub struct E0AE_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> E0AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E0AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> E0AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E1AE`"] -pub type E1AE_R = crate::R; +#[doc = "Field `E1AE` reader - Event 1 interrupt enable"] +pub struct E1AE_R(crate::FieldReader); impl E1AE_R { + pub(crate) fn new(bits: bool) -> Self { + E1AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1AE_A { @@ -413,15 +480,22 @@ impl E1AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1AE_A::VALUE1 + **self == E1AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1AE_A::VALUE2 + **self == E1AE_A::VALUE2 } } -#[doc = "Write proxy for field `E1AE`"] +impl core::ops::Deref for E1AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E1AE` writer - Event 1 interrupt enable"] pub struct E1AE_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> E1AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E1AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> E1AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E2AE`"] -pub type E2AE_R = crate::R; +#[doc = "Field `E2AE` reader - Event 2 interrupt enable"] +pub struct E2AE_R(crate::FieldReader); impl E2AE_R { + pub(crate) fn new(bits: bool) -> Self { + E2AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2AE_A { @@ -488,15 +563,22 @@ impl E2AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2AE_A::VALUE1 + **self == E2AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2AE_A::VALUE2 + **self == E2AE_A::VALUE2 + } +} +impl core::ops::Deref for E2AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E2AE`"] +#[doc = "Field `E2AE` writer - Event 2 interrupt enable"] pub struct E2AE_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> E2AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E2AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> E2AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn e2ae(&mut self) -> E2AE_W { E2AE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Enable Control\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 [inte](index.html) module"] +pub struct INTE_SPEC; +impl crate::RegisterSpec for INTE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inte::R](R) reader structure"] +impl crate::Readable for INTE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inte::W](W) writer structure"] +impl crate::Writable for INTE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTE to value 0"] +impl crate::Resettable for INTE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/ints.rs b/src/ccu40_cc40/ints.rs index ced96711..9d3bf0fc 100644 --- a/src/ccu40_cc40/ints.rs +++ b/src/ccu40_cc40/ints.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register INTS"] -pub type R = crate::R; +#[doc = "Register `INTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Period Match while Counting Up\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PMUS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PMUS`"] -pub type PMUS_R = crate::R; +#[doc = "Field `PMUS` reader - Period Match while Counting Up"] +pub struct PMUS_R(crate::FieldReader); impl PMUS_R { + pub(crate) fn new(bits: bool) -> Self { + PMUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PMUS_A { @@ -28,12 +44,19 @@ impl PMUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PMUS_A::VALUE1 + **self == PMUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PMUS_A::VALUE2 + **self == PMUS_A::VALUE2 + } +} +impl core::ops::Deref for PMUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "One Match while Counting Down\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OMDS`"] -pub type OMDS_R = crate::R; +#[doc = "Field `OMDS` reader - One Match while Counting Down"] +pub struct OMDS_R(crate::FieldReader); impl OMDS_R { + pub(crate) fn new(bits: bool) -> Self { + OMDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OMDS_A { @@ -64,12 +90,19 @@ impl OMDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OMDS_A::VALUE1 + **self == OMDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OMDS_A::VALUE2 + **self == OMDS_A::VALUE2 + } +} +impl core::ops::Deref for OMDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Compare Match while Counting Up\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMUS`"] -pub type CMUS_R = crate::R; +#[doc = "Field `CMUS` reader - Compare Match while Counting Up"] +pub struct CMUS_R(crate::FieldReader); impl CMUS_R { + pub(crate) fn new(bits: bool) -> Self { + CMUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMUS_A { @@ -100,12 +136,19 @@ impl CMUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMUS_A::VALUE1 + **self == CMUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMUS_A::VALUE2 + **self == CMUS_A::VALUE2 + } +} +impl core::ops::Deref for CMUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Compare Match while Counting Down\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMDS`"] -pub type CMDS_R = crate::R; +#[doc = "Field `CMDS` reader - Compare Match while Counting Down"] +pub struct CMDS_R(crate::FieldReader); impl CMDS_R { + pub(crate) fn new(bits: bool) -> Self { + CMDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMDS_A { @@ -136,12 +182,19 @@ impl CMDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMDS_A::VALUE1 + **self == CMDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMDS_A::VALUE2 + **self == CMDS_A::VALUE2 + } +} +impl core::ops::Deref for CMDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 0 Detection Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E0AS`"] -pub type E0AS_R = crate::R; +#[doc = "Field `E0AS` reader - Event 0 Detection Status"] +pub struct E0AS_R(crate::FieldReader); impl E0AS_R { + pub(crate) fn new(bits: bool) -> Self { + E0AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0AS_A { @@ -172,12 +228,19 @@ impl E0AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0AS_A::VALUE1 + **self == E0AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0AS_A::VALUE2 + **self == E0AS_A::VALUE2 + } +} +impl core::ops::Deref for E0AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 1 Detection Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E1AS`"] -pub type E1AS_R = crate::R; +#[doc = "Field `E1AS` reader - Event 1 Detection Status"] +pub struct E1AS_R(crate::FieldReader); impl E1AS_R { + pub(crate) fn new(bits: bool) -> Self { + E1AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1AS_A { @@ -208,12 +274,19 @@ impl E1AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1AS_A::VALUE1 + **self == E1AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1AS_A::VALUE2 + **self == E1AS_A::VALUE2 + } +} +impl core::ops::Deref for E1AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 2 Detection Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E2AS`"] -pub type E2AS_R = crate::R; +#[doc = "Field `E2AS` reader - Event 2 Detection Status"] +pub struct E2AS_R(crate::FieldReader); impl E2AS_R { + pub(crate) fn new(bits: bool) -> Self { + E2AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2AS_A { @@ -244,16 +320,35 @@ impl E2AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2AS_A::VALUE1 + **self == E2AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2AS_A::VALUE2 + **self == E2AS_A::VALUE2 + } +} +impl core::ops::Deref for E2AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRPF` reader - Trap Flag Status"] +pub struct TRPF_R(crate::FieldReader); +impl TRPF_R { + pub(crate) fn new(bits: bool) -> Self { + TRPF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRPF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `TRPF`"] -pub type TRPF_R = crate::R; impl R { #[doc = "Bit 0 - Period Match while Counting Up"] #[inline(always)] @@ -296,3 +391,19 @@ impl R { TRPF_R::new(((self.bits >> 11) & 0x01) != 0) } } +#[doc = "Interrupt Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ints](index.html) module"] +pub struct INTS_SPEC; +impl crate::RegisterSpec for INTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ints::R](R) reader structure"] +impl crate::Readable for INTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets INTS to value 0"] +impl crate::Resettable for INTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/pr.rs b/src/ccu40_cc40/pr.rs index 2cae0225..4f16f0c0 100644 --- a/src/ccu40_cc40/pr.rs +++ b/src/ccu40_cc40/pr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register PR"] -pub type R = crate::R; -#[doc = "Reader of field `PR`"] -pub type PR_R = crate::R; +#[doc = "Register `PR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `PR` reader - Period Register"] +pub struct PR_R(crate::FieldReader); +impl PR_R { + pub(crate) fn new(bits: u16) -> Self { + PR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { PR_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Timer Period Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pr](index.html) module"] +pub struct PR_SPEC; +impl crate::RegisterSpec for PR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pr::R](R) reader structure"] +impl crate::Readable for PR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PR to value 0"] +impl crate::Resettable for PR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/prs.rs b/src/ccu40_cc40/prs.rs index 3a02f651..7c64b584 100644 --- a/src/ccu40_cc40/prs.rs +++ b/src/ccu40_cc40/prs.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PRS"] -pub type R = crate::R; -#[doc = "Writer for register PRS"] -pub type W = crate::W; -#[doc = "Register PRS `reset()`'s with value 0"] -impl crate::ResetValue for super::PRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PRS`"] -pub type PRS_R = crate::R; -#[doc = "Write proxy for field `PRS`"] +#[doc = "Field `PRS` reader - Period Register"] +pub struct PRS_R(crate::FieldReader); +impl PRS_R { + pub(crate) fn new(bits: u16) -> Self { + PRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRS` writer - Period Register"] pub struct PRS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn prs(&mut self) -> PRS_W { PRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer Shadow Period Value\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 [prs](index.html) module"] +pub struct PRS_SPEC; +impl crate::RegisterSpec for PRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prs::R](R) reader structure"] +impl crate::Readable for PRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prs::W](W) writer structure"] +impl crate::Writable for PRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRS to value 0"] +impl crate::Resettable for PRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/psc.rs b/src/ccu40_cc40/psc.rs index 060226df..9b8f1d8b 100644 --- a/src/ccu40_cc40/psc.rs +++ b/src/ccu40_cc40/psc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PSC"] -pub type R = crate::R; -#[doc = "Writer for register PSC"] -pub type W = crate::W; -#[doc = "Register PSC `reset()`'s with value 0"] -impl crate::ResetValue for super::PSC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PSIV`"] -pub type PSIV_R = crate::R; -#[doc = "Write proxy for field `PSIV`"] +#[doc = "Field `PSIV` reader - Prescaler Initial Value"] +pub struct PSIV_R(crate::FieldReader); +impl PSIV_R { + pub(crate) fn new(bits: u8) -> Self { + PSIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PSIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSIV` writer - Prescaler Initial Value"] pub struct PSIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PSIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn psiv(&mut self) -> PSIV_W { PSIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prescaler Control\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 [psc](index.html) module"] +pub struct PSC_SPEC; +impl crate::RegisterSpec for PSC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psc::R](R) reader structure"] +impl crate::Readable for PSC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psc::W](W) writer structure"] +impl crate::Writable for PSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSC to value 0"] +impl crate::Resettable for PSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/psl.rs b/src/ccu40_cc40/psl.rs index 3e5fd7ff..67adccfb 100644 --- a/src/ccu40_cc40/psl.rs +++ b/src/ccu40_cc40/psl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSL"] -pub type R = crate::R; -#[doc = "Writer for register PSL"] -pub type W = crate::W; -#[doc = "Register PSL `reset()`'s with value 0"] -impl crate::ResetValue for super::PSL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Output Passive Level\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL`"] -pub type PSL_R = crate::R; +#[doc = "Field `PSL` reader - Output Passive Level"] +pub struct PSL_R(crate::FieldReader); impl PSL_R { + pub(crate) fn new(bits: bool) -> Self { + PSL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL_A { @@ -38,15 +65,22 @@ impl PSL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL_A::VALUE1 + **self == PSL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL_A::VALUE2 + **self == PSL_A::VALUE2 + } +} +impl core::ops::Deref for PSL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSL`"] +#[doc = "Field `PSL` writer - Output Passive Level"] pub struct PSL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PSL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Passive Level is LOW"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PSL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn psl(&mut self) -> PSL_W { PSL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Passive Level Config\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 [psl](index.html) module"] +pub struct PSL_SPEC; +impl crate::RegisterSpec for PSL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psl::R](R) reader structure"] +impl crate::Readable for PSL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psl::W](W) writer structure"] +impl crate::Writable for PSL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSL to value 0"] +impl crate::Resettable for PSL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/srs.rs b/src/ccu40_cc40/srs.rs index 8a27c112..bdb8906b 100644 --- a/src/ccu40_cc40/srs.rs +++ b/src/ccu40_cc40/srs.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SRS"] -pub type R = crate::R; -#[doc = "Writer for register SRS"] -pub type W = crate::W; -#[doc = "Register SRS `reset()`'s with value 0"] -impl crate::ResetValue for super::SRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Period/One match Service request selector\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `POSR`"] -pub type POSR_R = crate::R; +#[doc = "Field `POSR` reader - Period/One match Service request selector"] +pub struct POSR_R(crate::FieldReader); impl POSR_R { + pub(crate) fn new(bits: u8) -> Self { + POSR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POSR_A { @@ -46,25 +73,32 @@ impl POSR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POSR_A::VALUE1 + **self == POSR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POSR_A::VALUE2 + **self == POSR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == POSR_A::VALUE3 + **self == POSR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == POSR_A::VALUE4 + **self == POSR_A::VALUE4 + } +} +impl core::ops::Deref for POSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `POSR`"] +#[doc = "Field `POSR` writer - Period/One match Service request selector"] pub struct POSR_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> POSR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC4ySR0"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> POSR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CMSR`"] -pub type CMSR_R = crate::R; +#[doc = "Field `CMSR` reader - Compare match Service request selector"] +pub struct CMSR_R(crate::FieldReader); impl CMSR_R { + pub(crate) fn new(bits: u8) -> Self { + CMSR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMSR_A { @@ -139,25 +174,32 @@ impl CMSR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMSR_A::VALUE1 + **self == CMSR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMSR_A::VALUE2 + **self == CMSR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CMSR_A::VALUE3 + **self == CMSR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CMSR_A::VALUE4 + **self == CMSR_A::VALUE4 + } +} +impl core::ops::Deref for CMSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CMSR`"] +#[doc = "Field `CMSR` writer - Compare match Service request selector"] pub struct CMSR_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> CMSR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMSR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC4ySR0"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> CMSR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E0SR`"] -pub type E0SR_R = crate::R; +#[doc = "Field `E0SR` reader - Event 0 Service request selector"] +pub struct E0SR_R(crate::FieldReader); impl E0SR_R { + pub(crate) fn new(bits: u8) -> Self { + E0SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0SR_A { @@ -232,25 +275,32 @@ impl E0SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0SR_A::VALUE1 + **self == E0SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0SR_A::VALUE2 + **self == E0SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E0SR_A::VALUE3 + **self == E0SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E0SR_A::VALUE4 + **self == E0SR_A::VALUE4 + } +} +impl core::ops::Deref for E0SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E0SR`"] +#[doc = "Field `E0SR` writer - Event 0 Service request selector"] pub struct E0SR_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> E0SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E0SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC4ySR0"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> E0SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E1SR`"] -pub type E1SR_R = crate::R; +#[doc = "Field `E1SR` reader - Event 1 Service request selector"] +pub struct E1SR_R(crate::FieldReader); impl E1SR_R { + pub(crate) fn new(bits: u8) -> Self { + E1SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1SR_A { @@ -325,25 +376,32 @@ impl E1SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1SR_A::VALUE1 + **self == E1SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1SR_A::VALUE2 + **self == E1SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E1SR_A::VALUE3 + **self == E1SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E1SR_A::VALUE4 + **self == E1SR_A::VALUE4 } } -#[doc = "Write proxy for field `E1SR`"] +impl core::ops::Deref for E1SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E1SR` writer - Event 1 Service request selector"] pub struct E1SR_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> E1SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E1SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC4ySR0"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> E1SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E2SR`"] -pub type E2SR_R = crate::R; +#[doc = "Field `E2SR` reader - Event 2 Service request selector"] +pub struct E2SR_R(crate::FieldReader); impl E2SR_R { + pub(crate) fn new(bits: u8) -> Self { + E2SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2SR_A { @@ -418,25 +477,32 @@ impl E2SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2SR_A::VALUE1 + **self == E2SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2SR_A::VALUE2 + **self == E2SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E2SR_A::VALUE3 + **self == E2SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E2SR_A::VALUE4 + **self == E2SR_A::VALUE4 + } +} +impl core::ops::Deref for E2SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E2SR`"] +#[doc = "Field `E2SR` writer - Event 2 Service request selector"] pub struct E2SR_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> E2SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E2SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC4ySR0"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> E2SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -528,4 +592,30 @@ impl W { pub fn e2sr(&mut self) -> E2SR_W { E2SR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Selector\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 [srs](index.html) module"] +pub struct SRS_SPEC; +impl crate::RegisterSpec for SRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srs::R](R) reader structure"] +impl crate::Readable for SRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [srs::W](W) writer structure"] +impl crate::Writable for SRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRS to value 0"] +impl crate::Resettable for SRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/swr.rs b/src/ccu40_cc40/swr.rs index a008e863..2f2059dc 100644 --- a/src/ccu40_cc40/swr.rs +++ b/src/ccu40_cc40/swr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWR"] -pub type W = crate::W; -#[doc = "Register SWR `reset()`'s with value 0"] -impl crate::ResetValue for super::SWR { - type Type = u32; +#[doc = "Register `SWR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `RPM`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RPM` writer - Period match while counting up clear"] pub struct RPM_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> RPM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `ROM`"] +#[doc = "Field `ROM` writer - One match while counting down clear"] pub struct ROM_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> ROM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `RCMU`"] +#[doc = "Field `RCMU` writer - Compare match while counting up clear"] pub struct RCMU_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> RCMU_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `RCMD`"] +#[doc = "Field `RCMD` writer - Compare match while counting down clear"] pub struct RCMD_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> RCMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `RE0A`"] +#[doc = "Field `RE0A` writer - Event 0 detection clear"] pub struct RE0A_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> RE0A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `RE1A`"] +#[doc = "Field `RE1A` writer - Event 1 detection clear"] pub struct RE1A_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> RE1A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `RE2A`"] +#[doc = "Field `RE2A` writer - Event 2 detection clear"] pub struct RE2A_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> RE2A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `RTRPF`"] +#[doc = "Field `RTRPF` writer - Trap Flag status clear"] pub struct RTRPF_W<'a> { w: &'a mut W, } @@ -180,7 +191,7 @@ impl<'a> RTRPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -225,4 +236,26 @@ impl W { pub fn rtrpf(&mut self) -> RTRPF_W { RTRPF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Status Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swr](index.html) module"] +pub struct SWR_SPEC; +impl crate::RegisterSpec for SWR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [swr::W](W) writer structure"] +impl crate::Writable for SWR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWR to value 0"] +impl crate::Resettable for SWR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/sws.rs b/src/ccu40_cc40/sws.rs index f98faada..4e45805f 100644 --- a/src/ccu40_cc40/sws.rs +++ b/src/ccu40_cc40/sws.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWS"] -pub type W = crate::W; -#[doc = "Register SWS `reset()`'s with value 0"] -impl crate::ResetValue for super::SWS { - type Type = u32; +#[doc = "Register `SWS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SPM`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SPM` writer - Period match while counting up set"] pub struct SPM_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SPM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SOM`"] +#[doc = "Field `SOM` writer - One match while counting down set"] pub struct SOM_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SOM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SCMU`"] +#[doc = "Field `SCMU` writer - Compare match while counting up set"] pub struct SCMU_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SCMU_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SCMD`"] +#[doc = "Field `SCMD` writer - Compare match while counting down set"] pub struct SCMD_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SCMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SE0A`"] +#[doc = "Field `SE0A` writer - Event 0 detection set"] pub struct SE0A_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SE0A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SE1A`"] +#[doc = "Field `SE1A` writer - Event 1 detection set"] pub struct SE1A_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SE1A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `SE2A`"] +#[doc = "Field `SE2A` writer - Event 2 detection set"] pub struct SE2A_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> SE2A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `STRPF`"] +#[doc = "Field `STRPF` writer - Trap Flag status set"] pub struct STRPF_W<'a> { w: &'a mut W, } @@ -180,7 +191,7 @@ impl<'a> STRPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -225,4 +236,26 @@ impl W { pub fn strpf(&mut self) -> STRPF_W { STRPF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Status Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](index.html) module"] +pub struct SWS_SPEC; +impl crate::RegisterSpec for SWS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +impl crate::Writable for SWS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWS to value 0"] +impl crate::Resettable for SWS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/tc.rs b/src/ccu40_cc40/tc.rs index f009a710..61cd8797 100644 --- a/src/ccu40_cc40/tc.rs +++ b/src/ccu40_cc40/tc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TC"] -pub type R = crate::R; -#[doc = "Writer for register TC"] -pub type W = crate::W; -#[doc = "Register TC `reset()`'s with value 0"] -impl crate::ResetValue for super::TC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Timer Counting Mode\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TCM`"] -pub type TCM_R = crate::R; +#[doc = "Field `TCM` reader - Timer Counting Mode"] +pub struct TCM_R(crate::FieldReader); impl TCM_R { + pub(crate) fn new(bits: bool) -> Self { + TCM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TCM_A { @@ -38,15 +65,22 @@ impl TCM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TCM_A::VALUE1 + **self == TCM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TCM_A::VALUE2 + **self == TCM_A::VALUE2 } } -#[doc = "Write proxy for field `TCM`"] +impl core::ops::Deref for TCM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCM` writer - Timer Counting Mode"] pub struct TCM_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> TCM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TCM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Edge aligned mode"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> TCM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSSM`"] -pub type TSSM_R = crate::R; +#[doc = "Field `TSSM` reader - Timer Single Shot Mode"] +pub struct TSSM_R(crate::FieldReader); impl TSSM_R { + pub(crate) fn new(bits: bool) -> Self { + TSSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSSM_A { @@ -113,15 +148,22 @@ impl TSSM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSSM_A::VALUE1 + **self == TSSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSSM_A::VALUE2 + **self == TSSM_A::VALUE2 + } +} +impl core::ops::Deref for TSSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSSM`"] +#[doc = "Field `TSSM` writer - Timer Single Shot Mode"] pub struct TSSM_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> TSSM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSSM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Single shot mode is disabled"] #[inline(always)] @@ -156,13 +196,25 @@ impl<'a> TSSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CLST`"] -pub type CLST_R = crate::R; -#[doc = "Write proxy for field `CLST`"] +#[doc = "Field `CLST` reader - Shadow Transfer on Clear"] +pub struct CLST_R(crate::FieldReader); +impl CLST_R { + pub(crate) fn new(bits: bool) -> Self { + CLST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CLST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CLST` writer - Shadow Transfer on Clear"] pub struct CLST_W<'a> { w: &'a mut W, } @@ -180,7 +232,7 @@ impl<'a> CLST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -198,9 +250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMOD`"] -pub type CMOD_R = crate::R; +#[doc = "Field `CMOD` reader - Capture Compare Mode"] +pub struct CMOD_R(crate::FieldReader); impl CMOD_R { + pub(crate) fn new(bits: bool) -> Self { + CMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMOD_A { @@ -212,12 +267,19 @@ impl CMOD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMOD_A::VALUE1 + **self == CMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMOD_A::VALUE2 + **self == CMOD_A::VALUE2 + } +} +impl core::ops::Deref for CMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Extended Capture Mode\n\nValue on reset: 0"] @@ -234,9 +296,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ECM`"] -pub type ECM_R = crate::R; +#[doc = "Field `ECM` reader - Extended Capture Mode"] +pub struct ECM_R(crate::FieldReader); impl ECM_R { + pub(crate) fn new(bits: bool) -> Self { + ECM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ECM_A { @@ -248,15 +313,22 @@ impl ECM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ECM_A::VALUE1 + **self == ECM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ECM_A::VALUE2 + **self == ECM_A::VALUE2 + } +} +impl core::ops::Deref for ECM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ECM`"] +#[doc = "Field `ECM` writer - Extended Capture Mode"] pub struct ECM_W<'a> { w: &'a mut W, } @@ -264,9 +336,7 @@ impl<'a> ECM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ECM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] @@ -291,7 +361,7 @@ impl<'a> ECM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -314,9 +384,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAPC`"] -pub type CAPC_R = crate::R; +#[doc = "Field `CAPC` reader - Clear on Capture Control"] +pub struct CAPC_R(crate::FieldReader); impl CAPC_R { + pub(crate) fn new(bits: u8) -> Self { + CAPC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAPC_A { @@ -331,25 +404,32 @@ impl CAPC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAPC_A::VALUE1 + **self == CAPC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAPC_A::VALUE2 + **self == CAPC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAPC_A::VALUE3 + **self == CAPC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAPC_A::VALUE4 + **self == CAPC_A::VALUE4 } } -#[doc = "Write proxy for field `CAPC`"] +impl core::ops::Deref for CAPC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAPC` writer - Clear on Capture Control"] pub struct CAPC_W<'a> { w: &'a mut W, } @@ -357,9 +437,7 @@ impl<'a> CAPC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAPC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Timer is never cleared on a capture event"] #[inline(always)] @@ -384,7 +462,7 @@ impl<'a> CAPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5); + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); self.w } } @@ -405,37 +483,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENDM`"] -pub type ENDM_R = crate::R; +#[doc = "Field `ENDM` reader - Extended Stop Function Control"] +pub struct ENDM_R(crate::FieldReader); impl ENDM_R { + pub(crate) fn new(bits: u8) -> Self { + ENDM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ENDM_A::VALUE1), - 1 => Val(ENDM_A::VALUE2), - 2 => Val(ENDM_A::VALUE3), - i => Res(i), + 0 => Some(ENDM_A::VALUE1), + 1 => Some(ENDM_A::VALUE2), + 2 => Some(ENDM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDM_A::VALUE1 + **self == ENDM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDM_A::VALUE2 + **self == ENDM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENDM_A::VALUE3 + **self == ENDM_A::VALUE3 } } -#[doc = "Write proxy for field `ENDM`"] +impl core::ops::Deref for ENDM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDM` writer - Extended Stop Function Control"] pub struct ENDM_W<'a> { w: &'a mut W, } @@ -463,7 +550,7 @@ impl<'a> ENDM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -481,9 +568,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STRM`"] -pub type STRM_R = crate::R; +#[doc = "Field `STRM` reader - Extended Start Function Control"] +pub struct STRM_R(crate::FieldReader); impl STRM_R { + pub(crate) fn new(bits: bool) -> Self { + STRM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRM_A { @@ -495,15 +585,22 @@ impl STRM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRM_A::VALUE1 + **self == STRM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRM_A::VALUE2 + **self == STRM_A::VALUE2 + } +} +impl core::ops::Deref for STRM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STRM`"] +#[doc = "Field `STRM` writer - Extended Start Function Control"] pub struct STRM_W<'a> { w: &'a mut W, } @@ -511,9 +608,7 @@ impl<'a> STRM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STRM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Sets run bit only (default start)"] #[inline(always)] @@ -538,7 +633,7 @@ impl<'a> STRM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -556,9 +651,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCE`"] -pub type SCE_R = crate::R; +#[doc = "Field `SCE` reader - Equal Capture Event enable"] +pub struct SCE_R(crate::FieldReader); impl SCE_R { + pub(crate) fn new(bits: bool) -> Self { + SCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCE_A { @@ -570,15 +668,22 @@ impl SCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCE_A::VALUE1 + **self == SCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCE_A::VALUE2 + **self == SCE_A::VALUE2 } } -#[doc = "Write proxy for field `SCE`"] +impl core::ops::Deref for SCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCE` writer - Equal Capture Event enable"] pub struct SCE_W<'a> { w: &'a mut W, } @@ -586,9 +691,7 @@ impl<'a> SCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Capture into CC4yC0VThis register contains the values associated with the Capture 0 field./CC4yC1VThis register contains the values associated with the Capture 1 field. registers control by CCycapt0 and capture into CC4yC3VThis register contains the values associated with the Capture 3 field./CC4yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"] #[inline(always)] @@ -613,7 +716,7 @@ impl<'a> SCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -631,9 +734,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCS`"] -pub type CCS_R = crate::R; +#[doc = "Field `CCS` reader - Continuous Capture Enable"] +pub struct CCS_R(crate::FieldReader); impl CCS_R { + pub(crate) fn new(bits: bool) -> Self { + CCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCS_A { @@ -645,15 +751,22 @@ impl CCS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCS_A::VALUE1 + **self == CCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCS_A::VALUE2 + **self == CCS_A::VALUE2 } } -#[doc = "Write proxy for field `CCS`"] +impl core::ops::Deref for CCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCS` writer - Continuous Capture Enable"] pub struct CCS_W<'a> { w: &'a mut W, } @@ -661,9 +774,7 @@ impl<'a> CCS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] @@ -688,7 +799,7 @@ impl<'a> CCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -711,9 +822,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DITHE`"] -pub type DITHE_R = crate::R; +#[doc = "Field `DITHE` reader - Dither Enable"] +pub struct DITHE_R(crate::FieldReader); impl DITHE_R { + pub(crate) fn new(bits: u8) -> Self { + DITHE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DITHE_A { @@ -728,25 +842,32 @@ impl DITHE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DITHE_A::VALUE1 + **self == DITHE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DITHE_A::VALUE2 + **self == DITHE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DITHE_A::VALUE3 + **self == DITHE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DITHE_A::VALUE4 + **self == DITHE_A::VALUE4 + } +} +impl core::ops::Deref for DITHE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DITHE`"] +#[doc = "Field `DITHE` writer - Dither Enable"] pub struct DITHE_W<'a> { w: &'a mut W, } @@ -754,9 +875,7 @@ impl<'a> DITHE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DITHE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Dither is disabled"] #[inline(always)] @@ -781,7 +900,7 @@ impl<'a> DITHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -799,9 +918,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIM`"] -pub type DIM_R = crate::R; +#[doc = "Field `DIM` reader - Dither input selector"] +pub struct DIM_R(crate::FieldReader); impl DIM_R { + pub(crate) fn new(bits: bool) -> Self { + DIM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIM_A { @@ -813,15 +935,22 @@ impl DIM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIM_A::VALUE1 + **self == DIM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIM_A::VALUE2 + **self == DIM_A::VALUE2 } } -#[doc = "Write proxy for field `DIM`"] +impl core::ops::Deref for DIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIM` writer - Dither input selector"] pub struct DIM_W<'a> { w: &'a mut W, } @@ -829,9 +958,7 @@ impl<'a> DIM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Slice is using its own dither unit"] #[inline(always)] @@ -856,7 +983,7 @@ impl<'a> DIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -874,9 +1001,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FPE`"] -pub type FPE_R = crate::R; +#[doc = "Field `FPE` reader - Floating Prescaler enable"] +pub struct FPE_R(crate::FieldReader); impl FPE_R { + pub(crate) fn new(bits: bool) -> Self { + FPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FPE_A { @@ -888,15 +1018,22 @@ impl FPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FPE_A::VALUE1 + **self == FPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FPE_A::VALUE2 + **self == FPE_A::VALUE2 } } -#[doc = "Write proxy for field `FPE`"] +impl core::ops::Deref for FPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPE` writer - Floating Prescaler enable"] pub struct FPE_W<'a> { w: &'a mut W, } @@ -904,9 +1041,7 @@ impl<'a> FPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FPE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Floating prescaler mode is disabled"] #[inline(always)] @@ -931,7 +1066,7 @@ impl<'a> FPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -949,9 +1084,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRAPE`"] -pub type TRAPE_R = crate::R; +#[doc = "Field `TRAPE` reader - TRAP enable"] +pub struct TRAPE_R(crate::FieldReader); impl TRAPE_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRAPE_A { @@ -963,15 +1101,22 @@ impl TRAPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRAPE_A::VALUE1 + **self == TRAPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRAPE_A::VALUE2 + **self == TRAPE_A::VALUE2 + } +} +impl core::ops::Deref for TRAPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRAPE`"] +#[doc = "Field `TRAPE` writer - TRAP enable"] pub struct TRAPE_W<'a> { w: &'a mut W, } @@ -979,9 +1124,7 @@ impl<'a> TRAPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRAPE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TRAP functionality has no effect on the output"] #[inline(always)] @@ -1006,7 +1149,7 @@ impl<'a> TRAPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -1024,9 +1167,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRPSE`"] -pub type TRPSE_R = crate::R; +#[doc = "Field `TRPSE` reader - TRAP Synchronization Enable"] +pub struct TRPSE_R(crate::FieldReader); impl TRPSE_R { + pub(crate) fn new(bits: bool) -> Self { + TRPSE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRPSE_A { @@ -1038,15 +1184,22 @@ impl TRPSE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRPSE_A::VALUE1 + **self == TRPSE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRPSE_A::VALUE2 + **self == TRPSE_A::VALUE2 } } -#[doc = "Write proxy for field `TRPSE`"] +impl core::ops::Deref for TRPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRPSE` writer - TRAP Synchronization Enable"] pub struct TRPSE_W<'a> { w: &'a mut W, } @@ -1054,9 +1207,7 @@ impl<'a> TRPSE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRPSE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] @@ -1081,7 +1232,7 @@ impl<'a> TRPSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -1099,9 +1250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRPSW`"] -pub type TRPSW_R = crate::R; +#[doc = "Field `TRPSW` reader - TRAP State Clear Control"] +pub struct TRPSW_R(crate::FieldReader); impl TRPSW_R { + pub(crate) fn new(bits: bool) -> Self { + TRPSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRPSW_A { @@ -1113,15 +1267,22 @@ impl TRPSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRPSW_A::VALUE1 + **self == TRPSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRPSW_A::VALUE2 + **self == TRPSW_A::VALUE2 + } +} +impl core::ops::Deref for TRPSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRPSW`"] +#[doc = "Field `TRPSW` writer - TRAP State Clear Control"] pub struct TRPSW_W<'a> { w: &'a mut W, } @@ -1129,9 +1290,7 @@ impl<'a> TRPSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRPSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present"] #[inline(always)] @@ -1156,7 +1315,7 @@ impl<'a> TRPSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -1174,9 +1333,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMS`"] -pub type EMS_R = crate::R; +#[doc = "Field `EMS` reader - External Modulation Synchronization"] +pub struct EMS_R(crate::FieldReader); impl EMS_R { + pub(crate) fn new(bits: bool) -> Self { + EMS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMS_A { @@ -1188,15 +1350,22 @@ impl EMS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMS_A::VALUE1 + **self == EMS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMS_A::VALUE2 + **self == EMS_A::VALUE2 } } -#[doc = "Write proxy for field `EMS`"] +impl core::ops::Deref for EMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMS` writer - External Modulation Synchronization"] pub struct EMS_W<'a> { w: &'a mut W, } @@ -1204,9 +1373,7 @@ impl<'a> EMS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] @@ -1231,7 +1398,7 @@ impl<'a> EMS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -1249,9 +1416,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMT`"] -pub type EMT_R = crate::R; +#[doc = "Field `EMT` reader - External Modulation Type"] +pub struct EMT_R(crate::FieldReader); impl EMT_R { + pub(crate) fn new(bits: bool) -> Self { + EMT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMT_A { @@ -1263,15 +1433,22 @@ impl EMT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMT_A::VALUE1 + **self == EMT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMT_A::VALUE2 + **self == EMT_A::VALUE2 } } -#[doc = "Write proxy for field `EMT`"] +impl core::ops::Deref for EMT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMT` writer - External Modulation Type"] pub struct EMT_W<'a> { w: &'a mut W, } @@ -1279,9 +1456,7 @@ impl<'a> EMT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External Modulation functionality is clearing the CC4yST bit."] #[inline(always)] @@ -1306,7 +1481,7 @@ impl<'a> EMT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1324,9 +1499,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCME`"] -pub type MCME_R = crate::R; +#[doc = "Field `MCME` reader - Multi Channel Mode Enable"] +pub struct MCME_R(crate::FieldReader); impl MCME_R { + pub(crate) fn new(bits: bool) -> Self { + MCME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCME_A { @@ -1338,15 +1516,22 @@ impl MCME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCME_A::VALUE1 + **self == MCME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCME_A::VALUE2 + **self == MCME_A::VALUE2 + } +} +impl core::ops::Deref for MCME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MCME`"] +#[doc = "Field `MCME` writer - Multi Channel Mode Enable"] pub struct MCME_W<'a> { w: &'a mut W, } @@ -1354,9 +1539,7 @@ impl<'a> MCME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCME_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Multi Channel Mode is disabled"] #[inline(always)] @@ -1381,7 +1564,7 @@ impl<'a> MCME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1573,4 +1756,30 @@ impl W { pub fn mcme(&mut self) -> MCME_W { MCME_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Control\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 [tc](index.html) module"] +pub struct TC_SPEC; +impl crate::RegisterSpec for TC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tc::R](R) reader structure"] +impl crate::Readable for TC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tc::W](W) writer structure"] +impl crate::Writable for TC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TC to value 0"] +impl crate::Resettable for TC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/tcclr.rs b/src/ccu40_cc40/tcclr.rs index 317c10bf..9afd239e 100644 --- a/src/ccu40_cc40/tcclr.rs +++ b/src/ccu40_cc40/tcclr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register TCCLR"] -pub type W = crate::W; -#[doc = "Register TCCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::TCCLR { - type Type = u32; +#[doc = "Register `TCCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `TRBC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TRBC` writer - Timer Run Bit Clear"] pub struct TRBC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> TRBC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `TCC`"] +#[doc = "Field `TCC` writer - Timer Clear"] pub struct TCC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> TCC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `DITC`"] +#[doc = "Field `DITC` writer - Dither Counter Clear"] pub struct DITC_W<'a> { w: &'a mut W, } @@ -70,7 +81,7 @@ impl<'a> DITC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -90,4 +101,26 @@ impl W { pub fn ditc(&mut self) -> DITC_W { DITC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcclr](index.html) module"] +pub struct TCCLR_SPEC; +impl crate::RegisterSpec for TCCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tcclr::W](W) writer structure"] +impl crate::Writable for TCCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TCCLR to value 0"] +impl crate::Resettable for TCCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/tcset.rs b/src/ccu40_cc40/tcset.rs index c5f5ccb6..ad135582 100644 --- a/src/ccu40_cc40/tcset.rs +++ b/src/ccu40_cc40/tcset.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register TCSET"] -pub type W = crate::W; -#[doc = "Register TCSET `reset()`'s with value 0"] -impl crate::ResetValue for super::TCSET { - type Type = u32; +#[doc = "Register `TCSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `TRBS`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TRBS` writer - Timer Run Bit set"] pub struct TRBS_W<'a> { w: &'a mut W, } @@ -26,7 +37,7 @@ impl<'a> TRBS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -36,4 +47,26 @@ impl W { pub fn trbs(&mut self) -> TRBS_W { TRBS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Run Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcset](index.html) module"] +pub struct TCSET_SPEC; +impl crate::RegisterSpec for TCSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tcset::W](W) writer structure"] +impl crate::Writable for TCSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TCSET to value 0"] +impl crate::Resettable for TCSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu40_cc40/tcst.rs b/src/ccu40_cc40/tcst.rs index a2ab8a8b..7e46efbb 100644 --- a/src/ccu40_cc40/tcst.rs +++ b/src/ccu40_cc40/tcst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register TCST"] -pub type R = crate::R; +#[doc = "Register `TCST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Timer Run Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum TRB_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRB`"] -pub type TRB_R = crate::R; +#[doc = "Field `TRB` reader - Timer Run Bit"] +pub struct TRB_R(crate::FieldReader); impl TRB_R { + pub(crate) fn new(bits: bool) -> Self { + TRB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRB_A { @@ -28,12 +44,19 @@ impl TRB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRB_A::VALUE1 + **self == TRB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRB_A::VALUE2 + **self == TRB_A::VALUE2 + } +} +impl core::ops::Deref for TRB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Timer Counting Direction\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CDIR`"] -pub type CDIR_R = crate::R; +#[doc = "Field `CDIR` reader - Timer Counting Direction"] +pub struct CDIR_R(crate::FieldReader); impl CDIR_R { + pub(crate) fn new(bits: bool) -> Self { + CDIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CDIR_A { @@ -64,12 +90,19 @@ impl CDIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CDIR_A::VALUE1 + **self == CDIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CDIR_A::VALUE2 + **self == CDIR_A::VALUE2 + } +} +impl core::ops::Deref for CDIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -84,3 +117,19 @@ impl R { CDIR_R::new(((self.bits >> 1) & 0x01) != 0) } } +#[doc = "Slice Timer Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcst](index.html) module"] +pub struct TCST_SPEC; +impl crate::RegisterSpec for TCST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tcst::R](R) reader structure"] +impl crate::Readable for TCST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TCST to value 0"] +impl crate::Resettable for TCST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu40_cc40/timer.rs b/src/ccu40_cc40/timer.rs index a231d83b..c0854671 100644 --- a/src/ccu40_cc40/timer.rs +++ b/src/ccu40_cc40/timer.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TIMER"] -pub type R = crate::R; -#[doc = "Writer for register TIMER"] -pub type W = crate::W; -#[doc = "Register TIMER `reset()`'s with value 0"] -impl crate::ResetValue for super::TIMER { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TIMER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TIMER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `TVAL`"] -pub type TVAL_R = crate::R; -#[doc = "Write proxy for field `TVAL`"] +#[doc = "Field `TVAL` reader - Timer Value"] +pub struct TVAL_R(crate::FieldReader); +impl TVAL_R { + pub(crate) fn new(bits: u16) -> Self { + TVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TVAL` writer - Timer Value"] pub struct TVAL_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> TVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn tval(&mut self) -> TVAL_W { TVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer Value\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 [timer](index.html) module"] +pub struct TIMER_SPEC; +impl crate::RegisterSpec for TIMER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [timer::R](R) reader structure"] +impl crate::Readable for TIMER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [timer::W](W) writer structure"] +impl crate::Writable for TIMER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TIMER to value 0"] +impl crate::Resettable for TIMER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80.rs b/src/ccu80.rs index 6e22479e..bc23ffab 100644 --- a/src/ccu80.rs +++ b/src/ccu80.rs @@ -2,119 +2,65 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Global Control Register"] - pub gctrl: GCTRL, + pub gctrl: crate::Reg, #[doc = "0x04 - Global Status Register"] - pub gstat: GSTAT, + pub gstat: crate::Reg, #[doc = "0x08 - Global Idle Set"] - pub gidls: GIDLS, + pub gidls: crate::Reg, #[doc = "0x0c - Global Idle Clear"] - pub gidlc: GIDLC, + pub gidlc: crate::Reg, #[doc = "0x10 - Global Channel Set"] - pub gcss: GCSS, + pub gcss: crate::Reg, #[doc = "0x14 - Global Channel Clear"] - pub gcsc: GCSC, + pub gcsc: crate::Reg, #[doc = "0x18 - Global Channel status"] - pub gcst: GCST, + pub gcst: crate::Reg, #[doc = "0x1c - Parity Checker Configuration"] - pub gpchk: GPCHK, - _reserved8: [u8; 48usize], + pub gpchk: crate::Reg, + _reserved8: [u8; 0x30], #[doc = "0x50 - Extended Capture Mode Read"] - pub ecrd: ECRD, - _reserved9: [u8; 44usize], + pub ecrd: crate::Reg, + _reserved9: [u8; 0x2c], #[doc = "0x80 - Module Identification"] - pub midr: MIDR, + pub midr: crate::Reg, } -#[doc = "Global Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gctrl](gctrl) module"] -pub type GCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCTRL; -#[doc = "`read()` method returns [gctrl::R](gctrl::R) reader structure"] -impl crate::Readable for GCTRL {} -#[doc = "`write(|w| ..)` method takes [gctrl::W](gctrl::W) writer structure"] -impl crate::Writable for GCTRL {} +#[doc = "GCTRL register accessor: an alias for `Reg`"] +pub type GCTRL = crate::Reg; #[doc = "Global Control Register"] pub mod gctrl; -#[doc = "Global Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gstat](gstat) module"] -pub type GSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GSTAT; -#[doc = "`read()` method returns [gstat::R](gstat::R) reader structure"] -impl crate::Readable for GSTAT {} +#[doc = "GSTAT register accessor: an alias for `Reg`"] +pub type GSTAT = crate::Reg; #[doc = "Global Status Register"] pub mod gstat; -#[doc = "Global Idle Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidls](gidls) module"] -pub type GIDLS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GIDLS; -#[doc = "`write(|w| ..)` method takes [gidls::W](gidls::W) writer structure"] -impl crate::Writable for GIDLS {} +#[doc = "GIDLS register accessor: an alias for `Reg`"] +pub type GIDLS = crate::Reg; #[doc = "Global Idle Set"] pub mod gidls; -#[doc = "Global Idle Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidlc](gidlc) module"] -pub type GIDLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GIDLC; -#[doc = "`write(|w| ..)` method takes [gidlc::W](gidlc::W) writer structure"] -impl crate::Writable for GIDLC {} +#[doc = "GIDLC register accessor: an alias for `Reg`"] +pub type GIDLC = crate::Reg; #[doc = "Global Idle Clear"] pub mod gidlc; -#[doc = "Global Channel Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcss](gcss) module"] -pub type GCSS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCSS; -#[doc = "`write(|w| ..)` method takes [gcss::W](gcss::W) writer structure"] -impl crate::Writable for GCSS {} +#[doc = "GCSS register accessor: an alias for `Reg`"] +pub type GCSS = crate::Reg; #[doc = "Global Channel Set"] pub mod gcss; -#[doc = "Global Channel Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcsc](gcsc) module"] -pub type GCSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCSC; -#[doc = "`write(|w| ..)` method takes [gcsc::W](gcsc::W) writer structure"] -impl crate::Writable for GCSC {} +#[doc = "GCSC register accessor: an alias for `Reg`"] +pub type GCSC = crate::Reg; #[doc = "Global Channel Clear"] pub mod gcsc; -#[doc = "Global Channel status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcst](gcst) module"] -pub type GCST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GCST; -#[doc = "`read()` method returns [gcst::R](gcst::R) reader structure"] -impl crate::Readable for GCST {} +#[doc = "GCST register accessor: an alias for `Reg`"] +pub type GCST = crate::Reg; #[doc = "Global Channel status"] pub mod gcst; -#[doc = "Parity Checker Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpchk](gpchk) module"] -pub type GPCHK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GPCHK; -#[doc = "`read()` method returns [gpchk::R](gpchk::R) reader structure"] -impl crate::Readable for GPCHK {} -#[doc = "`write(|w| ..)` method takes [gpchk::W](gpchk::W) writer structure"] -impl crate::Writable for GPCHK {} +#[doc = "GPCHK register accessor: an alias for `Reg`"] +pub type GPCHK = crate::Reg; #[doc = "Parity Checker Configuration"] pub mod gpchk; -#[doc = "Extended Capture Mode Read\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ecrd](ecrd) module"] -pub type ECRD = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ECRD; -#[doc = "`read()` method returns [ecrd::R](ecrd::R) reader structure"] -impl crate::Readable for ECRD {} +#[doc = "ECRD register accessor: an alias for `Reg`"] +pub type ECRD = crate::Reg; #[doc = "Extended Capture Mode Read"] pub mod ecrd; -#[doc = "Module Identification\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](midr) module"] -pub type MIDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIDR; -#[doc = "`read()` method returns [midr::R](midr::R) reader structure"] -impl crate::Readable for MIDR {} +#[doc = "MIDR register accessor: an alias for `Reg`"] +pub type MIDR = crate::Reg; #[doc = "Module Identification"] pub mod midr; diff --git a/src/ccu80/ecrd.rs b/src/ccu80/ecrd.rs index 6e011eda..9fd36d6c 100644 --- a/src/ccu80/ecrd.rs +++ b/src/ccu80/ecrd.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register ECRD"] -pub type R = crate::R; -#[doc = "Reader of field `CAPV`"] -pub type CAPV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `ECRD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPV` reader - Timer Capture Value"] +pub struct CAPV_R(crate::FieldReader); +impl CAPV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Capture value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Slice pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -23,9 +60,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SPTR`"] -pub type SPTR_R = crate::R; +#[doc = "Field `SPTR` reader - Slice pointer"] +pub struct SPTR_R(crate::FieldReader); impl SPTR_R { + pub(crate) fn new(bits: u8) -> Self { + SPTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SPTR_A { @@ -40,22 +80,29 @@ impl SPTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SPTR_A::VALUE1 + **self == SPTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SPTR_A::VALUE2 + **self == SPTR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SPTR_A::VALUE3 + **self == SPTR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SPTR_A::VALUE4 + **self == SPTR_A::VALUE4 + } +} +impl core::ops::Deref for SPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Capture register pointer\n\nValue on reset: 0"] @@ -77,9 +124,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `VPTR`"] -pub type VPTR_R = crate::R; +#[doc = "Field `VPTR` reader - Capture register pointer"] +pub struct VPTR_R(crate::FieldReader); impl VPTR_R { + pub(crate) fn new(bits: u8) -> Self { + VPTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VPTR_A { @@ -94,22 +144,29 @@ impl VPTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VPTR_A::VALUE1 + **self == VPTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VPTR_A::VALUE2 + **self == VPTR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == VPTR_A::VALUE3 + **self == VPTR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == VPTR_A::VALUE4 + **self == VPTR_A::VALUE4 + } +} +impl core::ops::Deref for VPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Full Flag\n\nValue on reset: 0"] @@ -126,9 +183,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -140,12 +200,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -175,3 +242,19 @@ impl R { FFL_R::new(((self.bits >> 24) & 0x01) != 0) } } +#[doc = "Extended Capture Mode Read\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ecrd](index.html) module"] +pub struct ECRD_SPEC; +impl crate::RegisterSpec for ECRD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ecrd::R](R) reader structure"] +impl crate::Readable for ECRD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ECRD to value 0"] +impl crate::Resettable for ECRD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80/gcsc.rs b/src/ccu80/gcsc.rs index 5ae3e1cc..85a0f95e 100644 --- a/src/ccu80/gcsc.rs +++ b/src/ccu80/gcsc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GCSC"] -pub type W = crate::W; -#[doc = "Register GCSC `reset()`'s with value 0"] -impl crate::ResetValue for super::GCSC { - type Type = u32; +#[doc = "Register `GCSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `S0SC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `S0SC` writer - Slice 0 shadow transfer request clear"] pub struct S0SC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> S0SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `S0DSC`"] +#[doc = "Field `S0DSC` writer - Slice 0 Dither shadow transfer clear"] pub struct S0DSC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> S0DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `S0PSC`"] +#[doc = "Field `S0PSC` writer - Slice 0 Prescaler shadow transfer clear"] pub struct S0PSC_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> S0PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `S1SC`"] +#[doc = "Field `S1SC` writer - Slice 1 shadow transfer clear"] pub struct S1SC_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> S1SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `S1DSC`"] +#[doc = "Field `S1DSC` writer - Slice 1 Dither shadow transfer clear"] pub struct S1DSC_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> S1DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `S1PSC`"] +#[doc = "Field `S1PSC` writer - Slice 1 Prescaler shadow transfer clear"] pub struct S1PSC_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> S1PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `S2SC`"] +#[doc = "Field `S2SC` writer - Slice 2 shadow transfer clear"] pub struct S2SC_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> S2SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `S2DSC`"] +#[doc = "Field `S2DSC` writer - Slice 2 Dither shadow transfer clear"] pub struct S2DSC_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> S2DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `S2PSC`"] +#[doc = "Field `S2PSC` writer - Slice 2 Prescaler shadow transfer clear"] pub struct S2PSC_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> S2PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `S3SC`"] +#[doc = "Field `S3SC` writer - Slice 3 shadow transfer clear"] pub struct S3SC_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> S3SC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `S3DSC`"] +#[doc = "Field `S3DSC` writer - Slice 3 Dither shadow transfer clear"] pub struct S3DSC_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> S3DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `S3PSC`"] +#[doc = "Field `S3PSC` writer - Slice 3 Prescaler shadow transfer clear"] pub struct S3PSC_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> S3PSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `S0ST1C`"] +#[doc = "Field `S0ST1C` writer - Slice 0 status bit 1 clear"] pub struct S0ST1C_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> S0ST1C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `S1ST1C`"] +#[doc = "Field `S1ST1C` writer - Slice 1 status bit 1 clear"] pub struct S1ST1C_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> S1ST1C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `S2ST1C`"] +#[doc = "Field `S2ST1C` writer - Slice 2 status bit 1 clear"] pub struct S2ST1C_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> S2ST1C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `S3ST1C`"] +#[doc = "Field `S3ST1C` writer - Slice 3 status bit 1 clear"] pub struct S3ST1C_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> S3ST1C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `S0ST2C`"] +#[doc = "Field `S0ST2C` writer - Slice 0 status bit 2 clear"] pub struct S0ST2C_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> S0ST2C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `S1ST2C`"] +#[doc = "Field `S1ST2C` writer - Slice 1 status bit 2 clear"] pub struct S1ST2C_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> S1ST2C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `S2ST2C`"] +#[doc = "Field `S2ST2C` writer - Slice 2 status bit 2 clear"] pub struct S2ST2C_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> S2ST2C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `S3ST2C`"] +#[doc = "Field `S3ST2C` writer - Slice 3 status bit 2 clear"] pub struct S3ST2C_W<'a> { w: &'a mut W, } @@ -444,7 +455,7 @@ impl<'a> S3ST2C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -549,4 +560,26 @@ impl W { pub fn s3st2c(&mut self) -> S3ST2C_W { S3ST2C_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Channel Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcsc](index.html) module"] +pub struct GCSC_SPEC; +impl crate::RegisterSpec for GCSC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gcsc::W](W) writer structure"] +impl crate::Writable for GCSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCSC to value 0"] +impl crate::Resettable for GCSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gcss.rs b/src/ccu80/gcss.rs index 4b788f7e..a930b265 100644 --- a/src/ccu80/gcss.rs +++ b/src/ccu80/gcss.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GCSS"] -pub type W = crate::W; -#[doc = "Register GCSS `reset()`'s with value 0"] -impl crate::ResetValue for super::GCSS { - type Type = u32; +#[doc = "Register `GCSS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `S0SE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `S0SE` writer - Slice 0 shadow transfer set enable"] pub struct S0SE_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> S0SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `S0DSE`"] +#[doc = "Field `S0DSE` writer - Slice 0 Dither shadow transfer set enable"] pub struct S0DSE_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> S0DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `S0PSE`"] +#[doc = "Field `S0PSE` writer - Slice 0 Prescaler shadow transfer set enable"] pub struct S0PSE_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> S0PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `S1SE`"] +#[doc = "Field `S1SE` writer - Slice 1 shadow transfer set enable"] pub struct S1SE_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> S1SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `S1DSE`"] +#[doc = "Field `S1DSE` writer - Slice 1 Dither shadow transfer set enable"] pub struct S1DSE_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> S1DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `S1PSE`"] +#[doc = "Field `S1PSE` writer - Slice 1 Prescaler shadow transfer set enable"] pub struct S1PSE_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> S1PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `S2SE`"] +#[doc = "Field `S2SE` writer - Slice 2 shadow transfer set enable"] pub struct S2SE_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> S2SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `S2DSE`"] +#[doc = "Field `S2DSE` writer - Slice 2 Dither shadow transfer set enable"] pub struct S2DSE_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> S2DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `S2PSE`"] +#[doc = "Field `S2PSE` writer - Slice 2 Prescaler shadow transfer set enable"] pub struct S2PSE_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> S2PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `S3SE`"] +#[doc = "Field `S3SE` writer - Slice 3 shadow transfer set enable"] pub struct S3SE_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> S3SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `S3DSE`"] +#[doc = "Field `S3DSE` writer - Slice 3 Dither shadow transfer set enable"] pub struct S3DSE_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> S3DSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `S3PSE`"] +#[doc = "Field `S3PSE` writer - Slice 3 Prescaler shadow transfer set enable"] pub struct S3PSE_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> S3PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `S0ST1S`"] +#[doc = "Field `S0ST1S` writer - Slice 0 status bit 1 set"] pub struct S0ST1S_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> S0ST1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `S1ST1S`"] +#[doc = "Field `S1ST1S` writer - Slice 1 status bit 1 set"] pub struct S1ST1S_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> S1ST1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `S2ST1S`"] +#[doc = "Field `S2ST1S` writer - Slice 2 status bit 1 set"] pub struct S2ST1S_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> S2ST1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `S3ST1S`"] +#[doc = "Field `S3ST1S` writer - Slice 3 status bit 1 set"] pub struct S3ST1S_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> S3ST1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `S0ST2S`"] +#[doc = "Field `S0ST2S` writer - Slice 0 status bit 2 set"] pub struct S0ST2S_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> S0ST2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `S1ST2S`"] +#[doc = "Field `S1ST2S` writer - Slice 1 status bit 2 set"] pub struct S1ST2S_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> S1ST2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `S2ST2S`"] +#[doc = "Field `S2ST2S` writer - Slice 2 status bit 2 set"] pub struct S2ST2S_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> S2ST2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `S3ST2S`"] +#[doc = "Field `S3ST2S` writer - Slice 3 status bit 2 set"] pub struct S3ST2S_W<'a> { w: &'a mut W, } @@ -444,7 +455,7 @@ impl<'a> S3ST2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -549,4 +560,26 @@ impl W { pub fn s3st2s(&mut self) -> S3ST2S_W { S3ST2S_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Channel Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcss](index.html) module"] +pub struct GCSS_SPEC; +impl crate::RegisterSpec for GCSS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gcss::W](W) writer structure"] +impl crate::Writable for GCSS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCSS to value 0"] +impl crate::Resettable for GCSS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gcst.rs b/src/ccu80/gcst.rs index ac79a1b0..e669b4bd 100644 --- a/src/ccu80/gcst.rs +++ b/src/ccu80/gcst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register GCST"] -pub type R = crate::R; +#[doc = "Register `GCST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Slice 0 shadow transfer status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0SS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0SS`"] -pub type S0SS_R = crate::R; +#[doc = "Field `S0SS` reader - Slice 0 shadow transfer status"] +pub struct S0SS_R(crate::FieldReader); impl S0SS_R { + pub(crate) fn new(bits: bool) -> Self { + S0SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0SS_A { @@ -28,12 +44,19 @@ impl S0SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0SS_A::VALUE1 + **self == S0SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0SS_A::VALUE2 + **self == S0SS_A::VALUE2 + } +} +impl core::ops::Deref for S0SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 0 Dither shadow transfer status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0DSS`"] -pub type S0DSS_R = crate::R; +#[doc = "Field `S0DSS` reader - Slice 0 Dither shadow transfer status"] +pub struct S0DSS_R(crate::FieldReader); impl S0DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S0DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0DSS_A { @@ -64,12 +90,19 @@ impl S0DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0DSS_A::VALUE1 + **self == S0DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0DSS_A::VALUE2 + **self == S0DSS_A::VALUE2 + } +} +impl core::ops::Deref for S0DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 0 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0PSS`"] -pub type S0PSS_R = crate::R; +#[doc = "Field `S0PSS` reader - Slice 0 Prescaler shadow transfer status"] +pub struct S0PSS_R(crate::FieldReader); impl S0PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S0PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0PSS_A { @@ -100,12 +136,19 @@ impl S0PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0PSS_A::VALUE1 + **self == S0PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0PSS_A::VALUE2 + **self == S0PSS_A::VALUE2 + } +} +impl core::ops::Deref for S0PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 shadow transfer status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1SS`"] -pub type S1SS_R = crate::R; +#[doc = "Field `S1SS` reader - Slice 1 shadow transfer status"] +pub struct S1SS_R(crate::FieldReader); impl S1SS_R { + pub(crate) fn new(bits: bool) -> Self { + S1SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1SS_A { @@ -136,12 +182,19 @@ impl S1SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1SS_A::VALUE1 + **self == S1SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1SS_A::VALUE2 + **self == S1SS_A::VALUE2 + } +} +impl core::ops::Deref for S1SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 Dither shadow transfer status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1DSS`"] -pub type S1DSS_R = crate::R; +#[doc = "Field `S1DSS` reader - Slice 1 Dither shadow transfer status"] +pub struct S1DSS_R(crate::FieldReader); impl S1DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S1DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1DSS_A { @@ -172,12 +228,19 @@ impl S1DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1DSS_A::VALUE1 + **self == S1DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1DSS_A::VALUE2 + **self == S1DSS_A::VALUE2 + } +} +impl core::ops::Deref for S1DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 1 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1PSS`"] -pub type S1PSS_R = crate::R; +#[doc = "Field `S1PSS` reader - Slice 1 Prescaler shadow transfer status"] +pub struct S1PSS_R(crate::FieldReader); impl S1PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S1PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1PSS_A { @@ -208,12 +274,19 @@ impl S1PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1PSS_A::VALUE1 + **self == S1PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1PSS_A::VALUE2 + **self == S1PSS_A::VALUE2 + } +} +impl core::ops::Deref for S1PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 shadow transfer status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2SS`"] -pub type S2SS_R = crate::R; +#[doc = "Field `S2SS` reader - Slice 2 shadow transfer status"] +pub struct S2SS_R(crate::FieldReader); impl S2SS_R { + pub(crate) fn new(bits: bool) -> Self { + S2SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2SS_A { @@ -244,12 +320,19 @@ impl S2SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2SS_A::VALUE1 + **self == S2SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2SS_A::VALUE2 + **self == S2SS_A::VALUE2 + } +} +impl core::ops::Deref for S2SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 Dither shadow transfer status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2DSS`"] -pub type S2DSS_R = crate::R; +#[doc = "Field `S2DSS` reader - Slice 2 Dither shadow transfer status"] +pub struct S2DSS_R(crate::FieldReader); impl S2DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S2DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2DSS_A { @@ -280,12 +366,19 @@ impl S2DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2DSS_A::VALUE1 + **self == S2DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2DSS_A::VALUE2 + **self == S2DSS_A::VALUE2 + } +} +impl core::ops::Deref for S2DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 2 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2PSS`"] -pub type S2PSS_R = crate::R; +#[doc = "Field `S2PSS` reader - Slice 2 Prescaler shadow transfer status"] +pub struct S2PSS_R(crate::FieldReader); impl S2PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S2PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2PSS_A { @@ -316,12 +412,19 @@ impl S2PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2PSS_A::VALUE1 + **self == S2PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2PSS_A::VALUE2 + **self == S2PSS_A::VALUE2 + } +} +impl core::ops::Deref for S2PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 shadow transfer status\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3SS`"] -pub type S3SS_R = crate::R; +#[doc = "Field `S3SS` reader - Slice 3 shadow transfer status"] +pub struct S3SS_R(crate::FieldReader); impl S3SS_R { + pub(crate) fn new(bits: bool) -> Self { + S3SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3SS_A { @@ -352,12 +458,19 @@ impl S3SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3SS_A::VALUE1 + **self == S3SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3SS_A::VALUE2 + **self == S3SS_A::VALUE2 + } +} +impl core::ops::Deref for S3SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 Dither shadow transfer status\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3DSS`"] -pub type S3DSS_R = crate::R; +#[doc = "Field `S3DSS` reader - Slice 3 Dither shadow transfer status"] +pub struct S3DSS_R(crate::FieldReader); impl S3DSS_R { + pub(crate) fn new(bits: bool) -> Self { + S3DSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3DSS_A { @@ -388,12 +504,19 @@ impl S3DSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3DSS_A::VALUE1 + **self == S3DSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3DSS_A::VALUE2 + **self == S3DSS_A::VALUE2 + } +} +impl core::ops::Deref for S3DSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Slice 3 Prescaler shadow transfer status\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3PSS`"] -pub type S3PSS_R = crate::R; +#[doc = "Field `S3PSS` reader - Slice 3 Prescaler shadow transfer status"] +pub struct S3PSS_R(crate::FieldReader); impl S3PSS_R { + pub(crate) fn new(bits: bool) -> Self { + S3PSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3PSS_A { @@ -424,30 +550,133 @@ impl S3PSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3PSS_A::VALUE1 + **self == S3PSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3PSS_A::VALUE2 - } -} -#[doc = "Reader of field `CC80ST1`"] -pub type CC80ST1_R = crate::R; -#[doc = "Reader of field `CC81ST1`"] -pub type CC81ST1_R = crate::R; -#[doc = "Reader of field `CC82ST1`"] -pub type CC82ST1_R = crate::R; -#[doc = "Reader of field `CC83ST1`"] -pub type CC83ST1_R = crate::R; -#[doc = "Reader of field `CC80ST2`"] -pub type CC80ST2_R = crate::R; -#[doc = "Reader of field `CC81ST2`"] -pub type CC81ST2_R = crate::R; -#[doc = "Reader of field `CC82ST2`"] -pub type CC82ST2_R = crate::R; -#[doc = "Reader of field `CC83ST2`"] -pub type CC83ST2_R = crate::R; + **self == S3PSS_A::VALUE2 + } +} +impl core::ops::Deref for S3PSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC80ST1` reader - Slice 0 compare channel 1 status bit"] +pub struct CC80ST1_R(crate::FieldReader); +impl CC80ST1_R { + pub(crate) fn new(bits: bool) -> Self { + CC80ST1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC80ST1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC81ST1` reader - Slice 1 compare channel 1 status bit"] +pub struct CC81ST1_R(crate::FieldReader); +impl CC81ST1_R { + pub(crate) fn new(bits: bool) -> Self { + CC81ST1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC81ST1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC82ST1` reader - Slice 2 compare channel 1 status bit"] +pub struct CC82ST1_R(crate::FieldReader); +impl CC82ST1_R { + pub(crate) fn new(bits: bool) -> Self { + CC82ST1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC82ST1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC83ST1` reader - Slice 3 compare channel 1 status bit"] +pub struct CC83ST1_R(crate::FieldReader); +impl CC83ST1_R { + pub(crate) fn new(bits: bool) -> Self { + CC83ST1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC83ST1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC80ST2` reader - Slice 0 compare channel 2 status bit"] +pub struct CC80ST2_R(crate::FieldReader); +impl CC80ST2_R { + pub(crate) fn new(bits: bool) -> Self { + CC80ST2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC80ST2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC81ST2` reader - Slice 1 compare channel 2 status bit"] +pub struct CC81ST2_R(crate::FieldReader); +impl CC81ST2_R { + pub(crate) fn new(bits: bool) -> Self { + CC81ST2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC81ST2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC82ST2` reader - Slice 2 compare channel 2 status bit"] +pub struct CC82ST2_R(crate::FieldReader); +impl CC82ST2_R { + pub(crate) fn new(bits: bool) -> Self { + CC82ST2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC82ST2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC83ST2` reader - Slice 3 compare channel 2 status bit"] +pub struct CC83ST2_R(crate::FieldReader); +impl CC83ST2_R { + pub(crate) fn new(bits: bool) -> Self { + CC83ST2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC83ST2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Slice 0 shadow transfer status"] #[inline(always)] @@ -550,3 +779,19 @@ impl R { CC83ST2_R::new(((self.bits >> 23) & 0x01) != 0) } } +#[doc = "Global Channel status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gcst](index.html) module"] +pub struct GCST_SPEC; +impl crate::RegisterSpec for GCST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gcst::R](R) reader structure"] +impl crate::Readable for GCST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GCST to value 0"] +impl crate::Resettable for GCST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80/gctrl.rs b/src/ccu80/gctrl.rs index b5419c5a..ba7ac4d4 100644 --- a/src/ccu80/gctrl.rs +++ b/src/ccu80/gctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GCTRL"] -pub type R = crate::R; -#[doc = "Writer for register GCTRL"] -pub type W = crate::W; -#[doc = "Register GCTRL `reset()`'s with value 0"] -impl crate::ResetValue for super::GCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Prescaler Clear Configuration\n\nValue on reset: 0"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRBC`"] -pub type PRBC_R = crate::R; +#[doc = "Field `PRBC` reader - Prescaler Clear Configuration"] +pub struct PRBC_R(crate::FieldReader); impl PRBC_R { + pub(crate) fn new(bits: u8) -> Self { + PRBC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PRBC_A::VALUE1), - 1 => Val(PRBC_A::VALUE2), - 2 => Val(PRBC_A::VALUE3), - 3 => Val(PRBC_A::VALUE4), - 4 => Val(PRBC_A::VALUE5), - i => Res(i), + 0 => Some(PRBC_A::VALUE1), + 1 => Some(PRBC_A::VALUE2), + 2 => Some(PRBC_A::VALUE3), + 3 => Some(PRBC_A::VALUE4), + 4 => Some(PRBC_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRBC_A::VALUE1 + **self == PRBC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRBC_A::VALUE2 + **self == PRBC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PRBC_A::VALUE3 + **self == PRBC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PRBC_A::VALUE4 + **self == PRBC_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PRBC_A::VALUE5 + **self == PRBC_A::VALUE5 } } -#[doc = "Write proxy for field `PRBC`"] +impl core::ops::Deref for PRBC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRBC` writer - Prescaler Clear Configuration"] pub struct PRBC_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> PRBC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -134,9 +167,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PCIS`"] -pub type PCIS_R = crate::R; +#[doc = "Field `PCIS` reader - Prescaler Input Clock Selection"] +pub struct PCIS_R(crate::FieldReader); impl PCIS_R { + pub(crate) fn new(bits: u8) -> Self { + PCIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCIS_A { @@ -151,25 +187,32 @@ impl PCIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCIS_A::VALUE1 + **self == PCIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCIS_A::VALUE2 + **self == PCIS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PCIS_A::VALUE3 + **self == PCIS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PCIS_A::VALUE4 + **self == PCIS_A::VALUE4 + } +} +impl core::ops::Deref for PCIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PCIS`"] +#[doc = "Field `PCIS` writer - Prescaler Input Clock Selection"] pub struct PCIS_W<'a> { w: &'a mut W, } @@ -177,9 +220,7 @@ impl<'a> PCIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCIS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Module clock"] #[inline(always)] @@ -204,7 +245,7 @@ impl<'a> PCIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -227,9 +268,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUSCFG`"] -pub type SUSCFG_R = crate::R; +#[doc = "Field `SUSCFG` reader - Suspend Mode Configuration"] +pub struct SUSCFG_R(crate::FieldReader); impl SUSCFG_R { + pub(crate) fn new(bits: u8) -> Self { + SUSCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSCFG_A { @@ -244,25 +288,32 @@ impl SUSCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSCFG_A::VALUE1 + **self == SUSCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSCFG_A::VALUE2 + **self == SUSCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUSCFG_A::VALUE3 + **self == SUSCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SUSCFG_A::VALUE4 + **self == SUSCFG_A::VALUE4 } } -#[doc = "Write proxy for field `SUSCFG`"] +impl core::ops::Deref for SUSCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSCFG` writer - Suspend Mode Configuration"] pub struct SUSCFG_W<'a> { w: &'a mut W, } @@ -270,9 +321,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SUSCFG_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] @@ -297,7 +346,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -315,9 +364,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE0`"] -pub type MSE0_R = crate::R; +#[doc = "Field `MSE0` reader - Slice 0 Multi Channel shadow transfer enable"] +pub struct MSE0_R(crate::FieldReader); impl MSE0_R { + pub(crate) fn new(bits: bool) -> Self { + MSE0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE0_A { @@ -329,15 +381,22 @@ impl MSE0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE0_A::VALUE1 + **self == MSE0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE0_A::VALUE2 + **self == MSE0_A::VALUE2 } } -#[doc = "Write proxy for field `MSE0`"] +impl core::ops::Deref for MSE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSE0` writer - Slice 0 Multi Channel shadow transfer enable"] pub struct MSE0_W<'a> { w: &'a mut W, } @@ -345,9 +404,7 @@ impl<'a> MSE0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -372,7 +429,7 @@ impl<'a> MSE0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -390,9 +447,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE1`"] -pub type MSE1_R = crate::R; +#[doc = "Field `MSE1` reader - Slice 1 Multi Channel shadow transfer enable"] +pub struct MSE1_R(crate::FieldReader); impl MSE1_R { + pub(crate) fn new(bits: bool) -> Self { + MSE1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE1_A { @@ -404,15 +464,22 @@ impl MSE1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE1_A::VALUE1 + **self == MSE1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE1_A::VALUE2 + **self == MSE1_A::VALUE2 + } +} +impl core::ops::Deref for MSE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSE1`"] +#[doc = "Field `MSE1` writer - Slice 1 Multi Channel shadow transfer enable"] pub struct MSE1_W<'a> { w: &'a mut W, } @@ -420,9 +487,7 @@ impl<'a> MSE1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -447,7 +512,7 @@ impl<'a> MSE1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -465,9 +530,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE2`"] -pub type MSE2_R = crate::R; +#[doc = "Field `MSE2` reader - Slice 2 Multi Channel shadow transfer enable"] +pub struct MSE2_R(crate::FieldReader); impl MSE2_R { + pub(crate) fn new(bits: bool) -> Self { + MSE2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE2_A { @@ -479,15 +547,22 @@ impl MSE2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE2_A::VALUE1 + **self == MSE2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE2_A::VALUE2 + **self == MSE2_A::VALUE2 } } -#[doc = "Write proxy for field `MSE2`"] +impl core::ops::Deref for MSE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSE2` writer - Slice 2 Multi Channel shadow transfer enable"] pub struct MSE2_W<'a> { w: &'a mut W, } @@ -495,9 +570,7 @@ impl<'a> MSE2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -522,7 +595,7 @@ impl<'a> MSE2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -540,9 +613,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSE3`"] -pub type MSE3_R = crate::R; +#[doc = "Field `MSE3` reader - Slice 3 Multi Channel shadow transfer enable"] +pub struct MSE3_R(crate::FieldReader); impl MSE3_R { + pub(crate) fn new(bits: bool) -> Self { + MSE3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSE3_A { @@ -554,15 +630,22 @@ impl MSE3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSE3_A::VALUE1 + **self == MSE3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSE3_A::VALUE2 + **self == MSE3_A::VALUE2 + } +} +impl core::ops::Deref for MSE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSE3`"] +#[doc = "Field `MSE3` writer - Slice 3 Multi Channel shadow transfer enable"] pub struct MSE3_W<'a> { w: &'a mut W, } @@ -570,9 +653,7 @@ impl<'a> MSE3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSE3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] @@ -597,7 +678,7 @@ impl<'a> MSE3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -618,37 +699,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MSDE`"] -pub type MSDE_R = crate::R; +#[doc = "Field `MSDE` reader - Multi Channel shadow transfer request configuration"] +pub struct MSDE_R(crate::FieldReader); impl MSDE_R { + pub(crate) fn new(bits: u8) -> Self { + MSDE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MSDE_A::VALUE1), - 1 => Val(MSDE_A::VALUE2), - 3 => Val(MSDE_A::VALUE4), - i => Res(i), + 0 => Some(MSDE_A::VALUE1), + 1 => Some(MSDE_A::VALUE2), + 3 => Some(MSDE_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSDE_A::VALUE1 + **self == MSDE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSDE_A::VALUE2 + **self == MSDE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MSDE_A::VALUE4 + **self == MSDE_A::VALUE4 + } +} +impl core::ops::Deref for MSDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSDE`"] +#[doc = "Field `MSDE` writer - Multi Channel shadow transfer request configuration"] pub struct MSDE_W<'a> { w: &'a mut W, } @@ -676,7 +766,7 @@ impl<'a> MSDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -763,4 +853,30 @@ impl W { pub fn msde(&mut self) -> MSDE_W { MSDE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Control Register\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 [gctrl](index.html) module"] +pub struct GCTRL_SPEC; +impl crate::RegisterSpec for GCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gctrl::R](R) reader structure"] +impl crate::Readable for GCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gctrl::W](W) writer structure"] +impl crate::Writable for GCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GCTRL to value 0"] +impl crate::Resettable for GCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gidlc.rs b/src/ccu80/gidlc.rs index 9a335b74..9735a48e 100644 --- a/src/ccu80/gidlc.rs +++ b/src/ccu80/gidlc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GIDLC"] -pub type W = crate::W; -#[doc = "Register GIDLC `reset()`'s with value 0"] -impl crate::ResetValue for super::GIDLC { - type Type = u32; +#[doc = "Register `GIDLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `CS0I`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CS0I` writer - CC80 IDLE mode clear"] pub struct CS0I_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> CS0I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `CS1I`"] +#[doc = "Field `CS1I` writer - CC81 IDLE mode clear"] pub struct CS1I_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> CS1I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `CS2I`"] +#[doc = "Field `CS2I` writer - CC82 IDLE mode clear"] pub struct CS2I_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> CS2I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `CS3I`"] +#[doc = "Field `CS3I` writer - CC83 IDLE mode clear"] pub struct CS3I_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> CS3I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SPRB`"] +#[doc = "Field `SPRB` writer - Prescaler Run Bit Set"] pub struct SPRB_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SPRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SPCH`"] +#[doc = "Field `SPCH` writer - Parity Checker run bit set"] pub struct SPCH_W<'a> { w: &'a mut W, } @@ -136,7 +147,7 @@ impl<'a> SPCH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -171,4 +182,26 @@ impl W { pub fn spch(&mut self) -> SPCH_W { SPCH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Idle Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidlc](index.html) module"] +pub struct GIDLC_SPEC; +impl crate::RegisterSpec for GIDLC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gidlc::W](W) writer structure"] +impl crate::Writable for GIDLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GIDLC to value 0"] +impl crate::Resettable for GIDLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gidls.rs b/src/ccu80/gidls.rs index d2d93068..9fb8fde2 100644 --- a/src/ccu80/gidls.rs +++ b/src/ccu80/gidls.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register GIDLS"] -pub type W = crate::W; -#[doc = "Register GIDLS `reset()`'s with value 0"] -impl crate::ResetValue for super::GIDLS { - type Type = u32; +#[doc = "Register `GIDLS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SS0I`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SS0I` writer - CC80 IDLE mode set"] pub struct SS0I_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SS0I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SS1I`"] +#[doc = "Field `SS1I` writer - CC81 IDLE mode set"] pub struct SS1I_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SS1I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SS2I`"] +#[doc = "Field `SS2I` writer - CC82 IDLE mode set"] pub struct SS2I_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SS2I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SS3I`"] +#[doc = "Field `SS3I` writer - CC83 IDLE mode set"] pub struct SS3I_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SS3I_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `CPRB`"] +#[doc = "Field `CPRB` writer - Prescaler# Run Bit Clear"] pub struct CPRB_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> CPRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PSIC`"] +#[doc = "Field `PSIC` writer - Prescaler clear"] pub struct PSIC_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PSIC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `CPCH`"] +#[doc = "Field `CPCH` writer - Parity Checker Run bit clear"] pub struct CPCH_W<'a> { w: &'a mut W, } @@ -158,7 +169,7 @@ impl<'a> CPCH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -198,4 +209,26 @@ impl W { pub fn cpch(&mut self) -> CPCH_W { CPCH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Idle Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gidls](index.html) module"] +pub struct GIDLS_SPEC; +impl crate::RegisterSpec for GIDLS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [gidls::W](W) writer structure"] +impl crate::Writable for GIDLS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GIDLS to value 0"] +impl crate::Resettable for GIDLS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gpchk.rs b/src/ccu80/gpchk.rs index c5cfde3f..346518b6 100644 --- a/src/ccu80/gpchk.rs +++ b/src/ccu80/gpchk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GPCHK"] -pub type R = crate::R; -#[doc = "Writer for register GPCHK"] -pub type W = crate::W; -#[doc = "Register GPCHK `reset()`'s with value 0"] -impl crate::ResetValue for super::GPCHK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GPCHK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GPCHK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PASE` reader - Parity Checker Automatic start/stop"] +pub struct PASE_R(crate::FieldReader); +impl PASE_R { + pub(crate) fn new(bits: bool) -> Self { + PASE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PASE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PASE`"] -pub type PASE_R = crate::R; -#[doc = "Write proxy for field `PASE`"] +#[doc = "Field `PASE` writer - Parity Checker Automatic start/stop"] pub struct PASE_W<'a> { w: &'a mut W, } @@ -30,7 +66,7 @@ impl<'a> PASE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -53,9 +89,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PACS`"] -pub type PACS_R = crate::R; +#[doc = "Field `PACS` reader - Parity Checker Automatic start/stop selector"] +pub struct PACS_R(crate::FieldReader); impl PACS_R { + pub(crate) fn new(bits: u8) -> Self { + PACS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PACS_A { @@ -70,25 +109,32 @@ impl PACS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PACS_A::VALUE1 + **self == PACS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PACS_A::VALUE2 + **self == PACS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PACS_A::VALUE3 + **self == PACS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PACS_A::VALUE4 + **self == PACS_A::VALUE4 } } -#[doc = "Write proxy for field `PACS`"] +impl core::ops::Deref for PACS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PACS` writer - Parity Checker Automatic start/stop selector"] pub struct PACS_W<'a> { w: &'a mut W, } @@ -96,9 +142,7 @@ impl<'a> PACS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PACS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CC80"] #[inline(always)] @@ -123,7 +167,7 @@ impl<'a> PACS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 1)) | (((value as u32) & 0x03) << 1); + self.w.bits = (self.w.bits & !(0x03 << 1)) | ((value as u32 & 0x03) << 1); self.w } } @@ -146,9 +190,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PISEL`"] -pub type PISEL_R = crate::R; +#[doc = "Field `PISEL` reader - Driver Input signal selector"] +pub struct PISEL_R(crate::FieldReader); impl PISEL_R { + pub(crate) fn new(bits: u8) -> Self { + PISEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PISEL_A { @@ -163,25 +210,32 @@ impl PISEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PISEL_A::VALUE1 + **self == PISEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PISEL_A::VALUE2 + **self == PISEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PISEL_A::VALUE3 + **self == PISEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PISEL_A::VALUE4 + **self == PISEL_A::VALUE4 + } +} +impl core::ops::Deref for PISEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PISEL`"] +#[doc = "Field `PISEL` writer - Driver Input signal selector"] pub struct PISEL_W<'a> { w: &'a mut W, } @@ -189,9 +243,7 @@ impl<'a> PISEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PISEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CC8x.GP01 - driver output is connected to event 1 of slice 0"] #[inline(always)] @@ -216,7 +268,7 @@ impl<'a> PISEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 3)) | (((value as u32) & 0x03) << 3); + self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u32 & 0x03) << 3); self.w } } @@ -239,9 +291,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PCDS`"] -pub type PCDS_R = crate::R; +#[doc = "Field `PCDS` reader - Parity Checker Delay Input Selector"] +pub struct PCDS_R(crate::FieldReader); impl PCDS_R { + pub(crate) fn new(bits: u8) -> Self { + PCDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCDS_A { @@ -256,25 +311,32 @@ impl PCDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCDS_A::VALUE1 + **self == PCDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCDS_A::VALUE2 + **self == PCDS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PCDS_A::VALUE3 + **self == PCDS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PCDS_A::VALUE4 + **self == PCDS_A::VALUE4 + } +} +impl core::ops::Deref for PCDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PCDS`"] +#[doc = "Field `PCDS` writer - Parity Checker Delay Input Selector"] pub struct PCDS_W<'a> { w: &'a mut W, } @@ -282,9 +344,7 @@ impl<'a> PCDS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCDS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU8x.IGBTA"] #[inline(always)] @@ -309,7 +369,7 @@ impl<'a> PCDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5); + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); self.w } } @@ -327,9 +387,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCTS`"] -pub type PCTS_R = crate::R; +#[doc = "Field `PCTS` reader - Parity Checker type selector"] +pub struct PCTS_R(crate::FieldReader); impl PCTS_R { + pub(crate) fn new(bits: bool) -> Self { + PCTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCTS_A { @@ -341,15 +404,22 @@ impl PCTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCTS_A::VALUE1 + **self == PCTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCTS_A::VALUE2 + **self == PCTS_A::VALUE2 } } -#[doc = "Write proxy for field `PCTS`"] +impl core::ops::Deref for PCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCTS` writer - Parity Checker type selector"] pub struct PCTS_W<'a> { w: &'a mut W, } @@ -357,9 +427,7 @@ impl<'a> PCTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCTS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Even parity enabled"] #[inline(always)] @@ -384,15 +452,39 @@ impl<'a> PCTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `PCST`"] -pub type PCST_R = crate::R; -#[doc = "Reader of field `PCSEL0`"] -pub type PCSEL0_R = crate::R; -#[doc = "Write proxy for field `PCSEL0`"] +#[doc = "Field `PCST` reader - Parity Checker XOR status"] +pub struct PCST_R(crate::FieldReader); +impl PCST_R { + pub(crate) fn new(bits: bool) -> Self { + PCST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCSEL0` reader - Parity Checker Slice 0 output selection"] +pub struct PCSEL0_R(crate::FieldReader); +impl PCSEL0_R { + pub(crate) fn new(bits: u8) -> Self { + PCSEL0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCSEL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCSEL0` writer - Parity Checker Slice 0 output selection"] pub struct PCSEL0_W<'a> { w: &'a mut W, } @@ -400,13 +492,25 @@ impl<'a> PCSEL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } -#[doc = "Reader of field `PCSEL1`"] -pub type PCSEL1_R = crate::R; -#[doc = "Write proxy for field `PCSEL1`"] +#[doc = "Field `PCSEL1` reader - Parity Checker Slice 1 output selection"] +pub struct PCSEL1_R(crate::FieldReader); +impl PCSEL1_R { + pub(crate) fn new(bits: u8) -> Self { + PCSEL1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCSEL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCSEL1` writer - Parity Checker Slice 1 output selection"] pub struct PCSEL1_W<'a> { w: &'a mut W, } @@ -414,13 +518,25 @@ impl<'a> PCSEL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } -#[doc = "Reader of field `PCSEL2`"] -pub type PCSEL2_R = crate::R; -#[doc = "Write proxy for field `PCSEL2`"] +#[doc = "Field `PCSEL2` reader - Parity Checker Slice 2 output selection"] +pub struct PCSEL2_R(crate::FieldReader); +impl PCSEL2_R { + pub(crate) fn new(bits: u8) -> Self { + PCSEL2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCSEL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCSEL2` writer - Parity Checker Slice 2 output selection"] pub struct PCSEL2_W<'a> { w: &'a mut W, } @@ -428,13 +544,25 @@ impl<'a> PCSEL2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } -#[doc = "Reader of field `PCSEL3`"] -pub type PCSEL3_R = crate::R; -#[doc = "Write proxy for field `PCSEL3`"] +#[doc = "Field `PCSEL3` reader - Parity Checker Slice 3 output selection"] +pub struct PCSEL3_R(crate::FieldReader); +impl PCSEL3_R { + pub(crate) fn new(bits: u8) -> Self { + PCSEL3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCSEL3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCSEL3` writer - Parity Checker Slice 3 output selection"] pub struct PCSEL3_W<'a> { w: &'a mut W, } @@ -442,7 +570,7 @@ impl<'a> PCSEL3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -544,4 +672,30 @@ impl W { pub fn pcsel3(&mut self) -> PCSEL3_W { PCSEL3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Checker Configuration\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 [gpchk](index.html) module"] +pub struct GPCHK_SPEC; +impl crate::RegisterSpec for GPCHK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gpchk::R](R) reader structure"] +impl crate::Readable for GPCHK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gpchk::W](W) writer structure"] +impl crate::Writable for GPCHK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GPCHK to value 0"] +impl crate::Resettable for GPCHK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80/gstat.rs b/src/ccu80/gstat.rs index 3b6bbde4..1554d0ae 100644 --- a/src/ccu80/gstat.rs +++ b/src/ccu80/gstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register GSTAT"] -pub type R = crate::R; +#[doc = "Register `GSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "CC80 IDLE status\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0I_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0I`"] -pub type S0I_R = crate::R; +#[doc = "Field `S0I` reader - CC80 IDLE status"] +pub struct S0I_R(crate::FieldReader); impl S0I_R { + pub(crate) fn new(bits: bool) -> Self { + S0I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0I_A { @@ -28,12 +44,19 @@ impl S0I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0I_A::VALUE1 + **self == S0I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0I_A::VALUE2 + **self == S0I_A::VALUE2 + } +} +impl core::ops::Deref for S0I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC81 IDLE status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1I`"] -pub type S1I_R = crate::R; +#[doc = "Field `S1I` reader - CC81 IDLE status"] +pub struct S1I_R(crate::FieldReader); impl S1I_R { + pub(crate) fn new(bits: bool) -> Self { + S1I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1I_A { @@ -64,12 +90,19 @@ impl S1I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1I_A::VALUE1 + **self == S1I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1I_A::VALUE2 + **self == S1I_A::VALUE2 + } +} +impl core::ops::Deref for S1I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC82 IDLE status\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2I`"] -pub type S2I_R = crate::R; +#[doc = "Field `S2I` reader - CC82 IDLE status"] +pub struct S2I_R(crate::FieldReader); impl S2I_R { + pub(crate) fn new(bits: bool) -> Self { + S2I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2I_A { @@ -100,12 +136,19 @@ impl S2I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2I_A::VALUE1 + **self == S2I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2I_A::VALUE2 + **self == S2I_A::VALUE2 + } +} +impl core::ops::Deref for S2I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CC83 IDLE status\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3I`"] -pub type S3I_R = crate::R; +#[doc = "Field `S3I` reader - CC83 IDLE status"] +pub struct S3I_R(crate::FieldReader); impl S3I_R { + pub(crate) fn new(bits: bool) -> Self { + S3I_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3I_A { @@ -136,12 +182,19 @@ impl S3I_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3I_A::VALUE1 + **self == S3I_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3I_A::VALUE2 + **self == S3I_A::VALUE2 + } +} +impl core::ops::Deref for S3I_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Prescaler Run Bit\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRB`"] -pub type PRB_R = crate::R; +#[doc = "Field `PRB` reader - Prescaler Run Bit"] +pub struct PRB_R(crate::FieldReader); impl PRB_R { + pub(crate) fn new(bits: bool) -> Self { + PRB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRB_A { @@ -172,12 +228,19 @@ impl PRB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRB_A::VALUE1 + **self == PRB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRB_A::VALUE2 + **self == PRB_A::VALUE2 + } +} +impl core::ops::Deref for PRB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Parity Checker Run Bit\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCRB`"] -pub type PCRB_R = crate::R; +#[doc = "Field `PCRB` reader - Parity Checker Run Bit"] +pub struct PCRB_R(crate::FieldReader); impl PCRB_R { + pub(crate) fn new(bits: bool) -> Self { + PCRB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCRB_A { @@ -208,12 +274,19 @@ impl PCRB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCRB_A::VALUE1 + **self == PCRB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCRB_A::VALUE2 + **self == PCRB_A::VALUE2 + } +} +impl core::ops::Deref for PCRB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -248,3 +321,19 @@ impl R { PCRB_R::new(((self.bits >> 10) & 0x01) != 0) } } +#[doc = "Global Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gstat](index.html) module"] +pub struct GSTAT_SPEC; +impl crate::RegisterSpec for GSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gstat::R](R) reader structure"] +impl crate::Readable for GSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GSTAT to value 0x0f"] +impl crate::Resettable for GSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0f + } +} diff --git a/src/ccu80/midr.rs b/src/ccu80/midr.rs index ca2a62bb..e56a6093 100644 --- a/src/ccu80/midr.rs +++ b/src/ccu80/midr.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register MIDR"] -pub type R = crate::R; -#[doc = "Reader of field `MODR`"] -pub type MODR_R = crate::R; -#[doc = "Reader of field `MODT`"] -pub type MODT_R = crate::R; -#[doc = "Reader of field `MODN`"] -pub type MODN_R = crate::R; +#[doc = "Register `MIDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MODR` reader - Module Revision"] +pub struct MODR_R(crate::FieldReader); +impl MODR_R { + pub(crate) fn new(bits: u8) -> Self { + MODR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODT` reader - Module Type"] +pub struct MODT_R(crate::FieldReader); +impl MODT_R { + pub(crate) fn new(bits: u8) -> Self { + MODT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODN` reader - Module Number"] +pub struct MODN_R(crate::FieldReader); +impl MODN_R { + pub(crate) fn new(bits: u16) -> Self { + MODN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MODN_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](index.html) module"] +pub struct MIDR_SPEC; +impl crate::RegisterSpec for MIDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [midr::R](R) reader structure"] +impl crate::Readable for MIDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIDR to value 0x00a7_c000"] +impl crate::Resettable for MIDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a7_c000 + } +} diff --git a/src/ccu80_cc80.rs b/src/ccu80_cc80.rs index 42492d01..943ad657 100644 --- a/src/ccu80_cc80.rs +++ b/src/ccu80_cc80.rs @@ -2,406 +2,203 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Input Selector Configuration"] - pub ins: INS, + pub ins: crate::Reg, #[doc = "0x04 - Connection Matrix Control"] - pub cmc: CMC, + pub cmc: crate::Reg, #[doc = "0x08 - Slice Timer Status"] - pub tcst: TCST, + pub tcst: crate::Reg, #[doc = "0x0c - Slice Timer Run Set"] - pub tcset: TCSET, + pub tcset: crate::Reg, #[doc = "0x10 - Slice Timer Clear"] - pub tcclr: TCCLR, + pub tcclr: crate::Reg, #[doc = "0x14 - Slice Timer Control"] - pub tc: TC, + pub tc: crate::Reg, #[doc = "0x18 - Passive Level Config"] - pub psl: PSL, + pub psl: crate::Reg, #[doc = "0x1c - Dither Config"] - pub dit: DIT, + pub dit: crate::Reg, #[doc = "0x20 - Dither Shadow Register"] - pub dits: DITS, + pub dits: crate::Reg, #[doc = "0x24 - Prescaler Control"] - pub psc: PSC, + pub psc: crate::Reg, #[doc = "0x28 - Floating Prescaler Control"] - pub fpc: FPC, + pub fpc: crate::Reg, #[doc = "0x2c - Floating Prescaler Shadow"] - pub fpcs: FPCS, + pub fpcs: crate::Reg, #[doc = "0x30 - Timer Period Value"] - pub pr: PR, + pub pr: crate::Reg, #[doc = "0x34 - Timer Shadow Period Value"] - pub prs: PRS, + pub prs: crate::Reg, #[doc = "0x38 - Channel 1 Compare Value"] - pub cr1: CR1, + pub cr1: crate::Reg, #[doc = "0x3c - Channel 1 Compare Shadow Value"] - pub cr1s: CR1S, + pub cr1s: crate::Reg, #[doc = "0x40 - Channel 2 Compare Value"] - pub cr2: CR2, + pub cr2: crate::Reg, #[doc = "0x44 - Channel 2 Compare Shadow Value"] - pub cr2s: CR2S, + pub cr2s: crate::Reg, #[doc = "0x48 - Channel Control"] - pub chc: CHC, + pub chc: crate::Reg, #[doc = "0x4c - Dead Time Control"] - pub dtc: DTC, + pub dtc: crate::Reg, #[doc = "0x50 - Channel 1 Dead Time Values"] - pub dc1r: DC1R, + pub dc1r: crate::Reg, #[doc = "0x54 - Channel 2 Dead Time Values"] - pub dc2r: DC2R, - _reserved22: [u8; 24usize], + pub dc2r: crate::Reg, + _reserved22: [u8; 0x18], #[doc = "0x70 - Timer Value"] - pub timer: TIMER, + pub timer: crate::Reg, #[doc = "0x74 - Capture Register 0"] - pub c0v: C0V, + pub c0v: crate::Reg, #[doc = "0x78 - Capture Register 1"] - pub c1v: C1V, + pub c1v: crate::Reg, #[doc = "0x7c - Capture Register 2"] - pub c2v: C2V, + pub c2v: crate::Reg, #[doc = "0x80 - Capture Register 3"] - pub c3v: C3V, - _reserved27: [u8; 28usize], + pub c3v: crate::Reg, + _reserved27: [u8; 0x1c], #[doc = "0xa0 - Interrupt Status"] - pub ints: INTS, + pub ints: crate::Reg, #[doc = "0xa4 - Interrupt Enable Control"] - pub inte: INTE, + pub inte: crate::Reg, #[doc = "0xa8 - Service Request Selector"] - pub srs: SRS, + pub srs: crate::Reg, #[doc = "0xac - Interrupt Status Set"] - pub sws: SWS, + pub sws: crate::Reg, #[doc = "0xb0 - Interrupt Status Clear"] - pub swr: SWR, + pub swr: crate::Reg, #[doc = "0xb4 - Shadow transfer control"] - pub stc: STC, + pub stc: crate::Reg, } -#[doc = "Input Selector Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ins](ins) module"] -pub type INS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INS; -#[doc = "`read()` method returns [ins::R](ins::R) reader structure"] -impl crate::Readable for INS {} -#[doc = "`write(|w| ..)` method takes [ins::W](ins::W) writer structure"] -impl crate::Writable for INS {} +#[doc = "INS register accessor: an alias for `Reg`"] +pub type INS = crate::Reg; #[doc = "Input Selector Configuration"] pub mod ins; -#[doc = "Connection Matrix Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cmc](cmc) module"] -pub type CMC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CMC; -#[doc = "`read()` method returns [cmc::R](cmc::R) reader structure"] -impl crate::Readable for CMC {} -#[doc = "`write(|w| ..)` method takes [cmc::W](cmc::W) writer structure"] -impl crate::Writable for CMC {} +#[doc = "CMC register accessor: an alias for `Reg`"] +pub type CMC = crate::Reg; #[doc = "Connection Matrix Control"] pub mod cmc; -#[doc = "Slice Timer Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcst](tcst) module"] -pub type TCST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCST; -#[doc = "`read()` method returns [tcst::R](tcst::R) reader structure"] -impl crate::Readable for TCST {} +#[doc = "TCST register accessor: an alias for `Reg`"] +pub type TCST = crate::Reg; #[doc = "Slice Timer Status"] pub mod tcst; -#[doc = "Slice Timer Run Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcset](tcset) module"] -pub type TCSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCSET; -#[doc = "`write(|w| ..)` method takes [tcset::W](tcset::W) writer structure"] -impl crate::Writable for TCSET {} +#[doc = "TCSET register accessor: an alias for `Reg`"] +pub type TCSET = crate::Reg; #[doc = "Slice Timer Run Set"] pub mod tcset; -#[doc = "Slice Timer Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcclr](tcclr) module"] -pub type TCCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCCLR; -#[doc = "`write(|w| ..)` method takes [tcclr::W](tcclr::W) writer structure"] -impl crate::Writable for TCCLR {} +#[doc = "TCCLR register accessor: an alias for `Reg`"] +pub type TCCLR = crate::Reg; #[doc = "Slice Timer Clear"] pub mod tcclr; -#[doc = "Slice Timer Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tc](tc) module"] -pub type TC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TC; -#[doc = "`read()` method returns [tc::R](tc::R) reader structure"] -impl crate::Readable for TC {} -#[doc = "`write(|w| ..)` method takes [tc::W](tc::W) writer structure"] -impl crate::Writable for TC {} +#[doc = "TC register accessor: an alias for `Reg`"] +pub type TC = crate::Reg; #[doc = "Slice Timer Control"] pub mod tc; -#[doc = "Passive Level Config\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psl](psl) module"] -pub type PSL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSL; -#[doc = "`read()` method returns [psl::R](psl::R) reader structure"] -impl crate::Readable for PSL {} -#[doc = "`write(|w| ..)` method takes [psl::W](psl::W) writer structure"] -impl crate::Writable for PSL {} +#[doc = "PSL register accessor: an alias for `Reg`"] +pub type PSL = crate::Reg; #[doc = "Passive Level Config"] pub mod psl; -#[doc = "Dither Config\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dit](dit) module"] -pub type DIT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIT; -#[doc = "`read()` method returns [dit::R](dit::R) reader structure"] -impl crate::Readable for DIT {} +#[doc = "DIT register accessor: an alias for `Reg`"] +pub type DIT = crate::Reg; #[doc = "Dither Config"] pub mod dit; -#[doc = "Dither Shadow Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dits](dits) module"] -pub type DITS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DITS; -#[doc = "`read()` method returns [dits::R](dits::R) reader structure"] -impl crate::Readable for DITS {} -#[doc = "`write(|w| ..)` method takes [dits::W](dits::W) writer structure"] -impl crate::Writable for DITS {} +#[doc = "DITS register accessor: an alias for `Reg`"] +pub type DITS = crate::Reg; #[doc = "Dither Shadow Register"] pub mod dits; -#[doc = "Prescaler Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psc](psc) module"] -pub type PSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSC; -#[doc = "`read()` method returns [psc::R](psc::R) reader structure"] -impl crate::Readable for PSC {} -#[doc = "`write(|w| ..)` method takes [psc::W](psc::W) writer structure"] -impl crate::Writable for PSC {} +#[doc = "PSC register accessor: an alias for `Reg`"] +pub type PSC = crate::Reg; #[doc = "Prescaler Control"] pub mod psc; -#[doc = "Floating Prescaler Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpc](fpc) module"] -pub type FPC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPC; -#[doc = "`read()` method returns [fpc::R](fpc::R) reader structure"] -impl crate::Readable for FPC {} -#[doc = "`write(|w| ..)` method takes [fpc::W](fpc::W) writer structure"] -impl crate::Writable for FPC {} +#[doc = "FPC register accessor: an alias for `Reg`"] +pub type FPC = crate::Reg; #[doc = "Floating Prescaler Control"] pub mod fpc; -#[doc = "Floating Prescaler Shadow\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpcs](fpcs) module"] -pub type FPCS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPCS; -#[doc = "`read()` method returns [fpcs::R](fpcs::R) reader structure"] -impl crate::Readable for FPCS {} -#[doc = "`write(|w| ..)` method takes [fpcs::W](fpcs::W) writer structure"] -impl crate::Writable for FPCS {} +#[doc = "FPCS register accessor: an alias for `Reg`"] +pub type FPCS = crate::Reg; #[doc = "Floating Prescaler Shadow"] pub mod fpcs; -#[doc = "Timer Period Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pr](pr) module"] -pub type PR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PR; -#[doc = "`read()` method returns [pr::R](pr::R) reader structure"] -impl crate::Readable for PR {} +#[doc = "PR register accessor: an alias for `Reg`"] +pub type PR = crate::Reg; #[doc = "Timer Period Value"] pub mod pr; -#[doc = "Timer Shadow Period Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prs](prs) module"] -pub type PRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRS; -#[doc = "`read()` method returns [prs::R](prs::R) reader structure"] -impl crate::Readable for PRS {} -#[doc = "`write(|w| ..)` method takes [prs::W](prs::W) writer structure"] -impl crate::Writable for PRS {} +#[doc = "PRS register accessor: an alias for `Reg`"] +pub type PRS = crate::Reg; #[doc = "Timer Shadow Period Value"] pub mod prs; -#[doc = "Channel 1 Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](cr1) module"] -pub type CR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR1; -#[doc = "`read()` method returns [cr1::R](cr1::R) reader structure"] -impl crate::Readable for CR1 {} +#[doc = "CR1 register accessor: an alias for `Reg`"] +pub type CR1 = crate::Reg; #[doc = "Channel 1 Compare Value"] pub mod cr1; -#[doc = "Channel 1 Compare Shadow Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1s](cr1s) module"] -pub type CR1S = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR1S; -#[doc = "`read()` method returns [cr1s::R](cr1s::R) reader structure"] -impl crate::Readable for CR1S {} -#[doc = "`write(|w| ..)` method takes [cr1s::W](cr1s::W) writer structure"] -impl crate::Writable for CR1S {} +#[doc = "CR1S register accessor: an alias for `Reg`"] +pub type CR1S = crate::Reg; #[doc = "Channel 1 Compare Shadow Value"] pub mod cr1s; -#[doc = "Channel 2 Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr2](cr2) module"] -pub type CR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR2; -#[doc = "`read()` method returns [cr2::R](cr2::R) reader structure"] -impl crate::Readable for CR2 {} +#[doc = "CR2 register accessor: an alias for `Reg`"] +pub type CR2 = crate::Reg; #[doc = "Channel 2 Compare Value"] pub mod cr2; -#[doc = "Channel 2 Compare Shadow Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr2s](cr2s) module"] -pub type CR2S = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR2S; -#[doc = "`read()` method returns [cr2s::R](cr2s::R) reader structure"] -impl crate::Readable for CR2S {} -#[doc = "`write(|w| ..)` method takes [cr2s::W](cr2s::W) writer structure"] -impl crate::Writable for CR2S {} +#[doc = "CR2S register accessor: an alias for `Reg`"] +pub type CR2S = crate::Reg; #[doc = "Channel 2 Compare Shadow Value"] pub mod cr2s; -#[doc = "Channel Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chc](chc) module"] -pub type CHC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CHC; -#[doc = "`read()` method returns [chc::R](chc::R) reader structure"] -impl crate::Readable for CHC {} -#[doc = "`write(|w| ..)` method takes [chc::W](chc::W) writer structure"] -impl crate::Writable for CHC {} +#[doc = "CHC register accessor: an alias for `Reg`"] +pub type CHC = crate::Reg; #[doc = "Channel Control"] pub mod chc; -#[doc = "Dead Time Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtc](dtc) module"] -pub type DTC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTC; -#[doc = "`read()` method returns [dtc::R](dtc::R) reader structure"] -impl crate::Readable for DTC {} -#[doc = "`write(|w| ..)` method takes [dtc::W](dtc::W) writer structure"] -impl crate::Writable for DTC {} +#[doc = "DTC register accessor: an alias for `Reg`"] +pub type DTC = crate::Reg; #[doc = "Dead Time Control"] pub mod dtc; -#[doc = "Channel 1 Dead Time Values\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dc1r](dc1r) module"] -pub type DC1R = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DC1R; -#[doc = "`read()` method returns [dc1r::R](dc1r::R) reader structure"] -impl crate::Readable for DC1R {} -#[doc = "`write(|w| ..)` method takes [dc1r::W](dc1r::W) writer structure"] -impl crate::Writable for DC1R {} +#[doc = "DC1R register accessor: an alias for `Reg`"] +pub type DC1R = crate::Reg; #[doc = "Channel 1 Dead Time Values"] pub mod dc1r; -#[doc = "Channel 2 Dead Time Values\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dc2r](dc2r) module"] -pub type DC2R = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DC2R; -#[doc = "`read()` method returns [dc2r::R](dc2r::R) reader structure"] -impl crate::Readable for DC2R {} -#[doc = "`write(|w| ..)` method takes [dc2r::W](dc2r::W) writer structure"] -impl crate::Writable for DC2R {} +#[doc = "DC2R register accessor: an alias for `Reg`"] +pub type DC2R = crate::Reg; #[doc = "Channel 2 Dead Time Values"] pub mod dc2r; -#[doc = "Timer Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [timer](timer) module"] -pub type TIMER = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TIMER; -#[doc = "`read()` method returns [timer::R](timer::R) reader structure"] -impl crate::Readable for TIMER {} -#[doc = "`write(|w| ..)` method takes [timer::W](timer::W) writer structure"] -impl crate::Writable for TIMER {} +#[doc = "TIMER register accessor: an alias for `Reg`"] +pub type TIMER = crate::Reg; #[doc = "Timer Value"] pub mod timer; -#[doc = "Capture Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c0v](c0v) module"] -pub type C0V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C0V; -#[doc = "`read()` method returns [c0v::R](c0v::R) reader structure"] -impl crate::Readable for C0V {} +#[doc = "C0V register accessor: an alias for `Reg`"] +pub type C0V = crate::Reg; #[doc = "Capture Register 0"] pub mod c0v; -#[doc = "Capture Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c1v](c1v) module"] -pub type C1V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C1V; -#[doc = "`read()` method returns [c1v::R](c1v::R) reader structure"] -impl crate::Readable for C1V {} +#[doc = "C1V register accessor: an alias for `Reg`"] +pub type C1V = crate::Reg; #[doc = "Capture Register 1"] pub mod c1v; -#[doc = "Capture Register 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c2v](c2v) module"] -pub type C2V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C2V; -#[doc = "`read()` method returns [c2v::R](c2v::R) reader structure"] -impl crate::Readable for C2V {} +#[doc = "C2V register accessor: an alias for `Reg`"] +pub type C2V = crate::Reg; #[doc = "Capture Register 2"] pub mod c2v; -#[doc = "Capture Register 3\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c3v](c3v) module"] -pub type C3V = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _C3V; -#[doc = "`read()` method returns [c3v::R](c3v::R) reader structure"] -impl crate::Readable for C3V {} +#[doc = "C3V register accessor: an alias for `Reg`"] +pub type C3V = crate::Reg; #[doc = "Capture Register 3"] pub mod c3v; -#[doc = "Interrupt Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ints](ints) module"] -pub type INTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INTS; -#[doc = "`read()` method returns [ints::R](ints::R) reader structure"] -impl crate::Readable for INTS {} +#[doc = "INTS register accessor: an alias for `Reg`"] +pub type INTS = crate::Reg; #[doc = "Interrupt Status"] pub mod ints; -#[doc = "Interrupt Enable Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inte](inte) module"] -pub type INTE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INTE; -#[doc = "`read()` method returns [inte::R](inte::R) reader structure"] -impl crate::Readable for INTE {} -#[doc = "`write(|w| ..)` method takes [inte::W](inte::W) writer structure"] -impl crate::Writable for INTE {} +#[doc = "INTE register accessor: an alias for `Reg`"] +pub type INTE = crate::Reg; #[doc = "Interrupt Enable Control"] pub mod inte; -#[doc = "Service Request Selector\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srs](srs) module"] -pub type SRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRS; -#[doc = "`read()` method returns [srs::R](srs::R) reader structure"] -impl crate::Readable for SRS {} -#[doc = "`write(|w| ..)` method takes [srs::W](srs::W) writer structure"] -impl crate::Writable for SRS {} +#[doc = "SRS register accessor: an alias for `Reg`"] +pub type SRS = crate::Reg; #[doc = "Service Request Selector"] pub mod srs; -#[doc = "Interrupt Status Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](sws) module"] -pub type SWS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWS; -#[doc = "`write(|w| ..)` method takes [sws::W](sws::W) writer structure"] -impl crate::Writable for SWS {} +#[doc = "SWS register accessor: an alias for `Reg`"] +pub type SWS = crate::Reg; #[doc = "Interrupt Status Set"] pub mod sws; -#[doc = "Interrupt Status Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swr](swr) module"] -pub type SWR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWR; -#[doc = "`write(|w| ..)` method takes [swr::W](swr::W) writer structure"] -impl crate::Writable for SWR {} +#[doc = "SWR register accessor: an alias for `Reg`"] +pub type SWR = crate::Reg; #[doc = "Interrupt Status Clear"] pub mod swr; -#[doc = "Shadow transfer control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stc](stc) module"] -pub type STC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STC; -#[doc = "`read()` method returns [stc::R](stc::R) reader structure"] -impl crate::Readable for STC {} -#[doc = "`write(|w| ..)` method takes [stc::W](stc::W) writer structure"] -impl crate::Writable for STC {} +#[doc = "STC register accessor: an alias for `Reg`"] +pub type STC = crate::Reg; #[doc = "Shadow transfer control"] pub mod stc; diff --git a/src/ccu80_cc80/c0v.rs b/src/ccu80_cc80/c0v.rs index eb72260b..2364170c 100644 --- a/src/ccu80_cc80/c0v.rs +++ b/src/ccu80_cc80/c0v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C0V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C0V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c0v](index.html) module"] +pub struct C0V_SPEC; +impl crate::RegisterSpec for C0V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c0v::R](R) reader structure"] +impl crate::Readable for C0V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C0V to value 0"] +impl crate::Resettable for C0V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/c1v.rs b/src/ccu80_cc80/c1v.rs index 10012a33..55710fd5 100644 --- a/src/ccu80_cc80/c1v.rs +++ b/src/ccu80_cc80/c1v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C1V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C1V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c1v](index.html) module"] +pub struct C1V_SPEC; +impl crate::RegisterSpec for C1V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c1v::R](R) reader structure"] +impl crate::Readable for C1V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C1V to value 0"] +impl crate::Resettable for C1V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/c2v.rs b/src/ccu80_cc80/c2v.rs index b5f91bd6..1f42e7e5 100644 --- a/src/ccu80_cc80/c2v.rs +++ b/src/ccu80_cc80/c2v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C2V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C2V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c2v](index.html) module"] +pub struct C2V_SPEC; +impl crate::RegisterSpec for C2V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c2v::R](R) reader structure"] +impl crate::Readable for C2V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C2V to value 0"] +impl crate::Resettable for C2V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/c3v.rs b/src/ccu80_cc80/c3v.rs index 5899571b..16fb0f42 100644 --- a/src/ccu80_cc80/c3v.rs +++ b/src/ccu80_cc80/c3v.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register C3V"] -pub type R = crate::R; -#[doc = "Reader of field `CAPTV`"] -pub type CAPTV_R = crate::R; -#[doc = "Reader of field `FPCV`"] -pub type FPCV_R = crate::R; +#[doc = "Register `C3V` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CAPTV` reader - Capture Value"] +pub struct CAPTV_R(crate::FieldReader); +impl CAPTV_R { + pub(crate) fn new(bits: u16) -> Self { + CAPTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CAPTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPCV` reader - Prescaler Value"] +pub struct FPCV_R(crate::FieldReader); +impl FPCV_R { + pub(crate) fn new(bits: u8) -> Self { + FPCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FPCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Full Flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FFL_A { @@ -18,9 +55,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFL`"] -pub type FFL_R = crate::R; +#[doc = "Field `FFL` reader - Full Flag"] +pub struct FFL_R(crate::FieldReader); impl FFL_R { + pub(crate) fn new(bits: bool) -> Self { + FFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFL_A { @@ -32,12 +72,19 @@ impl FFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFL_A::VALUE1 + **self == FFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFL_A::VALUE2 + **self == FFL_A::VALUE2 + } +} +impl core::ops::Deref for FFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -57,3 +104,19 @@ impl R { FFL_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Capture Register 3\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c3v](index.html) module"] +pub struct C3V_SPEC; +impl crate::RegisterSpec for C3V_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [c3v::R](R) reader structure"] +impl crate::Readable for C3V_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets C3V to value 0"] +impl crate::Resettable for C3V_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/chc.rs b/src/ccu80_cc80/chc.rs index 6bc7c9a9..8490a87f 100644 --- a/src/ccu80_cc80/chc.rs +++ b/src/ccu80_cc80/chc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CHC"] -pub type R = crate::R; -#[doc = "Writer for register CHC"] -pub type W = crate::W; -#[doc = "Register CHC `reset()`'s with value 0"] -impl crate::ResetValue for super::CHC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CHC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Asymmetric PWM mode Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASE`"] -pub type ASE_R = crate::R; +#[doc = "Field `ASE` reader - Asymmetric PWM mode Enable"] +pub struct ASE_R(crate::FieldReader); impl ASE_R { + pub(crate) fn new(bits: bool) -> Self { + ASE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASE_A { @@ -38,15 +65,22 @@ impl ASE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASE_A::VALUE1 + **self == ASE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASE_A::VALUE2 + **self == ASE_A::VALUE2 + } +} +impl core::ops::Deref for ASE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASE`"] +#[doc = "Field `ASE` writer - Asymmetric PWM mode Enable"] pub struct ASE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ASE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Asymmetric PWM is disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ASE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS1`"] -pub type OCS1_R = crate::R; +#[doc = "Field `OCS1` reader - Output selector for CCU8x.OUTy0"] +pub struct OCS1_R(crate::FieldReader); impl OCS1_R { + pub(crate) fn new(bits: bool) -> Self { + OCS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS1_A { @@ -113,15 +148,22 @@ impl OCS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS1_A::VALUE1 + **self == OCS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS1_A::VALUE2 + **self == OCS1_A::VALUE2 + } +} +impl core::ops::Deref for OCS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OCS1`"] +#[doc = "Field `OCS1` writer - Output selector for CCU8x.OUTy0"] pub struct OCS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> OCS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy0"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> OCS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS2`"] -pub type OCS2_R = crate::R; +#[doc = "Field `OCS2` reader - Output selector for CCU8x.OUTy1"] +pub struct OCS2_R(crate::FieldReader); impl OCS2_R { + pub(crate) fn new(bits: bool) -> Self { + OCS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS2_A { @@ -188,15 +231,22 @@ impl OCS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS2_A::VALUE1 + **self == OCS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS2_A::VALUE2 + **self == OCS2_A::VALUE2 + } +} +impl core::ops::Deref for OCS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OCS2`"] +#[doc = "Field `OCS2` writer - Output selector for CCU8x.OUTy1"] pub struct OCS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> OCS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> OCS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS3`"] -pub type OCS3_R = crate::R; +#[doc = "Field `OCS3` reader - Output selector for CCU8x.OUTy2"] +pub struct OCS3_R(crate::FieldReader); impl OCS3_R { + pub(crate) fn new(bits: bool) -> Self { + OCS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS3_A { @@ -263,15 +314,22 @@ impl OCS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS3_A::VALUE1 + **self == OCS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS3_A::VALUE2 + **self == OCS3_A::VALUE2 } } -#[doc = "Write proxy for field `OCS3`"] +impl core::ops::Deref for OCS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OCS3` writer - Output selector for CCU8x.OUTy2"] pub struct OCS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> OCS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy2"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> OCS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS4`"] -pub type OCS4_R = crate::R; +#[doc = "Field `OCS4` reader - Output selector for CCU8x.OUTy3"] +pub struct OCS4_R(crate::FieldReader); impl OCS4_R { + pub(crate) fn new(bits: bool) -> Self { + OCS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS4_A { @@ -338,15 +397,22 @@ impl OCS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS4_A::VALUE1 + **self == OCS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS4_A::VALUE2 + **self == OCS4_A::VALUE2 + } +} +impl core::ops::Deref for OCS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OCS4`"] +#[doc = "Field `OCS4` writer - Output selector for CCU8x.OUTy3"] pub struct OCS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> OCS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> OCS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -438,4 +502,30 @@ impl W { pub fn ocs4(&mut self) -> OCS4_W { OCS4_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Control\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 [chc](index.html) module"] +pub struct CHC_SPEC; +impl crate::RegisterSpec for CHC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chc::R](R) reader structure"] +impl crate::Readable for CHC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chc::W](W) writer structure"] +impl crate::Writable for CHC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHC to value 0"] +impl crate::Resettable for CHC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/cmc.rs b/src/ccu80_cc80/cmc.rs index c8d61c76..b003fe98 100644 --- a/src/ccu80_cc80/cmc.rs +++ b/src/ccu80_cc80/cmc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CMC"] -pub type R = crate::R; -#[doc = "Writer for register CMC"] -pub type W = crate::W; -#[doc = "Register CMC `reset()`'s with value 0"] -impl crate::ResetValue for super::CMC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CMC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CMC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "External Start Functionality Selector\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STRTS`"] -pub type STRTS_R = crate::R; +#[doc = "Field `STRTS` reader - External Start Functionality Selector"] +pub struct STRTS_R(crate::FieldReader); impl STRTS_R { + pub(crate) fn new(bits: u8) -> Self { + STRTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRTS_A { @@ -46,25 +73,32 @@ impl STRTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRTS_A::VALUE1 + **self == STRTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRTS_A::VALUE2 + **self == STRTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STRTS_A::VALUE3 + **self == STRTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STRTS_A::VALUE4 + **self == STRTS_A::VALUE4 + } +} +impl core::ops::Deref for STRTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STRTS`"] +#[doc = "Field `STRTS` writer - External Start Functionality Selector"] pub struct STRTS_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> STRTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STRTS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Start Function deactivated"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> STRTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENDS`"] -pub type ENDS_R = crate::R; +#[doc = "Field `ENDS` reader - External Stop Functionality Selector"] +pub struct ENDS_R(crate::FieldReader); impl ENDS_R { + pub(crate) fn new(bits: u8) -> Self { + ENDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENDS_A { @@ -139,25 +174,32 @@ impl ENDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDS_A::VALUE1 + **self == ENDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDS_A::VALUE2 + **self == ENDS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENDS_A::VALUE3 + **self == ENDS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENDS_A::VALUE4 + **self == ENDS_A::VALUE4 + } +} +impl core::ops::Deref for ENDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENDS`"] +#[doc = "Field `ENDS` writer - External Stop Functionality Selector"] pub struct ENDS_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> ENDS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENDS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Stop Function deactivated"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> ENDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAP0S`"] -pub type CAP0S_R = crate::R; +#[doc = "Field `CAP0S` reader - External Capture 0 Functionality Selector"] +pub struct CAP0S_R(crate::FieldReader); impl CAP0S_R { + pub(crate) fn new(bits: u8) -> Self { + CAP0S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAP0S_A { @@ -232,25 +275,32 @@ impl CAP0S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAP0S_A::VALUE1 + **self == CAP0S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAP0S_A::VALUE2 + **self == CAP0S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAP0S_A::VALUE3 + **self == CAP0S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAP0S_A::VALUE4 + **self == CAP0S_A::VALUE4 } } -#[doc = "Write proxy for field `CAP0S`"] +impl core::ops::Deref for CAP0S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAP0S` writer - External Capture 0 Functionality Selector"] pub struct CAP0S_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> CAP0S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAP0S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Capture 0 Function deactivated"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> CAP0S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAP1S`"] -pub type CAP1S_R = crate::R; +#[doc = "Field `CAP1S` reader - External Capture 1 Functionality Selector"] +pub struct CAP1S_R(crate::FieldReader); impl CAP1S_R { + pub(crate) fn new(bits: u8) -> Self { + CAP1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAP1S_A { @@ -325,25 +376,32 @@ impl CAP1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAP1S_A::VALUE1 + **self == CAP1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAP1S_A::VALUE2 + **self == CAP1S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAP1S_A::VALUE3 + **self == CAP1S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAP1S_A::VALUE4 + **self == CAP1S_A::VALUE4 } } -#[doc = "Write proxy for field `CAP1S`"] +impl core::ops::Deref for CAP1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAP1S` writer - External Capture 1 Functionality Selector"] pub struct CAP1S_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> CAP1S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAP1S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Capture 1 Function deactivated"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> CAP1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `GATES`"] -pub type GATES_R = crate::R; +#[doc = "Field `GATES` reader - External Gate Functionality Selector"] +pub struct GATES_R(crate::FieldReader); impl GATES_R { + pub(crate) fn new(bits: u8) -> Self { + GATES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GATES_A { @@ -418,25 +477,32 @@ impl GATES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GATES_A::VALUE1 + **self == GATES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GATES_A::VALUE2 + **self == GATES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == GATES_A::VALUE3 + **self == GATES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == GATES_A::VALUE4 + **self == GATES_A::VALUE4 + } +} +impl core::ops::Deref for GATES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GATES`"] +#[doc = "Field `GATES` writer - External Gate Functionality Selector"] pub struct GATES_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> GATES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GATES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Gating Function deactivated"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> GATES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -494,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `UDS`"] -pub type UDS_R = crate::R; +#[doc = "Field `UDS` reader - External Up/Down Functionality Selector"] +pub struct UDS_R(crate::FieldReader); impl UDS_R { + pub(crate) fn new(bits: u8) -> Self { + UDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UDS_A { @@ -511,25 +578,32 @@ impl UDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UDS_A::VALUE1 + **self == UDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UDS_A::VALUE2 + **self == UDS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == UDS_A::VALUE3 + **self == UDS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == UDS_A::VALUE4 + **self == UDS_A::VALUE4 } } -#[doc = "Write proxy for field `UDS`"] +impl core::ops::Deref for UDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UDS` writer - External Up/Down Functionality Selector"] pub struct UDS_W<'a> { w: &'a mut W, } @@ -537,9 +611,7 @@ impl<'a> UDS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UDS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Up/Down Function deactivated"] #[inline(always)] @@ -564,13 +636,25 @@ impl<'a> UDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } -#[doc = "Reader of field `LDS`"] -pub type LDS_R = crate::R; -#[doc = "Write proxy for field `LDS`"] +#[doc = "Field `LDS` reader - External Timer Load Functionality Selector"] +pub struct LDS_R(crate::FieldReader); +impl LDS_R { + pub(crate) fn new(bits: u8) -> Self { + LDS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LDS` writer - External Timer Load Functionality Selector"] pub struct LDS_W<'a> { w: &'a mut W, } @@ -578,7 +662,7 @@ impl<'a> LDS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -601,9 +685,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CNTS`"] -pub type CNTS_R = crate::R; +#[doc = "Field `CNTS` reader - External Count Selector"] +pub struct CNTS_R(crate::FieldReader); impl CNTS_R { + pub(crate) fn new(bits: u8) -> Self { + CNTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CNTS_A { @@ -618,25 +705,32 @@ impl CNTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CNTS_A::VALUE1 + **self == CNTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CNTS_A::VALUE2 + **self == CNTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CNTS_A::VALUE3 + **self == CNTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CNTS_A::VALUE4 + **self == CNTS_A::VALUE4 + } +} +impl core::ops::Deref for CNTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CNTS`"] +#[doc = "Field `CNTS` writer - External Count Selector"] pub struct CNTS_W<'a> { w: &'a mut W, } @@ -644,9 +738,7 @@ impl<'a> CNTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CNTS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Count Function deactivated"] #[inline(always)] @@ -671,7 +763,7 @@ impl<'a> CNTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -689,9 +781,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OFS`"] -pub type OFS_R = crate::R; +#[doc = "Field `OFS` reader - Override Function Selector"] +pub struct OFS_R(crate::FieldReader); impl OFS_R { + pub(crate) fn new(bits: bool) -> Self { + OFS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OFS_A { @@ -703,15 +798,22 @@ impl OFS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OFS_A::VALUE1 + **self == OFS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OFS_A::VALUE2 + **self == OFS_A::VALUE2 + } +} +impl core::ops::Deref for OFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OFS`"] +#[doc = "Field `OFS` writer - Override Function Selector"] pub struct OFS_W<'a> { w: &'a mut W, } @@ -719,9 +821,7 @@ impl<'a> OFS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OFS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Override functionality disabled"] #[inline(always)] @@ -746,7 +846,7 @@ impl<'a> OFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -764,9 +864,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TS`"] -pub type TS_R = crate::R; +#[doc = "Field `TS` reader - Trap Function Selector"] +pub struct TS_R(crate::FieldReader); impl TS_R { + pub(crate) fn new(bits: bool) -> Self { + TS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TS_A { @@ -778,15 +881,22 @@ impl TS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TS_A::VALUE1 + **self == TS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TS_A::VALUE2 + **self == TS_A::VALUE2 + } +} +impl core::ops::Deref for TS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TS`"] +#[doc = "Field `TS` writer - Trap Function Selector"] pub struct TS_W<'a> { w: &'a mut W, } @@ -794,9 +904,7 @@ impl<'a> TS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap function disabled"] #[inline(always)] @@ -821,13 +929,25 @@ impl<'a> TS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `MOS`"] -pub type MOS_R = crate::R; -#[doc = "Write proxy for field `MOS`"] +#[doc = "Field `MOS` reader - External Modulation Functionality Selector"] +pub struct MOS_R(crate::FieldReader); +impl MOS_R { + pub(crate) fn new(bits: u8) -> Self { + MOS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOS` writer - External Modulation Functionality Selector"] pub struct MOS_W<'a> { w: &'a mut W, } @@ -835,7 +955,7 @@ impl<'a> MOS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -853,9 +973,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TCE`"] -pub type TCE_R = crate::R; +#[doc = "Field `TCE` reader - Timer Concatenation Enable"] +pub struct TCE_R(crate::FieldReader); impl TCE_R { + pub(crate) fn new(bits: bool) -> Self { + TCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TCE_A { @@ -867,15 +990,22 @@ impl TCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TCE_A::VALUE1 + **self == TCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TCE_A::VALUE2 + **self == TCE_A::VALUE2 + } +} +impl core::ops::Deref for TCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TCE`"] +#[doc = "Field `TCE` writer - Timer Concatenation Enable"] pub struct TCE_W<'a> { w: &'a mut W, } @@ -883,9 +1013,7 @@ impl<'a> TCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Timer concatenation is disabled"] #[inline(always)] @@ -910,7 +1038,7 @@ impl<'a> TCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -1037,4 +1165,30 @@ impl W { pub fn tce(&mut self) -> TCE_W { TCE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Connection Matrix Control\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 [cmc](index.html) module"] +pub struct CMC_SPEC; +impl crate::RegisterSpec for CMC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cmc::R](R) reader structure"] +impl crate::Readable for CMC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cmc::W](W) writer structure"] +impl crate::Writable for CMC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CMC to value 0"] +impl crate::Resettable for CMC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/cr1.rs b/src/ccu80_cc80/cr1.rs index 0c24ea85..bcce526f 100644 --- a/src/ccu80_cc80/cr1.rs +++ b/src/ccu80_cc80/cr1.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register CR1"] -pub type R = crate::R; -#[doc = "Reader of field `CR1`"] -pub type CR1_R = crate::R; +#[doc = "Register `CR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CR1` reader - Compare Register for Channel 1"] +pub struct CR1_R(crate::FieldReader); +impl CR1_R { + pub(crate) fn new(bits: u16) -> Self { + CR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Compare Register for Channel 1"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { CR1_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Channel 1 Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](index.html) module"] +pub struct CR1_SPEC; +impl crate::RegisterSpec for CR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr1::R](R) reader structure"] +impl crate::Readable for CR1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CR1 to value 0"] +impl crate::Resettable for CR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/cr1s.rs b/src/ccu80_cc80/cr1s.rs index e2022df1..590a3645 100644 --- a/src/ccu80_cc80/cr1s.rs +++ b/src/ccu80_cc80/cr1s.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CR1S"] -pub type R = crate::R; -#[doc = "Writer for register CR1S"] -pub type W = crate::W; -#[doc = "Register CR1S `reset()`'s with value 0"] -impl crate::ResetValue for super::CR1S { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CR1S` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CR1S` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CR1S`"] -pub type CR1S_R = crate::R; -#[doc = "Write proxy for field `CR1S`"] +#[doc = "Field `CR1S` reader - Shadow Compare Register for Channel 1"] +pub struct CR1S_R(crate::FieldReader); +impl CR1S_R { + pub(crate) fn new(bits: u16) -> Self { + CR1S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CR1S` writer - Shadow Compare Register for Channel 1"] pub struct CR1S_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CR1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn cr1s(&mut self) -> CR1S_W { CR1S_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel 1 Compare Shadow Value\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 [cr1s](index.html) module"] +pub struct CR1S_SPEC; +impl crate::RegisterSpec for CR1S_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr1s::R](R) reader structure"] +impl crate::Readable for CR1S_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cr1s::W](W) writer structure"] +impl crate::Writable for CR1S_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CR1S to value 0"] +impl crate::Resettable for CR1S_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/cr2.rs b/src/ccu80_cc80/cr2.rs index 0c10189f..89b361ee 100644 --- a/src/ccu80_cc80/cr2.rs +++ b/src/ccu80_cc80/cr2.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register CR2"] -pub type R = crate::R; -#[doc = "Reader of field `CR2`"] -pub type CR2_R = crate::R; +#[doc = "Register `CR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CR2` reader - Compare Register for Channel 2"] +pub struct CR2_R(crate::FieldReader); +impl CR2_R { + pub(crate) fn new(bits: u16) -> Self { + CR2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Compare Register for Channel 2"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { CR2_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Channel 2 Compare Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr2](index.html) module"] +pub struct CR2_SPEC; +impl crate::RegisterSpec for CR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr2::R](R) reader structure"] +impl crate::Readable for CR2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CR2 to value 0"] +impl crate::Resettable for CR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/cr2s.rs b/src/ccu80_cc80/cr2s.rs index 6af5c88c..6da71d10 100644 --- a/src/ccu80_cc80/cr2s.rs +++ b/src/ccu80_cc80/cr2s.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CR2S"] -pub type R = crate::R; -#[doc = "Writer for register CR2S"] -pub type W = crate::W; -#[doc = "Register CR2S `reset()`'s with value 0"] -impl crate::ResetValue for super::CR2S { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CR2S` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CR2S` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CR2S`"] -pub type CR2S_R = crate::R; -#[doc = "Write proxy for field `CR2S`"] +#[doc = "Field `CR2S` reader - Shadow Compare Register for Channel 2"] +pub struct CR2S_R(crate::FieldReader); +impl CR2S_R { + pub(crate) fn new(bits: u16) -> Self { + CR2S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CR2S` writer - Shadow Compare Register for Channel 2"] pub struct CR2S_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CR2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn cr2s(&mut self) -> CR2S_W { CR2S_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel 2 Compare Shadow Value\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 [cr2s](index.html) module"] +pub struct CR2S_SPEC; +impl crate::RegisterSpec for CR2S_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr2s::R](R) reader structure"] +impl crate::Readable for CR2S_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cr2s::W](W) writer structure"] +impl crate::Writable for CR2S_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CR2S to value 0"] +impl crate::Resettable for CR2S_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/dc1r.rs b/src/ccu80_cc80/dc1r.rs index 99eb4b83..2f91ab1e 100644 --- a/src/ccu80_cc80/dc1r.rs +++ b/src/ccu80_cc80/dc1r.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DC1R"] -pub type R = crate::R; -#[doc = "Writer for register DC1R"] -pub type W = crate::W; -#[doc = "Register DC1R `reset()`'s with value 0"] -impl crate::ResetValue for super::DC1R { - type Type = u32; +#[doc = "Register `DC1R` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DC1R` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DT1R` reader - Rise Value for Dead Time of Channel 1"] +pub struct DT1R_R(crate::FieldReader); +impl DT1R_R { + pub(crate) fn new(bits: u8) -> Self { + DT1R_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DT1R_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DT1R`"] -pub type DT1R_R = crate::R; -#[doc = "Write proxy for field `DT1R`"] +#[doc = "Field `DT1R` writer - Rise Value for Dead Time of Channel 1"] pub struct DT1R_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DT1R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `DT1F`"] -pub type DT1F_R = crate::R; -#[doc = "Write proxy for field `DT1F`"] +#[doc = "Field `DT1F` reader - Fall Value for Dead Time of Channel 1"] +pub struct DT1F_R(crate::FieldReader); +impl DT1F_R { + pub(crate) fn new(bits: u8) -> Self { + DT1F_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DT1F_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DT1F` writer - Fall Value for Dead Time of Channel 1"] pub struct DT1F_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> DT1F_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn dt1f(&mut self) -> DT1F_W { DT1F_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel 1 Dead Time Values\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 [dc1r](index.html) module"] +pub struct DC1R_SPEC; +impl crate::RegisterSpec for DC1R_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dc1r::R](R) reader structure"] +impl crate::Readable for DC1R_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dc1r::W](W) writer structure"] +impl crate::Writable for DC1R_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DC1R to value 0"] +impl crate::Resettable for DC1R_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/dc2r.rs b/src/ccu80_cc80/dc2r.rs index 9d1aa146..b3cecf63 100644 --- a/src/ccu80_cc80/dc2r.rs +++ b/src/ccu80_cc80/dc2r.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DC2R"] -pub type R = crate::R; -#[doc = "Writer for register DC2R"] -pub type W = crate::W; -#[doc = "Register DC2R `reset()`'s with value 0"] -impl crate::ResetValue for super::DC2R { - type Type = u32; +#[doc = "Register `DC2R` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DC2R` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DT2R` reader - Rise Value for Dead Time of Channel 2"] +pub struct DT2R_R(crate::FieldReader); +impl DT2R_R { + pub(crate) fn new(bits: u8) -> Self { + DT2R_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DT2R_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DT2R`"] -pub type DT2R_R = crate::R; -#[doc = "Write proxy for field `DT2R`"] +#[doc = "Field `DT2R` writer - Rise Value for Dead Time of Channel 2"] pub struct DT2R_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DT2R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `DT2F`"] -pub type DT2F_R = crate::R; -#[doc = "Write proxy for field `DT2F`"] +#[doc = "Field `DT2F` reader - Fall Value for Dead Time of Channel 2"] +pub struct DT2F_R(crate::FieldReader); +impl DT2F_R { + pub(crate) fn new(bits: u8) -> Self { + DT2F_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DT2F_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DT2F` writer - Fall Value for Dead Time of Channel 2"] pub struct DT2F_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> DT2F_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn dt2f(&mut self) -> DT2F_W { DT2F_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel 2 Dead Time Values\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 [dc2r](index.html) module"] +pub struct DC2R_SPEC; +impl crate::RegisterSpec for DC2R_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dc2r::R](R) reader structure"] +impl crate::Readable for DC2R_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dc2r::W](W) writer structure"] +impl crate::Writable for DC2R_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DC2R to value 0"] +impl crate::Resettable for DC2R_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/dit.rs b/src/ccu80_cc80/dit.rs index 7b74829e..d5b75291 100644 --- a/src/ccu80_cc80/dit.rs +++ b/src/ccu80_cc80/dit.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register DIT"] -pub type R = crate::R; -#[doc = "Reader of field `DCV`"] -pub type DCV_R = crate::R; -#[doc = "Reader of field `DCNT`"] -pub type DCNT_R = crate::R; +#[doc = "Register `DIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DCV` reader - Dither compare Value"] +pub struct DCV_R(crate::FieldReader); +impl DCV_R { + pub(crate) fn new(bits: u8) -> Self { + DCV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCNT` reader - Dither counter actual value"] +pub struct DCNT_R(crate::FieldReader); +impl DCNT_R { + pub(crate) fn new(bits: u8) -> Self { + DCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:3 - Dither compare Value"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { DCNT_R::new(((self.bits >> 8) & 0x0f) as u8) } } +#[doc = "Dither Config\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dit](index.html) module"] +pub struct DIT_SPEC; +impl crate::RegisterSpec for DIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dit::R](R) reader structure"] +impl crate::Readable for DIT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DIT to value 0"] +impl crate::Resettable for DIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/dits.rs b/src/ccu80_cc80/dits.rs index c5c9267e..e7ee6a09 100644 --- a/src/ccu80_cc80/dits.rs +++ b/src/ccu80_cc80/dits.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DITS"] -pub type R = crate::R; -#[doc = "Writer for register DITS"] -pub type W = crate::W; -#[doc = "Register DITS `reset()`'s with value 0"] -impl crate::ResetValue for super::DITS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DITS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DITS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DCVS`"] -pub type DCVS_R = crate::R; -#[doc = "Write proxy for field `DCVS`"] +#[doc = "Field `DCVS` reader - Dither Shadow Compare Value"] +pub struct DCVS_R(crate::FieldReader); +impl DCVS_R { + pub(crate) fn new(bits: u8) -> Self { + DCVS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCVS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCVS` writer - Dither Shadow Compare Value"] pub struct DCVS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DCVS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dcvs(&mut self) -> DCVS_W { DCVS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Dither Shadow Register\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 [dits](index.html) module"] +pub struct DITS_SPEC; +impl crate::RegisterSpec for DITS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dits::R](R) reader structure"] +impl crate::Readable for DITS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dits::W](W) writer structure"] +impl crate::Writable for DITS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DITS to value 0"] +impl crate::Resettable for DITS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/dtc.rs b/src/ccu80_cc80/dtc.rs index 1e0e2a44..f9a6654e 100644 --- a/src/ccu80_cc80/dtc.rs +++ b/src/ccu80_cc80/dtc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DTC"] -pub type R = crate::R; -#[doc = "Writer for register DTC"] -pub type W = crate::W; -#[doc = "Register DTC `reset()`'s with value 0"] -impl crate::ResetValue for super::DTC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DTC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DTC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Dead Time Enable for Channel 1\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTE1`"] -pub type DTE1_R = crate::R; +#[doc = "Field `DTE1` reader - Dead Time Enable for Channel 1"] +pub struct DTE1_R(crate::FieldReader); impl DTE1_R { + pub(crate) fn new(bits: bool) -> Self { + DTE1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTE1_A { @@ -38,15 +65,22 @@ impl DTE1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTE1_A::VALUE1 + **self == DTE1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTE1_A::VALUE2 + **self == DTE1_A::VALUE2 } } -#[doc = "Write proxy for field `DTE1`"] +impl core::ops::Deref for DTE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTE1` writer - Dead Time Enable for Channel 1"] pub struct DTE1_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> DTE1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTE1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for channel 1 is disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> DTE1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTE2`"] -pub type DTE2_R = crate::R; +#[doc = "Field `DTE2` reader - Dead Time Enable for Channel 2"] +pub struct DTE2_R(crate::FieldReader); impl DTE2_R { + pub(crate) fn new(bits: bool) -> Self { + DTE2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTE2_A { @@ -113,15 +148,22 @@ impl DTE2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTE2_A::VALUE1 + **self == DTE2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTE2_A::VALUE2 + **self == DTE2_A::VALUE2 + } +} +impl core::ops::Deref for DTE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DTE2`"] +#[doc = "Field `DTE2` writer - Dead Time Enable for Channel 2"] pub struct DTE2_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> DTE2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTE2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for channel 2 is disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> DTE2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCEN1`"] -pub type DCEN1_R = crate::R; +#[doc = "Field `DCEN1` reader - Dead Time Enable for CC8yST1"] +pub struct DCEN1_R(crate::FieldReader); impl DCEN1_R { + pub(crate) fn new(bits: bool) -> Self { + DCEN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCEN1_A { @@ -188,15 +231,22 @@ impl DCEN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCEN1_A::VALUE1 + **self == DCEN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCEN1_A::VALUE2 + **self == DCEN1_A::VALUE2 } } -#[doc = "Write proxy for field `DCEN1`"] +impl core::ops::Deref for DCEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCEN1` writer - Dead Time Enable for CC8yST1"] pub struct DCEN1_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> DCEN1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCEN1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for CC8yST1 path is disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> DCEN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCEN2`"] -pub type DCEN2_R = crate::R; +#[doc = "Field `DCEN2` reader - Dead Time Enable for inverted CC8yST1"] +pub struct DCEN2_R(crate::FieldReader); impl DCEN2_R { + pub(crate) fn new(bits: bool) -> Self { + DCEN2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCEN2_A { @@ -263,15 +314,22 @@ impl DCEN2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCEN2_A::VALUE1 + **self == DCEN2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCEN2_A::VALUE2 + **self == DCEN2_A::VALUE2 + } +} +impl core::ops::Deref for DCEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DCEN2`"] +#[doc = "Field `DCEN2` writer - Dead Time Enable for inverted CC8yST1"] pub struct DCEN2_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> DCEN2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCEN2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for inverted CC8yST1 path is disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> DCEN2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCEN3`"] -pub type DCEN3_R = crate::R; +#[doc = "Field `DCEN3` reader - Dead Time Enable for CC8yST2"] +pub struct DCEN3_R(crate::FieldReader); impl DCEN3_R { + pub(crate) fn new(bits: bool) -> Self { + DCEN3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCEN3_A { @@ -338,15 +397,22 @@ impl DCEN3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCEN3_A::VALUE1 + **self == DCEN3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCEN3_A::VALUE2 + **self == DCEN3_A::VALUE2 } } -#[doc = "Write proxy for field `DCEN3`"] +impl core::ops::Deref for DCEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCEN3` writer - Dead Time Enable for CC8yST2"] pub struct DCEN3_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> DCEN3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCEN3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for CC8yST2 path is disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> DCEN3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCEN4`"] -pub type DCEN4_R = crate::R; +#[doc = "Field `DCEN4` reader - Dead Time Enable for inverted CC8yST2"] +pub struct DCEN4_R(crate::FieldReader); impl DCEN4_R { + pub(crate) fn new(bits: bool) -> Self { + DCEN4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCEN4_A { @@ -413,15 +480,22 @@ impl DCEN4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCEN4_A::VALUE1 + **self == DCEN4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCEN4_A::VALUE2 + **self == DCEN4_A::VALUE2 } } -#[doc = "Write proxy for field `DCEN4`"] +impl core::ops::Deref for DCEN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCEN4` writer - Dead Time Enable for inverted CC8yST2"] pub struct DCEN4_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> DCEN4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCEN4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead Time for inverted CC8yST2 path is disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> DCEN4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -479,9 +551,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DTCC`"] -pub type DTCC_R = crate::R; +#[doc = "Field `DTCC` reader - Dead Time clock control"] +pub struct DTCC_R(crate::FieldReader); impl DTCC_R { + pub(crate) fn new(bits: u8) -> Self { + DTCC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTCC_A { @@ -496,25 +571,32 @@ impl DTCC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTCC_A::VALUE1 + **self == DTCC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTCC_A::VALUE2 + **self == DTCC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DTCC_A::VALUE3 + **self == DTCC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DTCC_A::VALUE4 + **self == DTCC_A::VALUE4 + } +} +impl core::ops::Deref for DTCC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DTCC`"] +#[doc = "Field `DTCC` writer - Dead Time clock control"] pub struct DTCC_W<'a> { w: &'a mut W, } @@ -522,9 +604,7 @@ impl<'a> DTCC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTCC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "ftclk"] #[inline(always)] @@ -549,7 +629,7 @@ impl<'a> DTCC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -626,4 +706,30 @@ impl W { pub fn dtcc(&mut self) -> DTCC_W { DTCC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Dead Time Control\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 [dtc](index.html) module"] +pub struct DTC_SPEC; +impl crate::RegisterSpec for DTC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtc::R](R) reader structure"] +impl crate::Readable for DTC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dtc::W](W) writer structure"] +impl crate::Writable for DTC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DTC to value 0"] +impl crate::Resettable for DTC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/fpc.rs b/src/ccu80_cc80/fpc.rs index 8c7437c7..0ac6545f 100644 --- a/src/ccu80_cc80/fpc.rs +++ b/src/ccu80_cc80/fpc.rs @@ -1,20 +1,68 @@ -#[doc = "Reader of register FPC"] -pub type R = crate::R; -#[doc = "Writer for register FPC"] -pub type W = crate::W; -#[doc = "Register FPC `reset()`'s with value 0"] -impl crate::ResetValue for super::FPC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `PCMP`"] -pub type PCMP_R = crate::R; -#[doc = "Reader of field `PVAL`"] -pub type PVAL_R = crate::R; -#[doc = "Write proxy for field `PVAL`"] +#[doc = "Register `FPC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PCMP` reader - Floating Prescaler Compare Value"] +pub struct PCMP_R(crate::FieldReader); +impl PCMP_R { + pub(crate) fn new(bits: u8) -> Self { + PCMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PVAL` reader - Actual Prescaler Value"] +pub struct PVAL_R(crate::FieldReader); +impl PVAL_R { + pub(crate) fn new(bits: u8) -> Self { + PVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PVAL` writer - Actual Prescaler Value"] pub struct PVAL_W<'a> { w: &'a mut W, } @@ -22,7 +70,7 @@ impl<'a> PVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -44,4 +92,30 @@ impl W { pub fn pval(&mut self) -> PVAL_W { PVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating Prescaler Control\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 [fpc](index.html) module"] +pub struct FPC_SPEC; +impl crate::RegisterSpec for FPC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpc::R](R) reader structure"] +impl crate::Readable for FPC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpc::W](W) writer structure"] +impl crate::Writable for FPC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPC to value 0"] +impl crate::Resettable for FPC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/fpcs.rs b/src/ccu80_cc80/fpcs.rs index aee1a033..1e6b5f15 100644 --- a/src/ccu80_cc80/fpcs.rs +++ b/src/ccu80_cc80/fpcs.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FPCS"] -pub type R = crate::R; -#[doc = "Writer for register FPCS"] -pub type W = crate::W; -#[doc = "Register FPCS `reset()`'s with value 0"] -impl crate::ResetValue for super::FPCS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPCS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FPCS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PCMP`"] -pub type PCMP_R = crate::R; -#[doc = "Write proxy for field `PCMP`"] +#[doc = "Field `PCMP` reader - Floating Prescaler Shadow Compare Value"] +pub struct PCMP_R(crate::FieldReader); +impl PCMP_R { + pub(crate) fn new(bits: u8) -> Self { + PCMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCMP` writer - Floating Prescaler Shadow Compare Value"] pub struct PCMP_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn pcmp(&mut self) -> PCMP_W { PCMP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating Prescaler Shadow\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 [fpcs](index.html) module"] +pub struct FPCS_SPEC; +impl crate::RegisterSpec for FPCS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpcs::R](R) reader structure"] +impl crate::Readable for FPCS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpcs::W](W) writer structure"] +impl crate::Writable for FPCS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPCS to value 0"] +impl crate::Resettable for FPCS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/ins.rs b/src/ccu80_cc80/ins.rs index dd6cdd57..884e7b10 100644 --- a/src/ccu80_cc80/ins.rs +++ b/src/ccu80_cc80/ins.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register INS"] -pub type R = crate::R; -#[doc = "Writer for register INS"] -pub type W = crate::W; -#[doc = "Register INS `reset()`'s with value 0"] -impl crate::ResetValue for super::INS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `INS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Event 0 signal selection\n\nValue on reset: 0"] @@ -53,9 +77,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV0IS`"] -pub type EV0IS_R = crate::R; +#[doc = "Field `EV0IS` reader - Event 0 signal selection"] +pub struct EV0IS_R(crate::FieldReader); impl EV0IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV0IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0IS_A { @@ -82,85 +109,92 @@ impl EV0IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0IS_A::VALUE1 + **self == EV0IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0IS_A::VALUE2 + **self == EV0IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV0IS_A::VALUE3 + **self == EV0IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV0IS_A::VALUE4 + **self == EV0IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV0IS_A::VALUE5 + **self == EV0IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV0IS_A::VALUE6 + **self == EV0IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV0IS_A::VALUE7 + **self == EV0IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV0IS_A::VALUE8 + **self == EV0IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV0IS_A::VALUE9 + **self == EV0IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV0IS_A::VALUE10 + **self == EV0IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV0IS_A::VALUE11 + **self == EV0IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV0IS_A::VALUE12 + **self == EV0IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV0IS_A::VALUE13 + **self == EV0IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV0IS_A::VALUE14 + **self == EV0IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV0IS_A::VALUE15 + **self == EV0IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV0IS_A::VALUE16 + **self == EV0IS_A::VALUE16 + } +} +impl core::ops::Deref for EV0IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV0IS`"] +#[doc = "Field `EV0IS` writer - Event 0 signal selection"] pub struct EV0IS_W<'a> { w: &'a mut W, } @@ -168,9 +202,7 @@ impl<'a> EV0IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU8x.INyA"] #[inline(always)] @@ -255,7 +287,7 @@ impl<'a> EV0IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -302,9 +334,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV1IS`"] -pub type EV1IS_R = crate::R; +#[doc = "Field `EV1IS` reader - Event 1 signal selection"] +pub struct EV1IS_R(crate::FieldReader); impl EV1IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV1IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1IS_A { @@ -331,85 +366,92 @@ impl EV1IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1IS_A::VALUE1 + **self == EV1IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1IS_A::VALUE2 + **self == EV1IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV1IS_A::VALUE3 + **self == EV1IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV1IS_A::VALUE4 + **self == EV1IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV1IS_A::VALUE5 + **self == EV1IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV1IS_A::VALUE6 + **self == EV1IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV1IS_A::VALUE7 + **self == EV1IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV1IS_A::VALUE8 + **self == EV1IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV1IS_A::VALUE9 + **self == EV1IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV1IS_A::VALUE10 + **self == EV1IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV1IS_A::VALUE11 + **self == EV1IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV1IS_A::VALUE12 + **self == EV1IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV1IS_A::VALUE13 + **self == EV1IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV1IS_A::VALUE14 + **self == EV1IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV1IS_A::VALUE15 + **self == EV1IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV1IS_A::VALUE16 + **self == EV1IS_A::VALUE16 + } +} +impl core::ops::Deref for EV1IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1IS`"] +#[doc = "Field `EV1IS` writer - Event 1 signal selection"] pub struct EV1IS_W<'a> { w: &'a mut W, } @@ -417,9 +459,7 @@ impl<'a> EV1IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU8x.INyA"] #[inline(always)] @@ -504,7 +544,7 @@ impl<'a> EV1IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -551,9 +591,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV2IS`"] -pub type EV2IS_R = crate::R; +#[doc = "Field `EV2IS` reader - Event 2 signal selection"] +pub struct EV2IS_R(crate::FieldReader); impl EV2IS_R { + pub(crate) fn new(bits: u8) -> Self { + EV2IS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2IS_A { @@ -580,85 +623,92 @@ impl EV2IS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2IS_A::VALUE1 + **self == EV2IS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2IS_A::VALUE2 + **self == EV2IS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV2IS_A::VALUE3 + **self == EV2IS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV2IS_A::VALUE4 + **self == EV2IS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == EV2IS_A::VALUE5 + **self == EV2IS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == EV2IS_A::VALUE6 + **self == EV2IS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == EV2IS_A::VALUE7 + **self == EV2IS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == EV2IS_A::VALUE8 + **self == EV2IS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == EV2IS_A::VALUE9 + **self == EV2IS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == EV2IS_A::VALUE10 + **self == EV2IS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == EV2IS_A::VALUE11 + **self == EV2IS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == EV2IS_A::VALUE12 + **self == EV2IS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == EV2IS_A::VALUE13 + **self == EV2IS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == EV2IS_A::VALUE14 + **self == EV2IS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == EV2IS_A::VALUE15 + **self == EV2IS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == EV2IS_A::VALUE16 + **self == EV2IS_A::VALUE16 } } -#[doc = "Write proxy for field `EV2IS`"] +impl core::ops::Deref for EV2IS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV2IS` writer - Event 2 signal selection"] pub struct EV2IS_W<'a> { w: &'a mut W, } @@ -666,9 +716,7 @@ impl<'a> EV2IS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2IS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CCU8x.INyA"] #[inline(always)] @@ -753,7 +801,7 @@ impl<'a> EV2IS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -776,9 +824,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV0EM`"] -pub type EV0EM_R = crate::R; +#[doc = "Field `EV0EM` reader - Event 0 Edge Selection"] +pub struct EV0EM_R(crate::FieldReader); impl EV0EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV0EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0EM_A { @@ -793,25 +844,32 @@ impl EV0EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0EM_A::VALUE1 + **self == EV0EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0EM_A::VALUE2 + **self == EV0EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV0EM_A::VALUE3 + **self == EV0EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV0EM_A::VALUE4 + **self == EV0EM_A::VALUE4 } } -#[doc = "Write proxy for field `EV0EM`"] +impl core::ops::Deref for EV0EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV0EM` writer - Event 0 Edge Selection"] pub struct EV0EM_W<'a> { w: &'a mut W, } @@ -819,9 +877,7 @@ impl<'a> EV0EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -846,7 +902,7 @@ impl<'a> EV0EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -869,9 +925,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV1EM`"] -pub type EV1EM_R = crate::R; +#[doc = "Field `EV1EM` reader - Event 1 Edge Selection"] +pub struct EV1EM_R(crate::FieldReader); impl EV1EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV1EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1EM_A { @@ -886,25 +945,32 @@ impl EV1EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1EM_A::VALUE1 + **self == EV1EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1EM_A::VALUE2 + **self == EV1EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV1EM_A::VALUE3 + **self == EV1EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV1EM_A::VALUE4 + **self == EV1EM_A::VALUE4 + } +} +impl core::ops::Deref for EV1EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1EM`"] +#[doc = "Field `EV1EM` writer - Event 1 Edge Selection"] pub struct EV1EM_W<'a> { w: &'a mut W, } @@ -912,9 +978,7 @@ impl<'a> EV1EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -939,7 +1003,7 @@ impl<'a> EV1EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -962,9 +1026,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EV2EM`"] -pub type EV2EM_R = crate::R; +#[doc = "Field `EV2EM` reader - Event 2 Edge Selection"] +pub struct EV2EM_R(crate::FieldReader); impl EV2EM_R { + pub(crate) fn new(bits: u8) -> Self { + EV2EM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2EM_A { @@ -979,25 +1046,32 @@ impl EV2EM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2EM_A::VALUE1 + **self == EV2EM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2EM_A::VALUE2 + **self == EV2EM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EV2EM_A::VALUE3 + **self == EV2EM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EV2EM_A::VALUE4 + **self == EV2EM_A::VALUE4 } } -#[doc = "Write proxy for field `EV2EM`"] +impl core::ops::Deref for EV2EM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EV2EM` writer - Event 2 Edge Selection"] pub struct EV2EM_W<'a> { w: &'a mut W, } @@ -1005,9 +1079,7 @@ impl<'a> EV2EM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2EM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -1032,7 +1104,7 @@ impl<'a> EV2EM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -1050,9 +1122,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV0LM`"] -pub type EV0LM_R = crate::R; +#[doc = "Field `EV0LM` reader - Event 0 Level Selection"] +pub struct EV0LM_R(crate::FieldReader); impl EV0LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV0LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV0LM_A { @@ -1064,15 +1139,22 @@ impl EV0LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV0LM_A::VALUE1 + **self == EV0LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV0LM_A::VALUE2 + **self == EV0LM_A::VALUE2 + } +} +impl core::ops::Deref for EV0LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV0LM`"] +#[doc = "Field `EV0LM` writer - Event 0 Level Selection"] pub struct EV0LM_W<'a> { w: &'a mut W, } @@ -1080,9 +1162,7 @@ impl<'a> EV0LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV0LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1107,7 +1187,7 @@ impl<'a> EV0LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -1125,9 +1205,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV1LM`"] -pub type EV1LM_R = crate::R; +#[doc = "Field `EV1LM` reader - Event 1 Level Selection"] +pub struct EV1LM_R(crate::FieldReader); impl EV1LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV1LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV1LM_A { @@ -1139,15 +1222,22 @@ impl EV1LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV1LM_A::VALUE1 + **self == EV1LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV1LM_A::VALUE2 + **self == EV1LM_A::VALUE2 + } +} +impl core::ops::Deref for EV1LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV1LM`"] +#[doc = "Field `EV1LM` writer - Event 1 Level Selection"] pub struct EV1LM_W<'a> { w: &'a mut W, } @@ -1155,9 +1245,7 @@ impl<'a> EV1LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV1LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1182,7 +1270,7 @@ impl<'a> EV1LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -1200,9 +1288,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV2LM`"] -pub type EV2LM_R = crate::R; +#[doc = "Field `EV2LM` reader - Event 2 Level Selection"] +pub struct EV2LM_R(crate::FieldReader); impl EV2LM_R { + pub(crate) fn new(bits: bool) -> Self { + EV2LM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV2LM_A { @@ -1214,15 +1305,22 @@ impl EV2LM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV2LM_A::VALUE1 + **self == EV2LM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV2LM_A::VALUE2 + **self == EV2LM_A::VALUE2 + } +} +impl core::ops::Deref for EV2LM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EV2LM`"] +#[doc = "Field `EV2LM` writer - Event 2 Level Selection"] pub struct EV2LM_W<'a> { w: &'a mut W, } @@ -1230,9 +1328,7 @@ impl<'a> EV2LM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EV2LM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active on HIGH level"] #[inline(always)] @@ -1257,7 +1353,7 @@ impl<'a> EV2LM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1280,9 +1376,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF0M`"] -pub type LPF0M_R = crate::R; +#[doc = "Field `LPF0M` reader - Event 0 Low Pass Filter Configuration"] +pub struct LPF0M_R(crate::FieldReader); impl LPF0M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF0M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF0M_A { @@ -1297,25 +1396,32 @@ impl LPF0M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF0M_A::VALUE1 + **self == LPF0M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF0M_A::VALUE2 + **self == LPF0M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF0M_A::VALUE3 + **self == LPF0M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF0M_A::VALUE4 + **self == LPF0M_A::VALUE4 + } +} +impl core::ops::Deref for LPF0M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF0M`"] +#[doc = "Field `LPF0M` writer - Event 0 Low Pass Filter Configuration"] pub struct LPF0M_W<'a> { w: &'a mut W, } @@ -1323,9 +1429,7 @@ impl<'a> LPF0M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF0M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1350,7 +1454,7 @@ impl<'a> LPF0M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 25)) | (((value as u32) & 0x03) << 25); + self.w.bits = (self.w.bits & !(0x03 << 25)) | ((value as u32 & 0x03) << 25); self.w } } @@ -1373,9 +1477,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF1M`"] -pub type LPF1M_R = crate::R; +#[doc = "Field `LPF1M` reader - Event 1 Low Pass Filter Configuration"] +pub struct LPF1M_R(crate::FieldReader); impl LPF1M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF1M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF1M_A { @@ -1390,25 +1497,32 @@ impl LPF1M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF1M_A::VALUE1 + **self == LPF1M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF1M_A::VALUE2 + **self == LPF1M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF1M_A::VALUE3 + **self == LPF1M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF1M_A::VALUE4 + **self == LPF1M_A::VALUE4 + } +} +impl core::ops::Deref for LPF1M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF1M`"] +#[doc = "Field `LPF1M` writer - Event 1 Low Pass Filter Configuration"] pub struct LPF1M_W<'a> { w: &'a mut W, } @@ -1416,9 +1530,7 @@ impl<'a> LPF1M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF1M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1443,7 +1555,7 @@ impl<'a> LPF1M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 27)) | (((value as u32) & 0x03) << 27); + self.w.bits = (self.w.bits & !(0x03 << 27)) | ((value as u32 & 0x03) << 27); self.w } } @@ -1466,9 +1578,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPF2M`"] -pub type LPF2M_R = crate::R; +#[doc = "Field `LPF2M` reader - Event 2 Low Pass Filter Configuration"] +pub struct LPF2M_R(crate::FieldReader); impl LPF2M_R { + pub(crate) fn new(bits: u8) -> Self { + LPF2M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPF2M_A { @@ -1483,25 +1598,32 @@ impl LPF2M_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPF2M_A::VALUE1 + **self == LPF2M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPF2M_A::VALUE2 + **self == LPF2M_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPF2M_A::VALUE3 + **self == LPF2M_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPF2M_A::VALUE4 + **self == LPF2M_A::VALUE4 + } +} +impl core::ops::Deref for LPF2M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPF2M`"] +#[doc = "Field `LPF2M` writer - Event 2 Low Pass Filter Configuration"] pub struct LPF2M_W<'a> { w: &'a mut W, } @@ -1509,9 +1631,7 @@ impl<'a> LPF2M_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPF2M_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "LPF is disabled"] #[inline(always)] @@ -1536,7 +1656,7 @@ impl<'a> LPF2M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29); + self.w.bits = (self.w.bits & !(0x03 << 29)) | ((value as u32 & 0x03) << 29); self.w } } @@ -1663,4 +1783,30 @@ impl W { pub fn lpf2m(&mut self) -> LPF2M_W { LPF2M_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Selector Configuration\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 [ins](index.html) module"] +pub struct INS_SPEC; +impl crate::RegisterSpec for INS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ins::R](R) reader structure"] +impl crate::Readable for INS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ins::W](W) writer structure"] +impl crate::Writable for INS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INS to value 0"] +impl crate::Resettable for INS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/inte.rs b/src/ccu80_cc80/inte.rs index faf7b79d..0e7efe12 100644 --- a/src/ccu80_cc80/inte.rs +++ b/src/ccu80_cc80/inte.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register INTE"] -pub type R = crate::R; -#[doc = "Writer for register INTE"] -pub type W = crate::W; -#[doc = "Register INTE `reset()`'s with value 0"] -impl crate::ResetValue for super::INTE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `INTE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Period match while counting up enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PME`"] -pub type PME_R = crate::R; +#[doc = "Field `PME` reader - Period match while counting up enable"] +pub struct PME_R(crate::FieldReader); impl PME_R { + pub(crate) fn new(bits: bool) -> Self { + PME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PME_A { @@ -38,15 +65,22 @@ impl PME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PME_A::VALUE1 + **self == PME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PME_A::VALUE2 + **self == PME_A::VALUE2 + } +} +impl core::ops::Deref for PME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PME`"] +#[doc = "Field `PME` writer - Period match while counting up enable"] pub struct PME_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PME_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Period Match interrupt is disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OME`"] -pub type OME_R = crate::R; +#[doc = "Field `OME` reader - One match while counting down enable"] +pub struct OME_R(crate::FieldReader); impl OME_R { + pub(crate) fn new(bits: bool) -> Self { + OME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OME_A { @@ -113,15 +148,22 @@ impl OME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OME_A::VALUE1 + **self == OME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OME_A::VALUE2 + **self == OME_A::VALUE2 } } -#[doc = "Write proxy for field `OME`"] +impl core::ops::Deref for OME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OME` writer - One match while counting down enable"] pub struct OME_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> OME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OME_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "One Match interrupt is disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> OME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMU1E`"] -pub type CMU1E_R = crate::R; +#[doc = "Field `CMU1E` reader - Channel 1 Compare match while counting up enable"] +pub struct CMU1E_R(crate::FieldReader); impl CMU1E_R { + pub(crate) fn new(bits: bool) -> Self { + CMU1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMU1E_A { @@ -188,15 +231,22 @@ impl CMU1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMU1E_A::VALUE1 + **self == CMU1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMU1E_A::VALUE2 + **self == CMU1E_A::VALUE2 } } -#[doc = "Write proxy for field `CMU1E`"] +impl core::ops::Deref for CMU1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMU1E` writer - Channel 1 Compare match while counting up enable"] pub struct CMU1E_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CMU1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMU1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CMU1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMD1E`"] -pub type CMD1E_R = crate::R; +#[doc = "Field `CMD1E` reader - Channel 1 Compare match while counting down enable"] +pub struct CMD1E_R(crate::FieldReader); impl CMD1E_R { + pub(crate) fn new(bits: bool) -> Self { + CMD1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMD1E_A { @@ -263,15 +314,22 @@ impl CMD1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMD1E_A::VALUE1 + **self == CMD1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMD1E_A::VALUE2 + **self == CMD1E_A::VALUE2 } } -#[doc = "Write proxy for field `CMD1E`"] +impl core::ops::Deref for CMD1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMD1E` writer - Channel 1 Compare match while counting down enable"] pub struct CMD1E_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> CMD1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMD1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> CMD1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMU2E`"] -pub type CMU2E_R = crate::R; +#[doc = "Field `CMU2E` reader - Channel 2 Compare match while counting up enable"] +pub struct CMU2E_R(crate::FieldReader); impl CMU2E_R { + pub(crate) fn new(bits: bool) -> Self { + CMU2E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMU2E_A { @@ -338,15 +397,22 @@ impl CMU2E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMU2E_A::VALUE1 + **self == CMU2E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMU2E_A::VALUE2 + **self == CMU2E_A::VALUE2 } } -#[doc = "Write proxy for field `CMU2E`"] +impl core::ops::Deref for CMU2E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMU2E` writer - Channel 2 Compare match while counting up enable"] pub struct CMU2E_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CMU2E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMU2E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CMU2E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMD2E`"] -pub type CMD2E_R = crate::R; +#[doc = "Field `CMD2E` reader - Channel 2 Compare match while counting down enable"] +pub struct CMD2E_R(crate::FieldReader); impl CMD2E_R { + pub(crate) fn new(bits: bool) -> Self { + CMD2E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMD2E_A { @@ -413,15 +480,22 @@ impl CMD2E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMD2E_A::VALUE1 + **self == CMD2E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMD2E_A::VALUE2 + **self == CMD2E_A::VALUE2 + } +} +impl core::ops::Deref for CMD2E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CMD2E`"] +#[doc = "Field `CMD2E` writer - Channel 2 Compare match while counting down enable"] pub struct CMD2E_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> CMD2E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMD2E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> CMD2E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E0AE`"] -pub type E0AE_R = crate::R; +#[doc = "Field `E0AE` reader - Event 0 interrupt enable"] +pub struct E0AE_R(crate::FieldReader); impl E0AE_R { + pub(crate) fn new(bits: bool) -> Self { + E0AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0AE_A { @@ -488,15 +563,22 @@ impl E0AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0AE_A::VALUE1 + **self == E0AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0AE_A::VALUE2 + **self == E0AE_A::VALUE2 + } +} +impl core::ops::Deref for E0AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E0AE`"] +#[doc = "Field `E0AE` writer - Event 0 interrupt enable"] pub struct E0AE_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> E0AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E0AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> E0AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E1AE`"] -pub type E1AE_R = crate::R; +#[doc = "Field `E1AE` reader - Event 1 interrupt enable"] +pub struct E1AE_R(crate::FieldReader); impl E1AE_R { + pub(crate) fn new(bits: bool) -> Self { + E1AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1AE_A { @@ -563,15 +646,22 @@ impl E1AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1AE_A::VALUE1 + **self == E1AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1AE_A::VALUE2 + **self == E1AE_A::VALUE2 + } +} +impl core::ops::Deref for E1AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E1AE`"] +#[doc = "Field `E1AE` writer - Event 1 interrupt enable"] pub struct E1AE_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> E1AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E1AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> E1AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E2AE`"] -pub type E2AE_R = crate::R; +#[doc = "Field `E2AE` reader - Event 2 interrupt enable"] +pub struct E2AE_R(crate::FieldReader); impl E2AE_R { + pub(crate) fn new(bits: bool) -> Self { + E2AE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2AE_A { @@ -638,15 +729,22 @@ impl E2AE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2AE_A::VALUE1 + **self == E2AE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2AE_A::VALUE2 + **self == E2AE_A::VALUE2 } } -#[doc = "Write proxy for field `E2AE`"] +impl core::ops::Deref for E2AE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E2AE` writer - Event 2 interrupt enable"] pub struct E2AE_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> E2AE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E2AE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> E2AE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -778,4 +874,30 @@ impl W { pub fn e2ae(&mut self) -> E2AE_W { E2AE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Enable Control\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 [inte](index.html) module"] +pub struct INTE_SPEC; +impl crate::RegisterSpec for INTE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inte::R](R) reader structure"] +impl crate::Readable for INTE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inte::W](W) writer structure"] +impl crate::Writable for INTE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTE to value 0"] +impl crate::Resettable for INTE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/ints.rs b/src/ccu80_cc80/ints.rs index 14f80558..38f4f081 100644 --- a/src/ccu80_cc80/ints.rs +++ b/src/ccu80_cc80/ints.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register INTS"] -pub type R = crate::R; +#[doc = "Register `INTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Period Match while Counting Up\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PMUS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PMUS`"] -pub type PMUS_R = crate::R; +#[doc = "Field `PMUS` reader - Period Match while Counting Up"] +pub struct PMUS_R(crate::FieldReader); impl PMUS_R { + pub(crate) fn new(bits: bool) -> Self { + PMUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PMUS_A { @@ -28,12 +44,19 @@ impl PMUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PMUS_A::VALUE1 + **self == PMUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PMUS_A::VALUE2 + **self == PMUS_A::VALUE2 + } +} +impl core::ops::Deref for PMUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "One Match while Counting Down\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OMDS`"] -pub type OMDS_R = crate::R; +#[doc = "Field `OMDS` reader - One Match while Counting Down"] +pub struct OMDS_R(crate::FieldReader); impl OMDS_R { + pub(crate) fn new(bits: bool) -> Self { + OMDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OMDS_A { @@ -64,12 +90,19 @@ impl OMDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OMDS_A::VALUE1 + **self == OMDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OMDS_A::VALUE2 + **self == OMDS_A::VALUE2 + } +} +impl core::ops::Deref for OMDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel 1 Compare Match while Counting Up\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMU1S`"] -pub type CMU1S_R = crate::R; +#[doc = "Field `CMU1S` reader - Channel 1 Compare Match while Counting Up"] +pub struct CMU1S_R(crate::FieldReader); impl CMU1S_R { + pub(crate) fn new(bits: bool) -> Self { + CMU1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMU1S_A { @@ -100,12 +136,19 @@ impl CMU1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMU1S_A::VALUE1 + **self == CMU1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMU1S_A::VALUE2 + **self == CMU1S_A::VALUE2 + } +} +impl core::ops::Deref for CMU1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel 1 Compare Match while Counting Down\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMD1S`"] -pub type CMD1S_R = crate::R; +#[doc = "Field `CMD1S` reader - Channel 1 Compare Match while Counting Down"] +pub struct CMD1S_R(crate::FieldReader); impl CMD1S_R { + pub(crate) fn new(bits: bool) -> Self { + CMD1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMD1S_A { @@ -136,12 +182,19 @@ impl CMD1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMD1S_A::VALUE1 + **self == CMD1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMD1S_A::VALUE2 + **self == CMD1S_A::VALUE2 + } +} +impl core::ops::Deref for CMD1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel 2 Compare Match while Counting Up\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMU2S`"] -pub type CMU2S_R = crate::R; +#[doc = "Field `CMU2S` reader - Channel 2 Compare Match while Counting Up"] +pub struct CMU2S_R(crate::FieldReader); impl CMU2S_R { + pub(crate) fn new(bits: bool) -> Self { + CMU2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMU2S_A { @@ -172,12 +228,19 @@ impl CMU2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMU2S_A::VALUE1 + **self == CMU2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMU2S_A::VALUE2 + **self == CMU2S_A::VALUE2 + } +} +impl core::ops::Deref for CMU2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel 2 Compare Match while Counting Down\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMD2S`"] -pub type CMD2S_R = crate::R; +#[doc = "Field `CMD2S` reader - Channel 2 Compare Match while Counting Down"] +pub struct CMD2S_R(crate::FieldReader); impl CMD2S_R { + pub(crate) fn new(bits: bool) -> Self { + CMD2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMD2S_A { @@ -208,12 +274,19 @@ impl CMD2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMD2S_A::VALUE1 + **self == CMD2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMD2S_A::VALUE2 + **self == CMD2S_A::VALUE2 + } +} +impl core::ops::Deref for CMD2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 0 Detection Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E0AS`"] -pub type E0AS_R = crate::R; +#[doc = "Field `E0AS` reader - Event 0 Detection Status"] +pub struct E0AS_R(crate::FieldReader); impl E0AS_R { + pub(crate) fn new(bits: bool) -> Self { + E0AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0AS_A { @@ -244,12 +320,19 @@ impl E0AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0AS_A::VALUE1 + **self == E0AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0AS_A::VALUE2 + **self == E0AS_A::VALUE2 + } +} +impl core::ops::Deref for E0AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 1 Detection Status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E1AS`"] -pub type E1AS_R = crate::R; +#[doc = "Field `E1AS` reader - Event 1 Detection Status"] +pub struct E1AS_R(crate::FieldReader); impl E1AS_R { + pub(crate) fn new(bits: bool) -> Self { + E1AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1AS_A { @@ -280,12 +366,19 @@ impl E1AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1AS_A::VALUE1 + **self == E1AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1AS_A::VALUE2 + **self == E1AS_A::VALUE2 + } +} +impl core::ops::Deref for E1AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event 2 Detection Status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `E2AS`"] -pub type E2AS_R = crate::R; +#[doc = "Field `E2AS` reader - Event 2 Detection Status"] +pub struct E2AS_R(crate::FieldReader); impl E2AS_R { + pub(crate) fn new(bits: bool) -> Self { + E2AS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2AS_A { @@ -316,16 +412,35 @@ impl E2AS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2AS_A::VALUE1 + **self == E2AS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2AS_A::VALUE2 + **self == E2AS_A::VALUE2 + } +} +impl core::ops::Deref for E2AS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRPF` reader - Trap Flag Status"] +pub struct TRPF_R(crate::FieldReader); +impl TRPF_R { + pub(crate) fn new(bits: bool) -> Self { + TRPF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRPF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `TRPF`"] -pub type TRPF_R = crate::R; impl R { #[doc = "Bit 0 - Period Match while Counting Up"] #[inline(always)] @@ -378,3 +493,19 @@ impl R { TRPF_R::new(((self.bits >> 11) & 0x01) != 0) } } +#[doc = "Interrupt Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ints](index.html) module"] +pub struct INTS_SPEC; +impl crate::RegisterSpec for INTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ints::R](R) reader structure"] +impl crate::Readable for INTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets INTS to value 0"] +impl crate::Resettable for INTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/pr.rs b/src/ccu80_cc80/pr.rs index 2cae0225..4f16f0c0 100644 --- a/src/ccu80_cc80/pr.rs +++ b/src/ccu80_cc80/pr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register PR"] -pub type R = crate::R; -#[doc = "Reader of field `PR`"] -pub type PR_R = crate::R; +#[doc = "Register `PR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `PR` reader - Period Register"] +pub struct PR_R(crate::FieldReader); +impl PR_R { + pub(crate) fn new(bits: u16) -> Self { + PR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { PR_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Timer Period Value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pr](index.html) module"] +pub struct PR_SPEC; +impl crate::RegisterSpec for PR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pr::R](R) reader structure"] +impl crate::Readable for PR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PR to value 0"] +impl crate::Resettable for PR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/prs.rs b/src/ccu80_cc80/prs.rs index 3a02f651..7c64b584 100644 --- a/src/ccu80_cc80/prs.rs +++ b/src/ccu80_cc80/prs.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PRS"] -pub type R = crate::R; -#[doc = "Writer for register PRS"] -pub type W = crate::W; -#[doc = "Register PRS `reset()`'s with value 0"] -impl crate::ResetValue for super::PRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PRS`"] -pub type PRS_R = crate::R; -#[doc = "Write proxy for field `PRS`"] +#[doc = "Field `PRS` reader - Period Register"] +pub struct PRS_R(crate::FieldReader); +impl PRS_R { + pub(crate) fn new(bits: u16) -> Self { + PRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRS` writer - Period Register"] pub struct PRS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn prs(&mut self) -> PRS_W { PRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer Shadow Period Value\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 [prs](index.html) module"] +pub struct PRS_SPEC; +impl crate::RegisterSpec for PRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prs::R](R) reader structure"] +impl crate::Readable for PRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prs::W](W) writer structure"] +impl crate::Writable for PRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRS to value 0"] +impl crate::Resettable for PRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/psc.rs b/src/ccu80_cc80/psc.rs index 060226df..9b8f1d8b 100644 --- a/src/ccu80_cc80/psc.rs +++ b/src/ccu80_cc80/psc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PSC"] -pub type R = crate::R; -#[doc = "Writer for register PSC"] -pub type W = crate::W; -#[doc = "Register PSC `reset()`'s with value 0"] -impl crate::ResetValue for super::PSC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PSIV`"] -pub type PSIV_R = crate::R; -#[doc = "Write proxy for field `PSIV`"] +#[doc = "Field `PSIV` reader - Prescaler Initial Value"] +pub struct PSIV_R(crate::FieldReader); +impl PSIV_R { + pub(crate) fn new(bits: u8) -> Self { + PSIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PSIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSIV` writer - Prescaler Initial Value"] pub struct PSIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PSIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn psiv(&mut self) -> PSIV_W { PSIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prescaler Control\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 [psc](index.html) module"] +pub struct PSC_SPEC; +impl crate::RegisterSpec for PSC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psc::R](R) reader structure"] +impl crate::Readable for PSC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psc::W](W) writer structure"] +impl crate::Writable for PSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSC to value 0"] +impl crate::Resettable for PSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/psl.rs b/src/ccu80_cc80/psl.rs index e6c15bfd..f816177f 100644 --- a/src/ccu80_cc80/psl.rs +++ b/src/ccu80_cc80/psl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSL"] -pub type R = crate::R; -#[doc = "Writer for register PSL"] -pub type W = crate::W; -#[doc = "Register PSL `reset()`'s with value 0"] -impl crate::ResetValue for super::PSL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Output Passive Level for CCU8x.OUTy0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL11`"] -pub type PSL11_R = crate::R; +#[doc = "Field `PSL11` reader - Output Passive Level for CCU8x.OUTy0"] +pub struct PSL11_R(crate::FieldReader); impl PSL11_R { + pub(crate) fn new(bits: bool) -> Self { + PSL11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL11_A { @@ -38,15 +65,22 @@ impl PSL11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL11_A::VALUE1 + **self == PSL11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL11_A::VALUE2 + **self == PSL11_A::VALUE2 } } -#[doc = "Write proxy for field `PSL11`"] +impl core::ops::Deref for PSL11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSL11` writer - Output Passive Level for CCU8x.OUTy0"] pub struct PSL11_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PSL11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Passive Level is LOW"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PSL11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL12`"] -pub type PSL12_R = crate::R; +#[doc = "Field `PSL12` reader - Output Passive Level for CCU8x.OUTy1"] +pub struct PSL12_R(crate::FieldReader); impl PSL12_R { + pub(crate) fn new(bits: bool) -> Self { + PSL12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL12_A { @@ -113,15 +148,22 @@ impl PSL12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL12_A::VALUE1 + **self == PSL12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL12_A::VALUE2 + **self == PSL12_A::VALUE2 } } -#[doc = "Write proxy for field `PSL12`"] +impl core::ops::Deref for PSL12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSL12` writer - Output Passive Level for CCU8x.OUTy1"] pub struct PSL12_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PSL12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Passive Level is LOW"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PSL12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL21`"] -pub type PSL21_R = crate::R; +#[doc = "Field `PSL21` reader - Output Passive Level for CCU8x.OUTy2"] +pub struct PSL21_R(crate::FieldReader); impl PSL21_R { + pub(crate) fn new(bits: bool) -> Self { + PSL21_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL21_A { @@ -188,15 +231,22 @@ impl PSL21_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL21_A::VALUE1 + **self == PSL21_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL21_A::VALUE2 + **self == PSL21_A::VALUE2 + } +} +impl core::ops::Deref for PSL21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSL21`"] +#[doc = "Field `PSL21` writer - Output Passive Level for CCU8x.OUTy2"] pub struct PSL21_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PSL21_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL21_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Passive Level is LOW"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PSL21_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL22`"] -pub type PSL22_R = crate::R; +#[doc = "Field `PSL22` reader - Output Passive Level for CCU8x.OUTy3"] +pub struct PSL22_R(crate::FieldReader); impl PSL22_R { + pub(crate) fn new(bits: bool) -> Self { + PSL22_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL22_A { @@ -263,15 +314,22 @@ impl PSL22_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL22_A::VALUE1 + **self == PSL22_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL22_A::VALUE2 + **self == PSL22_A::VALUE2 + } +} +impl core::ops::Deref for PSL22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSL22`"] +#[doc = "Field `PSL22` writer - Output Passive Level for CCU8x.OUTy3"] pub struct PSL22_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PSL22_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL22_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Passive Level is LOW"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PSL22_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -353,4 +409,30 @@ impl W { pub fn psl22(&mut self) -> PSL22_W { PSL22_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Passive Level Config\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 [psl](index.html) module"] +pub struct PSL_SPEC; +impl crate::RegisterSpec for PSL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psl::R](R) reader structure"] +impl crate::Readable for PSL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psl::W](W) writer structure"] +impl crate::Writable for PSL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSL to value 0"] +impl crate::Resettable for PSL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/srs.rs b/src/ccu80_cc80/srs.rs index 3215bba8..3ea4fdf8 100644 --- a/src/ccu80_cc80/srs.rs +++ b/src/ccu80_cc80/srs.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SRS"] -pub type R = crate::R; -#[doc = "Writer for register SRS"] -pub type W = crate::W; -#[doc = "Register SRS `reset()`'s with value 0"] -impl crate::ResetValue for super::SRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Period/One match Service request selector\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `POSR`"] -pub type POSR_R = crate::R; +#[doc = "Field `POSR` reader - Period/One match Service request selector"] +pub struct POSR_R(crate::FieldReader); impl POSR_R { + pub(crate) fn new(bits: u8) -> Self { + POSR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POSR_A { @@ -46,25 +73,32 @@ impl POSR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POSR_A::VALUE1 + **self == POSR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POSR_A::VALUE2 + **self == POSR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == POSR_A::VALUE3 + **self == POSR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == POSR_A::VALUE4 + **self == POSR_A::VALUE4 + } +} +impl core::ops::Deref for POSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `POSR`"] +#[doc = "Field `POSR` writer - Period/One match Service request selector"] pub struct POSR_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> POSR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC8ySR0"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> POSR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM1SR`"] -pub type CM1SR_R = crate::R; +#[doc = "Field `CM1SR` reader - Channel 1 Compare match Service request selector"] +pub struct CM1SR_R(crate::FieldReader); impl CM1SR_R { + pub(crate) fn new(bits: u8) -> Self { + CM1SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM1SR_A { @@ -139,25 +174,32 @@ impl CM1SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM1SR_A::VALUE1 + **self == CM1SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM1SR_A::VALUE2 + **self == CM1SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM1SR_A::VALUE3 + **self == CM1SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM1SR_A::VALUE4 + **self == CM1SR_A::VALUE4 } } -#[doc = "Write proxy for field `CM1SR`"] +impl core::ops::Deref for CM1SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM1SR` writer - Channel 1 Compare match Service request selector"] pub struct CM1SR_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> CM1SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM1SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC8ySR0"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> CM1SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM2SR`"] -pub type CM2SR_R = crate::R; +#[doc = "Field `CM2SR` reader - Channel 2 Compare match Service request selector"] +pub struct CM2SR_R(crate::FieldReader); impl CM2SR_R { + pub(crate) fn new(bits: u8) -> Self { + CM2SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM2SR_A { @@ -232,25 +275,32 @@ impl CM2SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM2SR_A::VALUE1 + **self == CM2SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM2SR_A::VALUE2 + **self == CM2SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM2SR_A::VALUE3 + **self == CM2SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM2SR_A::VALUE4 + **self == CM2SR_A::VALUE4 } } -#[doc = "Write proxy for field `CM2SR`"] +impl core::ops::Deref for CM2SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM2SR` writer - Channel 2 Compare match Service request selector"] pub struct CM2SR_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> CM2SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM2SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC8ySR0"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> CM2SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E0SR`"] -pub type E0SR_R = crate::R; +#[doc = "Field `E0SR` reader - Event 0 Service request selector"] +pub struct E0SR_R(crate::FieldReader); impl E0SR_R { + pub(crate) fn new(bits: u8) -> Self { + E0SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E0SR_A { @@ -325,25 +376,32 @@ impl E0SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E0SR_A::VALUE1 + **self == E0SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E0SR_A::VALUE2 + **self == E0SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E0SR_A::VALUE3 + **self == E0SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E0SR_A::VALUE4 + **self == E0SR_A::VALUE4 } } -#[doc = "Write proxy for field `E0SR`"] +impl core::ops::Deref for E0SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E0SR` writer - Event 0 Service request selector"] pub struct E0SR_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> E0SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E0SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CCvySR0"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> E0SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E1SR`"] -pub type E1SR_R = crate::R; +#[doc = "Field `E1SR` reader - Event 1 Service request selector"] +pub struct E1SR_R(crate::FieldReader); impl E1SR_R { + pub(crate) fn new(bits: u8) -> Self { + E1SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E1SR_A { @@ -418,25 +477,32 @@ impl E1SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E1SR_A::VALUE1 + **self == E1SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E1SR_A::VALUE2 + **self == E1SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E1SR_A::VALUE3 + **self == E1SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E1SR_A::VALUE4 + **self == E1SR_A::VALUE4 + } +} +impl core::ops::Deref for E1SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `E1SR`"] +#[doc = "Field `E1SR` writer - Event 1 Service request selector"] pub struct E1SR_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> E1SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E1SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC8ySR0"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> E1SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -494,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `E2SR`"] -pub type E2SR_R = crate::R; +#[doc = "Field `E2SR` reader - Event 2 Service request selector"] +pub struct E2SR_R(crate::FieldReader); impl E2SR_R { + pub(crate) fn new(bits: u8) -> Self { + E2SR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> E2SR_A { @@ -511,25 +578,32 @@ impl E2SR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == E2SR_A::VALUE1 + **self == E2SR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == E2SR_A::VALUE2 + **self == E2SR_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == E2SR_A::VALUE3 + **self == E2SR_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == E2SR_A::VALUE4 + **self == E2SR_A::VALUE4 } } -#[doc = "Write proxy for field `E2SR`"] +impl core::ops::Deref for E2SR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `E2SR` writer - Event 2 Service request selector"] pub struct E2SR_W<'a> { w: &'a mut W, } @@ -537,9 +611,7 @@ impl<'a> E2SR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: E2SR_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Forward to CC8ySR0"] #[inline(always)] @@ -564,7 +636,7 @@ impl<'a> E2SR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -631,4 +703,30 @@ impl W { pub fn e2sr(&mut self) -> E2SR_W { E2SR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Selector\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 [srs](index.html) module"] +pub struct SRS_SPEC; +impl crate::RegisterSpec for SRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srs::R](R) reader structure"] +impl crate::Readable for SRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [srs::W](W) writer structure"] +impl crate::Writable for SRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRS to value 0"] +impl crate::Resettable for SRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/stc.rs b/src/ccu80_cc80/stc.rs index 675286fe..eccc4da5 100644 --- a/src/ccu80_cc80/stc.rs +++ b/src/ccu80_cc80/stc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register STC"] -pub type R = crate::R; -#[doc = "Writer for register STC"] -pub type W = crate::W; -#[doc = "Register STC `reset()`'s with value 0"] -impl crate::ResetValue for super::STC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `STC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Cascaded shadow transfer enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CSE`"] -pub type CSE_R = crate::R; +#[doc = "Field `CSE` reader - Cascaded shadow transfer enable"] +pub struct CSE_R(crate::FieldReader); impl CSE_R { + pub(crate) fn new(bits: bool) -> Self { + CSE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSE_A { @@ -38,15 +65,22 @@ impl CSE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSE_A::VALUE1 + **self == CSE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSE_A::VALUE2 + **self == CSE_A::VALUE2 + } +} +impl core::ops::Deref for CSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CSE`"] +#[doc = "Field `CSE` writer - Cascaded shadow transfer enable"] pub struct CSE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CSE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Cascaded shadow transfer disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -102,37 +134,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STM`"] -pub type STM_R = crate::R; +#[doc = "Field `STM` reader - Shadow transfer mode"] +pub struct STM_R(crate::FieldReader); impl STM_R { + pub(crate) fn new(bits: u8) -> Self { + STM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(STM_A::VALUE1), - 1 => Val(STM_A::VALUE2), - 2 => Val(STM_A::VALUE3), - i => Res(i), + 0 => Some(STM_A::VALUE1), + 1 => Some(STM_A::VALUE2), + 2 => Some(STM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STM_A::VALUE1 + **self == STM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STM_A::VALUE2 + **self == STM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STM_A::VALUE3 + **self == STM_A::VALUE3 } } -#[doc = "Write proxy for field `STM`"] +impl core::ops::Deref for STM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STM` writer - Shadow transfer mode"] pub struct STM_W<'a> { w: &'a mut W, } @@ -160,7 +201,7 @@ impl<'a> STM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 1)) | (((value as u32) & 0x03) << 1); + self.w.bits = (self.w.bits & !(0x03 << 1)) | ((value as u32 & 0x03) << 1); self.w } } @@ -187,4 +228,30 @@ impl W { pub fn stm(&mut self) -> STM_W { STM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shadow transfer control\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 [stc](index.html) module"] +pub struct STC_SPEC; +impl crate::RegisterSpec for STC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [stc::R](R) reader structure"] +impl crate::Readable for STC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [stc::W](W) writer structure"] +impl crate::Writable for STC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STC to value 0"] +impl crate::Resettable for STC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/swr.rs b/src/ccu80_cc80/swr.rs index 1d201e13..395842ae 100644 --- a/src/ccu80_cc80/swr.rs +++ b/src/ccu80_cc80/swr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWR"] -pub type W = crate::W; -#[doc = "Register SWR `reset()`'s with value 0"] -impl crate::ResetValue for super::SWR { - type Type = u32; +#[doc = "Register `SWR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `RPM`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RPM` writer - Period match while counting up clear"] pub struct RPM_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> RPM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `ROM`"] +#[doc = "Field `ROM` writer - One match while counting down clear"] pub struct ROM_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> ROM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `RCM1U`"] +#[doc = "Field `RCM1U` writer - Channel 1 Compare match while counting up clear"] pub struct RCM1U_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> RCM1U_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `RCM1D`"] +#[doc = "Field `RCM1D` writer - Channel 1 Compare match while counting down clear"] pub struct RCM1D_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> RCM1D_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `RCM2U`"] +#[doc = "Field `RCM2U` writer - Channel 2 Compare match while counting up clear"] pub struct RCM2U_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> RCM2U_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `RCM2D`"] +#[doc = "Field `RCM2D` writer - Channel 2 Compare match while counting down clear"] pub struct RCM2D_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> RCM2D_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `RE0A`"] +#[doc = "Field `RE0A` writer - Event 0 detection clear"] pub struct RE0A_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> RE0A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `RE1A`"] +#[doc = "Field `RE1A` writer - Event 1 detection clear"] pub struct RE1A_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> RE1A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `RE2A`"] +#[doc = "Field `RE2A` writer - Event 2 detection clear"] pub struct RE2A_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> RE2A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `RTRPF`"] +#[doc = "Field `RTRPF` writer - Trap Flag status clear"] pub struct RTRPF_W<'a> { w: &'a mut W, } @@ -224,7 +235,7 @@ impl<'a> RTRPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -279,4 +290,26 @@ impl W { pub fn rtrpf(&mut self) -> RTRPF_W { RTRPF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Status Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swr](index.html) module"] +pub struct SWR_SPEC; +impl crate::RegisterSpec for SWR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [swr::W](W) writer structure"] +impl crate::Writable for SWR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWR to value 0"] +impl crate::Resettable for SWR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/sws.rs b/src/ccu80_cc80/sws.rs index 3ba18f7a..05406a1b 100644 --- a/src/ccu80_cc80/sws.rs +++ b/src/ccu80_cc80/sws.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWS"] -pub type W = crate::W; -#[doc = "Register SWS `reset()`'s with value 0"] -impl crate::ResetValue for super::SWS { - type Type = u32; +#[doc = "Register `SWS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SPM`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SPM` writer - Period match while counting up set"] pub struct SPM_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SPM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SOM`"] +#[doc = "Field `SOM` writer - One match while counting down set"] pub struct SOM_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SOM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SCM1U`"] +#[doc = "Field `SCM1U` writer - Channel 1 Compare match while counting up set"] pub struct SCM1U_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SCM1U_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SCM1D`"] +#[doc = "Field `SCM1D` writer - Channel 1 Compare match while counting down set"] pub struct SCM1D_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SCM1D_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SCM2U`"] +#[doc = "Field `SCM2U` writer - Compare match while counting up set"] pub struct SCM2U_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SCM2U_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `SCM2D`"] +#[doc = "Field `SCM2D` writer - Compare match while counting down set"] pub struct SCM2D_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SCM2D_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `SE0A`"] +#[doc = "Field `SE0A` writer - Event 0 detection set"] pub struct SE0A_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> SE0A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SE1A`"] +#[doc = "Field `SE1A` writer - Event 1 detection set"] pub struct SE1A_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> SE1A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `SE2A`"] +#[doc = "Field `SE2A` writer - Event 2 detection set"] pub struct SE2A_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> SE2A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `STRPF`"] +#[doc = "Field `STRPF` writer - Trap Flag status set"] pub struct STRPF_W<'a> { w: &'a mut W, } @@ -224,7 +235,7 @@ impl<'a> STRPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -279,4 +290,26 @@ impl W { pub fn strpf(&mut self) -> STRPF_W { STRPF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Status Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](index.html) module"] +pub struct SWS_SPEC; +impl crate::RegisterSpec for SWS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +impl crate::Writable for SWS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWS to value 0"] +impl crate::Resettable for SWS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/tc.rs b/src/ccu80_cc80/tc.rs index c1e06bcc..5b69de13 100644 --- a/src/ccu80_cc80/tc.rs +++ b/src/ccu80_cc80/tc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TC"] -pub type R = crate::R; -#[doc = "Writer for register TC"] -pub type W = crate::W; -#[doc = "Register TC `reset()`'s with value 0x1800_0000"] -impl crate::ResetValue for super::TC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x1800_0000 +#[doc = "Register `TC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Timer Counting Mode\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TCM`"] -pub type TCM_R = crate::R; +#[doc = "Field `TCM` reader - Timer Counting Mode"] +pub struct TCM_R(crate::FieldReader); impl TCM_R { + pub(crate) fn new(bits: bool) -> Self { + TCM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TCM_A { @@ -38,15 +65,22 @@ impl TCM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TCM_A::VALUE1 + **self == TCM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TCM_A::VALUE2 + **self == TCM_A::VALUE2 } } -#[doc = "Write proxy for field `TCM`"] +impl core::ops::Deref for TCM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCM` writer - Timer Counting Mode"] pub struct TCM_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> TCM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TCM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Edge aligned mode"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> TCM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSSM`"] -pub type TSSM_R = crate::R; +#[doc = "Field `TSSM` reader - Timer Single Shot Mode"] +pub struct TSSM_R(crate::FieldReader); impl TSSM_R { + pub(crate) fn new(bits: bool) -> Self { + TSSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSSM_A { @@ -113,15 +148,22 @@ impl TSSM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSSM_A::VALUE1 + **self == TSSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSSM_A::VALUE2 + **self == TSSM_A::VALUE2 } } -#[doc = "Write proxy for field `TSSM`"] +impl core::ops::Deref for TSSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSSM` writer - Timer Single Shot Mode"] pub struct TSSM_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> TSSM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSSM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Single shot mode is disabled"] #[inline(always)] @@ -156,13 +196,25 @@ impl<'a> TSSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CLST`"] -pub type CLST_R = crate::R; -#[doc = "Write proxy for field `CLST`"] +#[doc = "Field `CLST` reader - Shadow Transfer on Clear"] +pub struct CLST_R(crate::FieldReader); +impl CLST_R { + pub(crate) fn new(bits: bool) -> Self { + CLST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CLST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CLST` writer - Shadow Transfer on Clear"] pub struct CLST_W<'a> { w: &'a mut W, } @@ -180,7 +232,7 @@ impl<'a> CLST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -198,9 +250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMOD`"] -pub type CMOD_R = crate::R; +#[doc = "Field `CMOD` reader - Capture Compare Mode"] +pub struct CMOD_R(crate::FieldReader); impl CMOD_R { + pub(crate) fn new(bits: bool) -> Self { + CMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMOD_A { @@ -212,12 +267,19 @@ impl CMOD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMOD_A::VALUE1 + **self == CMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMOD_A::VALUE2 + **self == CMOD_A::VALUE2 + } +} +impl core::ops::Deref for CMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Extended Capture Mode\n\nValue on reset: 0"] @@ -234,9 +296,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ECM`"] -pub type ECM_R = crate::R; +#[doc = "Field `ECM` reader - Extended Capture Mode"] +pub struct ECM_R(crate::FieldReader); impl ECM_R { + pub(crate) fn new(bits: bool) -> Self { + ECM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ECM_A { @@ -248,15 +313,22 @@ impl ECM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ECM_A::VALUE1 + **self == ECM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ECM_A::VALUE2 + **self == ECM_A::VALUE2 } } -#[doc = "Write proxy for field `ECM`"] +impl core::ops::Deref for ECM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ECM` writer - Extended Capture Mode"] pub struct ECM_W<'a> { w: &'a mut W, } @@ -264,9 +336,7 @@ impl<'a> ECM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ECM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] @@ -291,7 +361,7 @@ impl<'a> ECM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -314,9 +384,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CAPC`"] -pub type CAPC_R = crate::R; +#[doc = "Field `CAPC` reader - Clear on Capture Control"] +pub struct CAPC_R(crate::FieldReader); impl CAPC_R { + pub(crate) fn new(bits: u8) -> Self { + CAPC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAPC_A { @@ -331,25 +404,32 @@ impl CAPC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAPC_A::VALUE1 + **self == CAPC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAPC_A::VALUE2 + **self == CAPC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CAPC_A::VALUE3 + **self == CAPC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CAPC_A::VALUE4 + **self == CAPC_A::VALUE4 } } -#[doc = "Write proxy for field `CAPC`"] +impl core::ops::Deref for CAPC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAPC` writer - Clear on Capture Control"] pub struct CAPC_W<'a> { w: &'a mut W, } @@ -357,9 +437,7 @@ impl<'a> CAPC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAPC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Timer is never cleared on a capture event"] #[inline(always)] @@ -384,7 +462,7 @@ impl<'a> CAPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5); + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); self.w } } @@ -402,9 +480,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TLS`"] -pub type TLS_R = crate::R; +#[doc = "Field `TLS` reader - Timer Load selector"] +pub struct TLS_R(crate::FieldReader); impl TLS_R { + pub(crate) fn new(bits: bool) -> Self { + TLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TLS_A { @@ -416,15 +497,22 @@ impl TLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TLS_A::VALUE1 + **self == TLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TLS_A::VALUE2 + **self == TLS_A::VALUE2 } } -#[doc = "Write proxy for field `TLS`"] +impl core::ops::Deref for TLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TLS` writer - Timer Load selector"] pub struct TLS_W<'a> { w: &'a mut W, } @@ -432,9 +520,7 @@ impl<'a> TLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TLS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Timer is loaded with the value of CR1"] #[inline(always)] @@ -459,7 +545,7 @@ impl<'a> TLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -480,37 +566,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENDM`"] -pub type ENDM_R = crate::R; +#[doc = "Field `ENDM` reader - Extended Stop Function Control"] +pub struct ENDM_R(crate::FieldReader); impl ENDM_R { + pub(crate) fn new(bits: u8) -> Self { + ENDM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ENDM_A::VALUE1), - 1 => Val(ENDM_A::VALUE2), - 2 => Val(ENDM_A::VALUE3), - i => Res(i), + 0 => Some(ENDM_A::VALUE1), + 1 => Some(ENDM_A::VALUE2), + 2 => Some(ENDM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDM_A::VALUE1 + **self == ENDM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDM_A::VALUE2 + **self == ENDM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENDM_A::VALUE3 + **self == ENDM_A::VALUE3 } } -#[doc = "Write proxy for field `ENDM`"] +impl core::ops::Deref for ENDM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDM` writer - Extended Stop Function Control"] pub struct ENDM_W<'a> { w: &'a mut W, } @@ -538,7 +633,7 @@ impl<'a> ENDM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -556,9 +651,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STRM`"] -pub type STRM_R = crate::R; +#[doc = "Field `STRM` reader - Extended Start Function Control"] +pub struct STRM_R(crate::FieldReader); impl STRM_R { + pub(crate) fn new(bits: bool) -> Self { + STRM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRM_A { @@ -570,15 +668,22 @@ impl STRM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRM_A::VALUE1 + **self == STRM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRM_A::VALUE2 + **self == STRM_A::VALUE2 } } -#[doc = "Write proxy for field `STRM`"] +impl core::ops::Deref for STRM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STRM` writer - Extended Start Function Control"] pub struct STRM_W<'a> { w: &'a mut W, } @@ -586,9 +691,7 @@ impl<'a> STRM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STRM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Sets run bit only (default start)"] #[inline(always)] @@ -613,7 +716,7 @@ impl<'a> STRM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -631,9 +734,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCE`"] -pub type SCE_R = crate::R; +#[doc = "Field `SCE` reader - Equal Capture Event enable"] +pub struct SCE_R(crate::FieldReader); impl SCE_R { + pub(crate) fn new(bits: bool) -> Self { + SCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCE_A { @@ -645,15 +751,22 @@ impl SCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCE_A::VALUE1 + **self == SCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCE_A::VALUE2 + **self == SCE_A::VALUE2 } } -#[doc = "Write proxy for field `SCE`"] +impl core::ops::Deref for SCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCE` writer - Equal Capture Event enable"] pub struct SCE_W<'a> { w: &'a mut W, } @@ -661,9 +774,7 @@ impl<'a> SCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. registers control by CCycapt0 and capture into CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"] #[inline(always)] @@ -688,7 +799,7 @@ impl<'a> SCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -706,9 +817,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCS`"] -pub type CCS_R = crate::R; +#[doc = "Field `CCS` reader - Continuous Capture Enable"] +pub struct CCS_R(crate::FieldReader); impl CCS_R { + pub(crate) fn new(bits: bool) -> Self { + CCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCS_A { @@ -720,15 +834,22 @@ impl CCS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCS_A::VALUE1 + **self == CCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCS_A::VALUE2 + **self == CCS_A::VALUE2 + } +} +impl core::ops::Deref for CCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CCS`"] +#[doc = "Field `CCS` writer - Continuous Capture Enable"] pub struct CCS_W<'a> { w: &'a mut W, } @@ -736,9 +857,7 @@ impl<'a> CCS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] @@ -763,7 +882,7 @@ impl<'a> CCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -786,9 +905,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DITHE`"] -pub type DITHE_R = crate::R; +#[doc = "Field `DITHE` reader - Dither Enable"] +pub struct DITHE_R(crate::FieldReader); impl DITHE_R { + pub(crate) fn new(bits: u8) -> Self { + DITHE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DITHE_A { @@ -803,25 +925,32 @@ impl DITHE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DITHE_A::VALUE1 + **self == DITHE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DITHE_A::VALUE2 + **self == DITHE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DITHE_A::VALUE3 + **self == DITHE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DITHE_A::VALUE4 + **self == DITHE_A::VALUE4 + } +} +impl core::ops::Deref for DITHE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DITHE`"] +#[doc = "Field `DITHE` writer - Dither Enable"] pub struct DITHE_W<'a> { w: &'a mut W, } @@ -829,9 +958,7 @@ impl<'a> DITHE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DITHE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Dither is disabled"] #[inline(always)] @@ -856,7 +983,7 @@ impl<'a> DITHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -874,9 +1001,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIM`"] -pub type DIM_R = crate::R; +#[doc = "Field `DIM` reader - Dither input selector"] +pub struct DIM_R(crate::FieldReader); impl DIM_R { + pub(crate) fn new(bits: bool) -> Self { + DIM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIM_A { @@ -888,15 +1018,22 @@ impl DIM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIM_A::VALUE1 + **self == DIM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIM_A::VALUE2 + **self == DIM_A::VALUE2 + } +} +impl core::ops::Deref for DIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DIM`"] +#[doc = "Field `DIM` writer - Dither input selector"] pub struct DIM_W<'a> { w: &'a mut W, } @@ -904,9 +1041,7 @@ impl<'a> DIM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Slice is using it own dither unit"] #[inline(always)] @@ -931,7 +1066,7 @@ impl<'a> DIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -949,9 +1084,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FPE`"] -pub type FPE_R = crate::R; +#[doc = "Field `FPE` reader - Floating Prescaler enable"] +pub struct FPE_R(crate::FieldReader); impl FPE_R { + pub(crate) fn new(bits: bool) -> Self { + FPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FPE_A { @@ -963,15 +1101,22 @@ impl FPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FPE_A::VALUE1 + **self == FPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FPE_A::VALUE2 + **self == FPE_A::VALUE2 + } +} +impl core::ops::Deref for FPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FPE`"] +#[doc = "Field `FPE` writer - Floating Prescaler enable"] pub struct FPE_W<'a> { w: &'a mut W, } @@ -979,9 +1124,7 @@ impl<'a> FPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FPE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Floating prescaler mode is disabled"] #[inline(always)] @@ -1006,7 +1149,7 @@ impl<'a> FPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1024,9 +1167,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRAPE0`"] -pub type TRAPE0_R = crate::R; +#[doc = "Field `TRAPE0` reader - TRAP enable for CCU8x.OUTy0"] +pub struct TRAPE0_R(crate::FieldReader); impl TRAPE0_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPE0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRAPE0_A { @@ -1038,15 +1184,22 @@ impl TRAPE0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRAPE0_A::VALUE1 + **self == TRAPE0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRAPE0_A::VALUE2 + **self == TRAPE0_A::VALUE2 } } -#[doc = "Write proxy for field `TRAPE0`"] +impl core::ops::Deref for TRAPE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRAPE0` writer - TRAP enable for CCU8x.OUTy0"] pub struct TRAPE0_W<'a> { w: &'a mut W, } @@ -1054,9 +1207,7 @@ impl<'a> TRAPE0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRAPE0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TRAP functionality has no effect on the CCU8x.OUTy0 output"] #[inline(always)] @@ -1081,13 +1232,25 @@ impl<'a> TRAPE0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `TRAPE1`"] -pub type TRAPE1_R = crate::R; -#[doc = "Write proxy for field `TRAPE1`"] +#[doc = "Field `TRAPE1` reader - TRAP enable for CCU8x.OUTy1"] +pub struct TRAPE1_R(crate::FieldReader); +impl TRAPE1_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPE1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRAPE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRAPE1` writer - TRAP enable for CCU8x.OUTy1"] pub struct TRAPE1_W<'a> { w: &'a mut W, } @@ -1105,13 +1268,25 @@ impl<'a> TRAPE1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `TRAPE2`"] -pub type TRAPE2_R = crate::R; -#[doc = "Write proxy for field `TRAPE2`"] +#[doc = "Field `TRAPE2` reader - TRAP enable for CCU8x.OUTy2"] +pub struct TRAPE2_R(crate::FieldReader); +impl TRAPE2_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPE2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRAPE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRAPE2` writer - TRAP enable for CCU8x.OUTy2"] pub struct TRAPE2_W<'a> { w: &'a mut W, } @@ -1129,13 +1304,25 @@ impl<'a> TRAPE2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Reader of field `TRAPE3`"] -pub type TRAPE3_R = crate::R; -#[doc = "Write proxy for field `TRAPE3`"] +#[doc = "Field `TRAPE3` reader - TRAP enable for CCU8x.OUTy3"] +pub struct TRAPE3_R(crate::FieldReader); +impl TRAPE3_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPE3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRAPE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRAPE3` writer - TRAP enable for CCU8x.OUTy3"] pub struct TRAPE3_W<'a> { w: &'a mut W, } @@ -1153,7 +1340,7 @@ impl<'a> TRAPE3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -1171,9 +1358,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRPSE`"] -pub type TRPSE_R = crate::R; +#[doc = "Field `TRPSE` reader - TRAP Synchronization Enable"] +pub struct TRPSE_R(crate::FieldReader); impl TRPSE_R { + pub(crate) fn new(bits: bool) -> Self { + TRPSE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRPSE_A { @@ -1185,15 +1375,22 @@ impl TRPSE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRPSE_A::VALUE1 + **self == TRPSE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRPSE_A::VALUE2 + **self == TRPSE_A::VALUE2 } } -#[doc = "Write proxy for field `TRPSE`"] +impl core::ops::Deref for TRPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRPSE` writer - TRAP Synchronization Enable"] pub struct TRPSE_W<'a> { w: &'a mut W, } @@ -1201,9 +1398,7 @@ impl<'a> TRPSE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRPSE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] @@ -1228,7 +1423,7 @@ impl<'a> TRPSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -1246,9 +1441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRPSW`"] -pub type TRPSW_R = crate::R; +#[doc = "Field `TRPSW` reader - TRAP State Clear Control"] +pub struct TRPSW_R(crate::FieldReader); impl TRPSW_R { + pub(crate) fn new(bits: bool) -> Self { + TRPSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRPSW_A { @@ -1260,15 +1458,22 @@ impl TRPSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRPSW_A::VALUE1 + **self == TRPSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRPSW_A::VALUE2 + **self == TRPSW_A::VALUE2 } } -#[doc = "Write proxy for field `TRPSW`"] +impl core::ops::Deref for TRPSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRPSW` writer - TRAP State Clear Control"] pub struct TRPSW_W<'a> { w: &'a mut W, } @@ -1276,9 +1481,7 @@ impl<'a> TRPSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRPSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"] #[inline(always)] @@ -1303,7 +1506,7 @@ impl<'a> TRPSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -1321,9 +1524,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMS`"] -pub type EMS_R = crate::R; +#[doc = "Field `EMS` reader - External Modulation Synchronization"] +pub struct EMS_R(crate::FieldReader); impl EMS_R { + pub(crate) fn new(bits: bool) -> Self { + EMS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMS_A { @@ -1335,15 +1541,22 @@ impl EMS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMS_A::VALUE1 + **self == EMS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMS_A::VALUE2 + **self == EMS_A::VALUE2 } } -#[doc = "Write proxy for field `EMS`"] +impl core::ops::Deref for EMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMS` writer - External Modulation Synchronization"] pub struct EMS_W<'a> { w: &'a mut W, } @@ -1351,9 +1564,7 @@ impl<'a> EMS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] @@ -1378,7 +1589,7 @@ impl<'a> EMS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -1396,9 +1607,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMT`"] -pub type EMT_R = crate::R; +#[doc = "Field `EMT` reader - External Modulation Type"] +pub struct EMT_R(crate::FieldReader); impl EMT_R { + pub(crate) fn new(bits: bool) -> Self { + EMT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMT_A { @@ -1410,15 +1624,22 @@ impl EMT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMT_A::VALUE1 + **self == EMT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMT_A::VALUE2 + **self == EMT_A::VALUE2 } } -#[doc = "Write proxy for field `EMT`"] +impl core::ops::Deref for EMT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMT` writer - External Modulation Type"] pub struct EMT_W<'a> { w: &'a mut W, } @@ -1426,9 +1647,7 @@ impl<'a> EMT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External Modulation functionality is clearing the CC8ySTx bits."] #[inline(always)] @@ -1453,7 +1672,7 @@ impl<'a> EMT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1471,9 +1690,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCME1`"] -pub type MCME1_R = crate::R; +#[doc = "Field `MCME1` reader - Multi Channel Mode Enable for Channel 1"] +pub struct MCME1_R(crate::FieldReader); impl MCME1_R { + pub(crate) fn new(bits: bool) -> Self { + MCME1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCME1_A { @@ -1485,15 +1707,22 @@ impl MCME1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCME1_A::VALUE1 + **self == MCME1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCME1_A::VALUE2 + **self == MCME1_A::VALUE2 } } -#[doc = "Write proxy for field `MCME1`"] +impl core::ops::Deref for MCME1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCME1` writer - Multi Channel Mode Enable for Channel 1"] pub struct MCME1_W<'a> { w: &'a mut W, } @@ -1501,9 +1730,7 @@ impl<'a> MCME1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCME1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Multi Channel Mode in Channel 1 is disabled"] #[inline(always)] @@ -1528,7 +1755,7 @@ impl<'a> MCME1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1546,9 +1773,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCME2`"] -pub type MCME2_R = crate::R; +#[doc = "Field `MCME2` reader - Multi Channel Mode Enable for Channel 2"] +pub struct MCME2_R(crate::FieldReader); impl MCME2_R { + pub(crate) fn new(bits: bool) -> Self { + MCME2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCME2_A { @@ -1560,15 +1790,22 @@ impl MCME2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCME2_A::VALUE1 + **self == MCME2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCME2_A::VALUE2 + **self == MCME2_A::VALUE2 } } -#[doc = "Write proxy for field `MCME2`"] +impl core::ops::Deref for MCME2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCME2` writer - Multi Channel Mode Enable for Channel 2"] pub struct MCME2_W<'a> { w: &'a mut W, } @@ -1576,9 +1813,7 @@ impl<'a> MCME2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCME2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Multi Channel Mode in Channel 2 is disabled"] #[inline(always)] @@ -1603,7 +1838,7 @@ impl<'a> MCME2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1626,9 +1861,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EME`"] -pub type EME_R = crate::R; +#[doc = "Field `EME` reader - External Modulation Channel enable"] +pub struct EME_R(crate::FieldReader); impl EME_R { + pub(crate) fn new(bits: u8) -> Self { + EME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EME_A { @@ -1643,25 +1881,32 @@ impl EME_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EME_A::VALUE1 + **self == EME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EME_A::VALUE2 + **self == EME_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EME_A::VALUE3 + **self == EME_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EME_A::VALUE4 + **self == EME_A::VALUE4 } } -#[doc = "Write proxy for field `EME`"] +impl core::ops::Deref for EME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EME` writer - External Modulation Channel enable"] pub struct EME_W<'a> { w: &'a mut W, } @@ -1669,9 +1914,7 @@ impl<'a> EME_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EME_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Modulation functionality doesn't affect any channel"] #[inline(always)] @@ -1696,7 +1939,7 @@ impl<'a> EME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 27)) | (((value as u32) & 0x03) << 27); + self.w.bits = (self.w.bits & !(0x03 << 27)) | ((value as u32 & 0x03) << 27); self.w } } @@ -1717,37 +1960,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STOS`"] -pub type STOS_R = crate::R; +#[doc = "Field `STOS` reader - Status bit output selector"] +pub struct STOS_R(crate::FieldReader); impl STOS_R { + pub(crate) fn new(bits: u8) -> Self { + STOS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(STOS_A::VALUE1), - 1 => Val(STOS_A::VALUE2), - 2 => Val(STOS_A::VALUE3), - i => Res(i), + 0 => Some(STOS_A::VALUE1), + 1 => Some(STOS_A::VALUE2), + 2 => Some(STOS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STOS_A::VALUE1 + **self == STOS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STOS_A::VALUE2 + **self == STOS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STOS_A::VALUE3 + **self == STOS_A::VALUE3 + } +} +impl core::ops::Deref for STOS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STOS`"] +#[doc = "Field `STOS` writer - Status bit output selector"] pub struct STOS_W<'a> { w: &'a mut W, } @@ -1775,7 +2027,7 @@ impl<'a> STOS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29); + self.w.bits = (self.w.bits & !(0x03 << 29)) | ((value as u32 & 0x03) << 29); self.w } } @@ -2037,4 +2289,30 @@ impl W { pub fn stos(&mut self) -> STOS_W { STOS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Control\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 [tc](index.html) module"] +pub struct TC_SPEC; +impl crate::RegisterSpec for TC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tc::R](R) reader structure"] +impl crate::Readable for TC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tc::W](W) writer structure"] +impl crate::Writable for TC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TC to value 0x1800_0000"] +impl crate::Resettable for TC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1800_0000 + } } diff --git a/src/ccu80_cc80/tcclr.rs b/src/ccu80_cc80/tcclr.rs index 406a6f0d..680037b9 100644 --- a/src/ccu80_cc80/tcclr.rs +++ b/src/ccu80_cc80/tcclr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register TCCLR"] -pub type W = crate::W; -#[doc = "Register TCCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::TCCLR { - type Type = u32; +#[doc = "Register `TCCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `TRBC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TRBC` writer - Timer Run Bit Clear"] pub struct TRBC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> TRBC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `TCC`"] +#[doc = "Field `TCC` writer - Timer Clear"] pub struct TCC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> TCC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `DITC`"] +#[doc = "Field `DITC` writer - Dither Counter Clear"] pub struct DITC_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> DITC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `DTC1C`"] +#[doc = "Field `DTC1C` writer - Dead Time Counter 1 Clear"] pub struct DTC1C_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> DTC1C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `DTC2C`"] +#[doc = "Field `DTC2C` writer - Dead Time Counter 2 Clear"] pub struct DTC2C_W<'a> { w: &'a mut W, } @@ -114,7 +125,7 @@ impl<'a> DTC2C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -144,4 +155,26 @@ impl W { pub fn dtc2c(&mut self) -> DTC2C_W { DTC2C_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcclr](index.html) module"] +pub struct TCCLR_SPEC; +impl crate::RegisterSpec for TCCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tcclr::W](W) writer structure"] +impl crate::Writable for TCCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TCCLR to value 0"] +impl crate::Resettable for TCCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/tcset.rs b/src/ccu80_cc80/tcset.rs index c5f5ccb6..ad135582 100644 --- a/src/ccu80_cc80/tcset.rs +++ b/src/ccu80_cc80/tcset.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register TCSET"] -pub type W = crate::W; -#[doc = "Register TCSET `reset()`'s with value 0"] -impl crate::ResetValue for super::TCSET { - type Type = u32; +#[doc = "Register `TCSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `TRBS`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TRBS` writer - Timer Run Bit set"] pub struct TRBS_W<'a> { w: &'a mut W, } @@ -26,7 +37,7 @@ impl<'a> TRBS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -36,4 +47,26 @@ impl W { pub fn trbs(&mut self) -> TRBS_W { TRBS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slice Timer Run Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcset](index.html) module"] +pub struct TCSET_SPEC; +impl crate::RegisterSpec for TCSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tcset::W](W) writer structure"] +impl crate::Writable for TCSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TCSET to value 0"] +impl crate::Resettable for TCSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ccu80_cc80/tcst.rs b/src/ccu80_cc80/tcst.rs index 0e398e01..82730ae5 100644 --- a/src/ccu80_cc80/tcst.rs +++ b/src/ccu80_cc80/tcst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register TCST"] -pub type R = crate::R; +#[doc = "Register `TCST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Timer Run Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum TRB_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRB`"] -pub type TRB_R = crate::R; +#[doc = "Field `TRB` reader - Timer Run Bit"] +pub struct TRB_R(crate::FieldReader); impl TRB_R { + pub(crate) fn new(bits: bool) -> Self { + TRB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRB_A { @@ -28,12 +44,19 @@ impl TRB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRB_A::VALUE1 + **self == TRB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRB_A::VALUE2 + **self == TRB_A::VALUE2 + } +} +impl core::ops::Deref for TRB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Timer Counting Direction\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CDIR`"] -pub type CDIR_R = crate::R; +#[doc = "Field `CDIR` reader - Timer Counting Direction"] +pub struct CDIR_R(crate::FieldReader); impl CDIR_R { + pub(crate) fn new(bits: bool) -> Self { + CDIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CDIR_A { @@ -64,12 +90,19 @@ impl CDIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CDIR_A::VALUE1 + **self == CDIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CDIR_A::VALUE2 + **self == CDIR_A::VALUE2 + } +} +impl core::ops::Deref for CDIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Dead Time Counter 1 Run bit\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTR1`"] -pub type DTR1_R = crate::R; +#[doc = "Field `DTR1` reader - Dead Time Counter 1 Run bit"] +pub struct DTR1_R(crate::FieldReader); impl DTR1_R { + pub(crate) fn new(bits: bool) -> Self { + DTR1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTR1_A { @@ -100,12 +136,19 @@ impl DTR1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTR1_A::VALUE1 + **self == DTR1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTR1_A::VALUE2 + **self == DTR1_A::VALUE2 + } +} +impl core::ops::Deref for DTR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Dead Time Counter 2 Run bit\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTR2`"] -pub type DTR2_R = crate::R; +#[doc = "Field `DTR2` reader - Dead Time Counter 2 Run bit"] +pub struct DTR2_R(crate::FieldReader); impl DTR2_R { + pub(crate) fn new(bits: bool) -> Self { + DTR2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTR2_A { @@ -136,12 +182,19 @@ impl DTR2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTR2_A::VALUE1 + **self == DTR2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTR2_A::VALUE2 + **self == DTR2_A::VALUE2 + } +} +impl core::ops::Deref for DTR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -166,3 +219,19 @@ impl R { DTR2_R::new(((self.bits >> 4) & 0x01) != 0) } } +#[doc = "Slice Timer Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcst](index.html) module"] +pub struct TCST_SPEC; +impl crate::RegisterSpec for TCST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tcst::R](R) reader structure"] +impl crate::Readable for TCST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TCST to value 0"] +impl crate::Resettable for TCST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccu80_cc80/timer.rs b/src/ccu80_cc80/timer.rs index a231d83b..c0854671 100644 --- a/src/ccu80_cc80/timer.rs +++ b/src/ccu80_cc80/timer.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TIMER"] -pub type R = crate::R; -#[doc = "Writer for register TIMER"] -pub type W = crate::W; -#[doc = "Register TIMER `reset()`'s with value 0"] -impl crate::ResetValue for super::TIMER { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TIMER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TIMER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `TVAL`"] -pub type TVAL_R = crate::R; -#[doc = "Write proxy for field `TVAL`"] +#[doc = "Field `TVAL` reader - Timer Value"] +pub struct TVAL_R(crate::FieldReader); +impl TVAL_R { + pub(crate) fn new(bits: u16) -> Self { + TVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TVAL` writer - Timer Value"] pub struct TVAL_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> TVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn tval(&mut self) -> TVAL_W { TVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer Value\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 [timer](index.html) module"] +pub struct TIMER_SPEC; +impl crate::RegisterSpec for TIMER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [timer::R](R) reader structure"] +impl crate::Readable for TIMER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [timer::W](W) writer structure"] +impl crate::Writable for TIMER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TIMER to value 0"] +impl crate::Resettable for TIMER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac.rs b/src/dac.rs index 1945d78e..0531ac7e 100644 --- a/src/dac.rs +++ b/src/dac.rs @@ -2,157 +2,75 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x04 - DAC0 Configuration Register 0"] - pub dac0cfg0: DAC0CFG0, + pub dac0cfg0: crate::Reg, #[doc = "0x08 - DAC0 Configuration Register 1"] - pub dac0cfg1: DAC0CFG1, + pub dac0cfg1: crate::Reg, #[doc = "0x0c - DAC1 Configuration Register 0"] - pub dac1cfg0: DAC1CFG0, + pub dac1cfg0: crate::Reg, #[doc = "0x10 - DAC1 Configuration Register 1"] - pub dac1cfg1: DAC1CFG1, + pub dac1cfg1: crate::Reg, #[doc = "0x14 - DAC0 Data Register"] - pub dac0data: DAC0DATA, + pub dac0data: crate::Reg, #[doc = "0x18 - DAC1 Data Register"] - pub dac1data: DAC1DATA, + pub dac1data: crate::Reg, #[doc = "0x1c - DAC01 Data Register"] - pub dac01data: DAC01DATA, + pub dac01data: crate::Reg, #[doc = "0x20 - DAC0 Lower Pattern Register"] - pub dac0patl: DAC0PATL, + pub dac0patl: crate::Reg, #[doc = "0x24 - DAC0 Higher Pattern Register"] - pub dac0path: DAC0PATH, + pub dac0path: crate::Reg, #[doc = "0x28 - DAC1 Lower Pattern Register"] - pub dac1patl: DAC1PATL, + pub dac1patl: crate::Reg, #[doc = "0x2c - DAC1 Higher Pattern Register"] - pub dac1path: DAC1PATH, + pub dac1path: crate::Reg, } -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "DAC0 Configuration Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac0cfg0](dac0cfg0) module"] -pub type DAC0CFG0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC0CFG0; -#[doc = "`read()` method returns [dac0cfg0::R](dac0cfg0::R) reader structure"] -impl crate::Readable for DAC0CFG0 {} -#[doc = "`write(|w| ..)` method takes [dac0cfg0::W](dac0cfg0::W) writer structure"] -impl crate::Writable for DAC0CFG0 {} +#[doc = "DAC0CFG0 register accessor: an alias for `Reg`"] +pub type DAC0CFG0 = crate::Reg; #[doc = "DAC0 Configuration Register 0"] pub mod dac0cfg0; -#[doc = "DAC0 Configuration Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac0cfg1](dac0cfg1) module"] -pub type DAC0CFG1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC0CFG1; -#[doc = "`read()` method returns [dac0cfg1::R](dac0cfg1::R) reader structure"] -impl crate::Readable for DAC0CFG1 {} -#[doc = "`write(|w| ..)` method takes [dac0cfg1::W](dac0cfg1::W) writer structure"] -impl crate::Writable for DAC0CFG1 {} +#[doc = "DAC0CFG1 register accessor: an alias for `Reg`"] +pub type DAC0CFG1 = crate::Reg; #[doc = "DAC0 Configuration Register 1"] pub mod dac0cfg1; -#[doc = "DAC1 Configuration Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac1cfg0](dac1cfg0) module"] -pub type DAC1CFG0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC1CFG0; -#[doc = "`read()` method returns [dac1cfg0::R](dac1cfg0::R) reader structure"] -impl crate::Readable for DAC1CFG0 {} -#[doc = "`write(|w| ..)` method takes [dac1cfg0::W](dac1cfg0::W) writer structure"] -impl crate::Writable for DAC1CFG0 {} +#[doc = "DAC1CFG0 register accessor: an alias for `Reg`"] +pub type DAC1CFG0 = crate::Reg; #[doc = "DAC1 Configuration Register 0"] pub mod dac1cfg0; -#[doc = "DAC1 Configuration Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac1cfg1](dac1cfg1) module"] -pub type DAC1CFG1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC1CFG1; -#[doc = "`read()` method returns [dac1cfg1::R](dac1cfg1::R) reader structure"] -impl crate::Readable for DAC1CFG1 {} -#[doc = "`write(|w| ..)` method takes [dac1cfg1::W](dac1cfg1::W) writer structure"] -impl crate::Writable for DAC1CFG1 {} +#[doc = "DAC1CFG1 register accessor: an alias for `Reg`"] +pub type DAC1CFG1 = crate::Reg; #[doc = "DAC1 Configuration Register 1"] pub mod dac1cfg1; -#[doc = "DAC0 Data Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac0data](dac0data) module"] -pub type DAC0DATA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC0DATA; -#[doc = "`read()` method returns [dac0data::R](dac0data::R) reader structure"] -impl crate::Readable for DAC0DATA {} -#[doc = "`write(|w| ..)` method takes [dac0data::W](dac0data::W) writer structure"] -impl crate::Writable for DAC0DATA {} +#[doc = "DAC0DATA register accessor: an alias for `Reg`"] +pub type DAC0DATA = crate::Reg; #[doc = "DAC0 Data Register"] pub mod dac0data; -#[doc = "DAC1 Data Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac1data](dac1data) module"] -pub type DAC1DATA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC1DATA; -#[doc = "`read()` method returns [dac1data::R](dac1data::R) reader structure"] -impl crate::Readable for DAC1DATA {} -#[doc = "`write(|w| ..)` method takes [dac1data::W](dac1data::W) writer structure"] -impl crate::Writable for DAC1DATA {} +#[doc = "DAC1DATA register accessor: an alias for `Reg`"] +pub type DAC1DATA = crate::Reg; #[doc = "DAC1 Data Register"] pub mod dac1data; -#[doc = "DAC01 Data Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac01data](dac01data) module"] -pub type DAC01DATA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC01DATA; -#[doc = "`read()` method returns [dac01data::R](dac01data::R) reader structure"] -impl crate::Readable for DAC01DATA {} -#[doc = "`write(|w| ..)` method takes [dac01data::W](dac01data::W) writer structure"] -impl crate::Writable for DAC01DATA {} +#[doc = "DAC01DATA register accessor: an alias for `Reg`"] +pub type DAC01DATA = crate::Reg; #[doc = "DAC01 Data Register"] pub mod dac01data; -#[doc = "DAC0 Lower Pattern Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac0patl](dac0patl) module"] -pub type DAC0PATL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC0PATL; -#[doc = "`read()` method returns [dac0patl::R](dac0patl::R) reader structure"] -impl crate::Readable for DAC0PATL {} -#[doc = "`write(|w| ..)` method takes [dac0patl::W](dac0patl::W) writer structure"] -impl crate::Writable for DAC0PATL {} +#[doc = "DAC0PATL register accessor: an alias for `Reg`"] +pub type DAC0PATL = crate::Reg; #[doc = "DAC0 Lower Pattern Register"] pub mod dac0patl; -#[doc = "DAC0 Higher Pattern Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac0path](dac0path) module"] -pub type DAC0PATH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC0PATH; -#[doc = "`read()` method returns [dac0path::R](dac0path::R) reader structure"] -impl crate::Readable for DAC0PATH {} -#[doc = "`write(|w| ..)` method takes [dac0path::W](dac0path::W) writer structure"] -impl crate::Writable for DAC0PATH {} +#[doc = "DAC0PATH register accessor: an alias for `Reg`"] +pub type DAC0PATH = crate::Reg; #[doc = "DAC0 Higher Pattern Register"] pub mod dac0path; -#[doc = "DAC1 Lower Pattern Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac1patl](dac1patl) module"] -pub type DAC1PATL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC1PATL; -#[doc = "`read()` method returns [dac1patl::R](dac1patl::R) reader structure"] -impl crate::Readable for DAC1PATL {} -#[doc = "`write(|w| ..)` method takes [dac1patl::W](dac1patl::W) writer structure"] -impl crate::Writable for DAC1PATL {} +#[doc = "DAC1PATL register accessor: an alias for `Reg`"] +pub type DAC1PATL = crate::Reg; #[doc = "DAC1 Lower Pattern Register"] pub mod dac1patl; -#[doc = "DAC1 Higher Pattern Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dac1path](dac1path) module"] -pub type DAC1PATH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAC1PATH; -#[doc = "`read()` method returns [dac1path::R](dac1path::R) reader structure"] -impl crate::Readable for DAC1PATH {} -#[doc = "`write(|w| ..)` method takes [dac1path::W](dac1path::W) writer structure"] -impl crate::Writable for DAC1PATH {} +#[doc = "DAC1PATH register accessor: an alias for `Reg`"] +pub type DAC1PATH = crate::Reg; #[doc = "DAC1 Higher Pattern Register"] pub mod dac1path; diff --git a/src/dac/dac01data.rs b/src/dac/dac01data.rs index 9bcc3f78..f86dd0e0 100644 --- a/src/dac/dac01data.rs +++ b/src/dac/dac01data.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC01DATA"] -pub type R = crate::R; -#[doc = "Writer for register DAC01DATA"] -pub type W = crate::W; -#[doc = "Register DAC01DATA `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC01DATA { - type Type = u32; +#[doc = "Register `DAC01DATA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC01DATA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DATA0` reader - DAC0 Data Bits"] +pub struct DATA0_R(crate::FieldReader); +impl DATA0_R { + pub(crate) fn new(bits: u16) -> Self { + DATA0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATA0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DATA0`"] -pub type DATA0_R = crate::R; -#[doc = "Write proxy for field `DATA0`"] +#[doc = "Field `DATA0` writer - DAC0 Data Bits"] pub struct DATA0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DATA0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } -#[doc = "Reader of field `DATA1`"] -pub type DATA1_R = crate::R; -#[doc = "Write proxy for field `DATA1`"] +#[doc = "Field `DATA1` reader - DAC1 Data Bits"] +pub struct DATA1_R(crate::FieldReader); +impl DATA1_R { + pub(crate) fn new(bits: u16) -> Self { + DATA1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATA1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATA1` writer - DAC1 Data Bits"] pub struct DATA1_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> DATA1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 16)) | (((value as u32) & 0x0fff) << 16); + self.w.bits = (self.w.bits & !(0x0fff << 16)) | ((value as u32 & 0x0fff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn data1(&mut self) -> DATA1_W { DATA1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC01 Data Register\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 [dac01data](index.html) module"] +pub struct DAC01DATA_SPEC; +impl crate::RegisterSpec for DAC01DATA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac01data::R](R) reader structure"] +impl crate::Readable for DAC01DATA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac01data::W](W) writer structure"] +impl crate::Writable for DAC01DATA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC01DATA to value 0"] +impl crate::Resettable for DAC01DATA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac0cfg0.rs b/src/dac/dac0cfg0.rs index fc1e30b2..1d9481db 100644 --- a/src/dac/dac0cfg0.rs +++ b/src/dac/dac0cfg0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC0CFG0"] -pub type R = crate::R; -#[doc = "Writer for register DAC0CFG0"] -pub type W = crate::W; -#[doc = "Register DAC0CFG0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC0CFG0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC0CFG0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC0CFG0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `FREQ`"] -pub type FREQ_R = crate::R; -#[doc = "Write proxy for field `FREQ`"] +#[doc = "Field `FREQ` reader - Integer Frequency Divider Value"] +pub struct FREQ_R(crate::FieldReader); +impl FREQ_R { + pub(crate) fn new(bits: u32) -> Self { + FREQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQ` writer - Integer Frequency Divider Value"] pub struct FREQ_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> FREQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x000f_ffff) | ((value as u32) & 0x000f_ffff); + self.w.bits = (self.w.bits & !0x000f_ffff) | (value as u32 & 0x000f_ffff); self.w } } @@ -51,9 +87,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MODE`"] -pub type MODE_R = crate::R; +#[doc = "Field `MODE` reader - Enables and Sets the Mode for DAC0"] +pub struct MODE_R(crate::FieldReader); impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODE_A { @@ -72,45 +111,52 @@ impl MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODE_A::VALUE1 + **self == MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODE_A::VALUE2 + **self == MODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MODE_A::VALUE3 + **self == MODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MODE_A::VALUE4 + **self == MODE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == MODE_A::VALUE5 + **self == MODE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == MODE_A::VALUE6 + **self == MODE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == MODE_A::VALUE7 + **self == MODE_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == MODE_A::VALUE8 + **self == MODE_A::VALUE8 + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODE`"] +#[doc = "Field `MODE` writer - Enables and Sets the Mode for DAC0"] pub struct MODE_W<'a> { w: &'a mut W, } @@ -118,9 +164,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "disable/switch-off DAC"] #[inline(always)] @@ -165,7 +209,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } @@ -183,9 +227,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SIGN`"] -pub type SIGN_R = crate::R; +#[doc = "Field `SIGN` reader - Selects Between Signed and Unsigned DAC0 Mode"] +pub struct SIGN_R(crate::FieldReader); impl SIGN_R { + pub(crate) fn new(bits: bool) -> Self { + SIGN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SIGN_A { @@ -197,15 +244,22 @@ impl SIGN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIGN_A::VALUE1 + **self == SIGN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIGN_A::VALUE2 + **self == SIGN_A::VALUE2 } } -#[doc = "Write proxy for field `SIGN`"] +impl core::ops::Deref for SIGN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIGN` writer - Selects Between Signed and Unsigned DAC0 Mode"] pub struct SIGN_W<'a> { w: &'a mut W, } @@ -213,9 +267,7 @@ impl<'a> SIGN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIGN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC expects unsigned input data"] #[inline(always)] @@ -240,12 +292,24 @@ impl<'a> SIGN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Reader of field `FIFOIND`"] -pub type FIFOIND_R = crate::R; +#[doc = "Field `FIFOIND` reader - Current write position inside the data FIFO"] +pub struct FIFOIND_R(crate::FieldReader); +impl FIFOIND_R { + pub(crate) fn new(bits: u8) -> Self { + FIFOIND_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FIFOIND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Indicate if the FIFO is empty\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FIFOEMP_A { @@ -260,9 +324,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFOEMP`"] -pub type FIFOEMP_R = crate::R; +#[doc = "Field `FIFOEMP` reader - Indicate if the FIFO is empty"] +pub struct FIFOEMP_R(crate::FieldReader); impl FIFOEMP_R { + pub(crate) fn new(bits: bool) -> Self { + FIFOEMP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFOEMP_A { @@ -274,12 +341,19 @@ impl FIFOEMP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFOEMP_A::VALUE1 + **self == FIFOEMP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFOEMP_A::VALUE2 + **self == FIFOEMP_A::VALUE2 + } +} +impl core::ops::Deref for FIFOEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Indicate if the FIFO is full\n\nValue on reset: 0"] @@ -296,9 +370,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFOFUL`"] -pub type FIFOFUL_R = crate::R; +#[doc = "Field `FIFOFUL` reader - Indicate if the FIFO is full"] +pub struct FIFOFUL_R(crate::FieldReader); impl FIFOFUL_R { + pub(crate) fn new(bits: bool) -> Self { + FIFOFUL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFOFUL_A { @@ -310,12 +387,19 @@ impl FIFOFUL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFOFUL_A::VALUE1 + **self == FIFOFUL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFOFUL_A::VALUE2 + **self == FIFOFUL_A::VALUE2 + } +} +impl core::ops::Deref for FIFOFUL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Negates the DAC0 output\n\nValue on reset: 0"] @@ -332,9 +416,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NEGATE`"] -pub type NEGATE_R = crate::R; +#[doc = "Field `NEGATE` reader - Negates the DAC0 output"] +pub struct NEGATE_R(crate::FieldReader); impl NEGATE_R { + pub(crate) fn new(bits: bool) -> Self { + NEGATE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NEGATE_A { @@ -346,15 +433,22 @@ impl NEGATE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NEGATE_A::VALUE1 + **self == NEGATE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NEGATE_A::VALUE2 + **self == NEGATE_A::VALUE2 + } +} +impl core::ops::Deref for NEGATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NEGATE`"] +#[doc = "Field `NEGATE` writer - Negates the DAC0 output"] pub struct NEGATE_W<'a> { w: &'a mut W, } @@ -362,9 +456,7 @@ impl<'a> NEGATE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NEGATE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC output not negated"] #[inline(always)] @@ -389,7 +481,7 @@ impl<'a> NEGATE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -407,9 +499,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SIGNEN`"] -pub type SIGNEN_R = crate::R; +#[doc = "Field `SIGNEN` reader - Enable Sign Output of DAC0 Pattern Generator"] +pub struct SIGNEN_R(crate::FieldReader); impl SIGNEN_R { + pub(crate) fn new(bits: bool) -> Self { + SIGNEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SIGNEN_A { @@ -421,15 +516,22 @@ impl SIGNEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIGNEN_A::VALUE1 + **self == SIGNEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIGNEN_A::VALUE2 + **self == SIGNEN_A::VALUE2 } } -#[doc = "Write proxy for field `SIGNEN`"] +impl core::ops::Deref for SIGNEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIGNEN` writer - Enable Sign Output of DAC0 Pattern Generator"] pub struct SIGNEN_W<'a> { w: &'a mut W, } @@ -437,9 +539,7 @@ impl<'a> SIGNEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIGNEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -464,7 +564,7 @@ impl<'a> SIGNEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -482,9 +582,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SREN`"] -pub type SREN_R = crate::R; +#[doc = "Field `SREN` reader - Enable DAC0 service request interrupt generation"] +pub struct SREN_R(crate::FieldReader); impl SREN_R { + pub(crate) fn new(bits: bool) -> Self { + SREN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SREN_A { @@ -496,15 +599,22 @@ impl SREN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SREN_A::VALUE1 + **self == SREN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SREN_A::VALUE2 + **self == SREN_A::VALUE2 } } -#[doc = "Write proxy for field `SREN`"] +impl core::ops::Deref for SREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SREN` writer - Enable DAC0 service request interrupt generation"] pub struct SREN_W<'a> { w: &'a mut W, } @@ -512,9 +622,7 @@ impl<'a> SREN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SREN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "disable"] #[inline(always)] @@ -539,7 +647,7 @@ impl<'a> SREN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -557,9 +665,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RUN`"] -pub type RUN_R = crate::R; +#[doc = "Field `RUN` reader - RUN indicates the current DAC0 operation status"] +pub struct RUN_R(crate::FieldReader); impl RUN_R { + pub(crate) fn new(bits: bool) -> Self { + RUN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RUN_A { @@ -571,12 +682,19 @@ impl RUN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RUN_A::VALUE1 + **self == RUN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RUN_A::VALUE2 + **self == RUN_A::VALUE2 + } +} +impl core::ops::Deref for RUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -662,4 +780,30 @@ impl W { pub fn sren(&mut self) -> SREN_W { SREN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC0 Configuration Register 0\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 [dac0cfg0](index.html) module"] +pub struct DAC0CFG0_SPEC; +impl crate::RegisterSpec for DAC0CFG0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac0cfg0::R](R) reader structure"] +impl crate::Readable for DAC0CFG0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac0cfg0::W](W) writer structure"] +impl crate::Writable for DAC0CFG0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC0CFG0 to value 0"] +impl crate::Resettable for DAC0CFG0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac0cfg1.rs b/src/dac/dac0cfg1.rs index 247bd4b5..96181877 100644 --- a/src/dac/dac0cfg1.rs +++ b/src/dac/dac0cfg1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DAC0CFG1"] -pub type R = crate::R; -#[doc = "Writer for register DAC0CFG1"] -pub type W = crate::W; -#[doc = "Register DAC0CFG1 `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC0CFG1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC0CFG1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC0CFG1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Scale value for up- or downscale of the DAC0 input data in steps by the power of 2 (=shift operation)\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SCALE`"] -pub type SCALE_R = crate::R; +#[doc = "Field `SCALE` reader - Scale value for up- or downscale of the DAC0 input data in steps by the power of 2 (=shift operation)"] +pub struct SCALE_R(crate::FieldReader); impl SCALE_R { + pub(crate) fn new(bits: u8) -> Self { + SCALE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCALE_A { @@ -58,45 +85,52 @@ impl SCALE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCALE_A::VALUE1 + **self == SCALE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCALE_A::VALUE2 + **self == SCALE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SCALE_A::VALUE3 + **self == SCALE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SCALE_A::VALUE4 + **self == SCALE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SCALE_A::VALUE5 + **self == SCALE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SCALE_A::VALUE6 + **self == SCALE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SCALE_A::VALUE7 + **self == SCALE_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == SCALE_A::VALUE8 + **self == SCALE_A::VALUE8 + } +} +impl core::ops::Deref for SCALE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SCALE`"] +#[doc = "Field `SCALE` writer - Scale value for up- or downscale of the DAC0 input data in steps by the power of 2 (=shift operation)"] pub struct SCALE_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> SCALE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCALE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "no shift = multiplication/division by 1"] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> SCALE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MULDIV`"] -pub type MULDIV_R = crate::R; +#[doc = "Field `MULDIV` reader - Switch between up- and downscale of the DAC0 input data values"] +pub struct MULDIV_R(crate::FieldReader); impl MULDIV_R { + pub(crate) fn new(bits: bool) -> Self { + MULDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MULDIV_A { @@ -183,15 +218,22 @@ impl MULDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MULDIV_A::VALUE1 + **self == MULDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MULDIV_A::VALUE2 + **self == MULDIV_A::VALUE2 + } +} +impl core::ops::Deref for MULDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MULDIV`"] +#[doc = "Field `MULDIV` writer - Switch between up- and downscale of the DAC0 input data values"] pub struct MULDIV_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> MULDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MULDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] @@ -226,13 +266,25 @@ impl<'a> MULDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `OFFS`"] -pub type OFFS_R = crate::R; -#[doc = "Write proxy for field `OFFS`"] +#[doc = "Field `OFFS` reader - 8-bit offset value addition"] +pub struct OFFS_R(crate::FieldReader); +impl OFFS_R { + pub(crate) fn new(bits: u8) -> Self { + OFFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OFFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFS` writer - 8-bit offset value addition"] pub struct OFFS_W<'a> { w: &'a mut W, } @@ -240,13 +292,25 @@ impl<'a> OFFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 4)) | (((value as u32) & 0xff) << 4); + self.w.bits = (self.w.bits & !(0xff << 4)) | ((value as u32 & 0xff) << 4); self.w } } -#[doc = "Reader of field `TRIGSEL`"] -pub type TRIGSEL_R = crate::R; -#[doc = "Write proxy for field `TRIGSEL`"] +#[doc = "Field `TRIGSEL` reader - Selects one of the eight external trigger sources for DAC0"] +pub struct TRIGSEL_R(crate::FieldReader); +impl TRIGSEL_R { + pub(crate) fn new(bits: u8) -> Self { + TRIGSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRIGSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGSEL` writer - Selects one of the eight external trigger sources for DAC0"] pub struct TRIGSEL_W<'a> { w: &'a mut W, } @@ -254,7 +318,7 @@ impl<'a> TRIGSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } @@ -272,9 +336,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DATMOD`"] -pub type DATMOD_R = crate::R; +#[doc = "Field `DATMOD` reader - Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1"] +pub struct DATMOD_R(crate::FieldReader); impl DATMOD_R { + pub(crate) fn new(bits: bool) -> Self { + DATMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DATMOD_A { @@ -286,15 +353,22 @@ impl DATMOD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DATMOD_A::VALUE1 + **self == DATMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DATMOD_A::VALUE2 + **self == DATMOD_A::VALUE2 + } +} +impl core::ops::Deref for DATMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DATMOD`"] +#[doc = "Field `DATMOD` writer - Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1"] pub struct DATMOD_W<'a> { w: &'a mut W, } @@ -302,9 +376,7 @@ impl<'a> DATMOD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DATMOD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "independent data handling - process data from DATA0 register (bits 11:0) to DAC0 and data from DATA1 register (bits 11:0) to DAC1"] #[inline(always)] @@ -329,13 +401,25 @@ impl<'a> DATMOD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `SWTRIG`"] -pub type SWTRIG_R = crate::R; -#[doc = "Write proxy for field `SWTRIG`"] +#[doc = "Field `SWTRIG` reader - Software Trigger"] +pub struct SWTRIG_R(crate::FieldReader); +impl SWTRIG_R { + pub(crate) fn new(bits: bool) -> Self { + SWTRIG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWTRIG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWTRIG` writer - Software Trigger"] pub struct SWTRIG_W<'a> { w: &'a mut W, } @@ -353,7 +437,7 @@ impl<'a> SWTRIG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -374,37 +458,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRIGMOD`"] -pub type TRIGMOD_R = crate::R; +#[doc = "Field `TRIGMOD` reader - Select the trigger source for channel 0"] +pub struct TRIGMOD_R(crate::FieldReader); impl TRIGMOD_R { + pub(crate) fn new(bits: u8) -> Self { + TRIGMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TRIGMOD_A::VALUE1), - 1 => Val(TRIGMOD_A::VALUE2), - 2 => Val(TRIGMOD_A::VALUE3), - i => Res(i), + 0 => Some(TRIGMOD_A::VALUE1), + 1 => Some(TRIGMOD_A::VALUE2), + 2 => Some(TRIGMOD_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRIGMOD_A::VALUE1 + **self == TRIGMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRIGMOD_A::VALUE2 + **self == TRIGMOD_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRIGMOD_A::VALUE3 + **self == TRIGMOD_A::VALUE3 } } -#[doc = "Write proxy for field `TRIGMOD`"] +impl core::ops::Deref for TRIGMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGMOD` writer - Select the trigger source for channel 0"] pub struct TRIGMOD_W<'a> { w: &'a mut W, } @@ -432,13 +525,25 @@ impl<'a> TRIGMOD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 17)) | (((value as u32) & 0x03) << 17); + self.w.bits = (self.w.bits & !(0x03 << 17)) | ((value as u32 & 0x03) << 17); self.w } } -#[doc = "Reader of field `ANACFG`"] -pub type ANACFG_R = crate::R; -#[doc = "Write proxy for field `ANACFG`"] +#[doc = "Field `ANACFG` reader - DAC0 analog configuration/calibration parameters"] +pub struct ANACFG_R(crate::FieldReader); +impl ANACFG_R { + pub(crate) fn new(bits: u8) -> Self { + ANACFG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ANACFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANACFG` writer - DAC0 analog configuration/calibration parameters"] pub struct ANACFG_W<'a> { w: &'a mut W, } @@ -446,7 +551,7 @@ impl<'a> ANACFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -464,9 +569,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ANAEN`"] -pub type ANAEN_R = crate::R; +#[doc = "Field `ANAEN` reader - Enable analog DAC for channel 0"] +pub struct ANAEN_R(crate::FieldReader); impl ANAEN_R { + pub(crate) fn new(bits: bool) -> Self { + ANAEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ANAEN_A { @@ -478,15 +586,22 @@ impl ANAEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ANAEN_A::VALUE1 + **self == ANAEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ANAEN_A::VALUE2 + **self == ANAEN_A::VALUE2 } } -#[doc = "Write proxy for field `ANAEN`"] +impl core::ops::Deref for ANAEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANAEN` writer - Enable analog DAC for channel 0"] pub struct ANAEN_W<'a> { w: &'a mut W, } @@ -494,9 +609,7 @@ impl<'a> ANAEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ANAEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC0 is set to standby (analog output only)"] #[inline(always)] @@ -521,13 +634,25 @@ impl<'a> ANAEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Reader of field `REFCFGL`"] -pub type REFCFGL_R = crate::R; -#[doc = "Write proxy for field `REFCFGL`"] +#[doc = "Field `REFCFGL` reader - Lower 4 band-gap configuration/calibration parameters"] +pub struct REFCFGL_R(crate::FieldReader); +impl REFCFGL_R { + pub(crate) fn new(bits: u8) -> Self { + REFCFGL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REFCFGL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFCFGL` writer - Lower 4 band-gap configuration/calibration parameters"] pub struct REFCFGL_W<'a> { w: &'a mut W, } @@ -535,7 +660,7 @@ impl<'a> REFCFGL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -642,4 +767,30 @@ impl W { pub fn refcfgl(&mut self) -> REFCFGL_W { REFCFGL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC0 Configuration Register 1\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 [dac0cfg1](index.html) module"] +pub struct DAC0CFG1_SPEC; +impl crate::RegisterSpec for DAC0CFG1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac0cfg1::R](R) reader structure"] +impl crate::Readable for DAC0CFG1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac0cfg1::W](W) writer structure"] +impl crate::Writable for DAC0CFG1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC0CFG1 to value 0"] +impl crate::Resettable for DAC0CFG1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac0data.rs b/src/dac/dac0data.rs index 51dadd19..2e7c4939 100644 --- a/src/dac/dac0data.rs +++ b/src/dac/dac0data.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC0DATA"] -pub type R = crate::R; -#[doc = "Writer for register DAC0DATA"] -pub type W = crate::W; -#[doc = "Register DAC0DATA `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC0DATA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC0DATA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC0DATA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DATA0`"] -pub type DATA0_R = crate::R; -#[doc = "Write proxy for field `DATA0`"] +#[doc = "Field `DATA0` reader - DAC0 Data Bits"] +pub struct DATA0_R(crate::FieldReader); +impl DATA0_R { + pub(crate) fn new(bits: u16) -> Self { + DATA0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATA0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATA0` writer - DAC0 Data Bits"] pub struct DATA0_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DATA0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn data0(&mut self) -> DATA0_W { DATA0_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC0 Data Register\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 [dac0data](index.html) module"] +pub struct DAC0DATA_SPEC; +impl crate::RegisterSpec for DAC0DATA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac0data::R](R) reader structure"] +impl crate::Readable for DAC0DATA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac0data::W](W) writer structure"] +impl crate::Writable for DAC0DATA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC0DATA to value 0"] +impl crate::Resettable for DAC0DATA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac0path.rs b/src/dac/dac0path.rs index 41d36564..918ced30 100644 --- a/src/dac/dac0path.rs +++ b/src/dac/dac0path.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC0PATH"] -pub type R = crate::R; -#[doc = "Writer for register DAC0PATH"] -pub type W = crate::W; -#[doc = "Register DAC0PATH `reset()`'s with value 0x7fdd"] -impl crate::ResetValue for super::DAC0PATH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x7fdd +#[doc = "Register `DAC0PATH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC0PATH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PAT6` reader - Pattern Number 6 for PATGEN of DAC0"] +pub struct PAT6_R(crate::FieldReader); +impl PAT6_R { + pub(crate) fn new(bits: u8) -> Self { + PAT6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PAT6`"] -pub type PAT6_R = crate::R; -#[doc = "Write proxy for field `PAT6`"] +#[doc = "Field `PAT6` writer - Pattern Number 6 for PATGEN of DAC0"] pub struct PAT6_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PAT6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } -#[doc = "Reader of field `PAT7`"] -pub type PAT7_R = crate::R; -#[doc = "Write proxy for field `PAT7`"] +#[doc = "Field `PAT7` reader - Pattern Number 7 for PATGEN of DAC0"] +pub struct PAT7_R(crate::FieldReader); +impl PAT7_R { + pub(crate) fn new(bits: u8) -> Self { + PAT7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT7` writer - Pattern Number 7 for PATGEN of DAC0"] pub struct PAT7_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PAT7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 5)) | (((value as u32) & 0x1f) << 5); + self.w.bits = (self.w.bits & !(0x1f << 5)) | ((value as u32 & 0x1f) << 5); self.w } } -#[doc = "Reader of field `PAT8`"] -pub type PAT8_R = crate::R; -#[doc = "Write proxy for field `PAT8`"] +#[doc = "Field `PAT8` reader - Pattern Number 8 for PATGEN of DAC0"] +pub struct PAT8_R(crate::FieldReader); +impl PAT8_R { + pub(crate) fn new(bits: u8) -> Self { + PAT8_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT8` writer - Pattern Number 8 for PATGEN of DAC0"] pub struct PAT8_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> PAT8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 10)) | (((value as u32) & 0x1f) << 10); + self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10); self.w } } @@ -85,4 +145,30 @@ impl W { pub fn pat8(&mut self) -> PAT8_W { PAT8_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC0 Higher Pattern Register\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 [dac0path](index.html) module"] +pub struct DAC0PATH_SPEC; +impl crate::RegisterSpec for DAC0PATH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac0path::R](R) reader structure"] +impl crate::Readable for DAC0PATH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac0path::W](W) writer structure"] +impl crate::Writable for DAC0PATH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC0PATH to value 0x7fdd"] +impl crate::Resettable for DAC0PATH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x7fdd + } } diff --git a/src/dac/dac0patl.rs b/src/dac/dac0patl.rs index ec53bbe7..ff99d9c0 100644 --- a/src/dac/dac0patl.rs +++ b/src/dac/dac0patl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC0PATL"] -pub type R = crate::R; -#[doc = "Writer for register DAC0PATL"] -pub type W = crate::W; -#[doc = "Register DAC0PATL `reset()`'s with value 0x3568_b0c0"] -impl crate::ResetValue for super::DAC0PATL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x3568_b0c0 +#[doc = "Register `DAC0PATL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC0PATL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PAT0`"] -pub type PAT0_R = crate::R; -#[doc = "Write proxy for field `PAT0`"] +#[doc = "Field `PAT0` reader - Pattern Number 0 for PATGEN of DAC0"] +pub struct PAT0_R(crate::FieldReader); +impl PAT0_R { + pub(crate) fn new(bits: u8) -> Self { + PAT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT0` writer - Pattern Number 0 for PATGEN of DAC0"] pub struct PAT0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PAT0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } -#[doc = "Reader of field `PAT1`"] -pub type PAT1_R = crate::R; -#[doc = "Write proxy for field `PAT1`"] +#[doc = "Field `PAT1` reader - Pattern Number 1 for PATGEN of DAC0"] +pub struct PAT1_R(crate::FieldReader); +impl PAT1_R { + pub(crate) fn new(bits: u8) -> Self { + PAT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT1` writer - Pattern Number 1 for PATGEN of DAC0"] pub struct PAT1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PAT1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 5)) | (((value as u32) & 0x1f) << 5); + self.w.bits = (self.w.bits & !(0x1f << 5)) | ((value as u32 & 0x1f) << 5); self.w } } -#[doc = "Reader of field `PAT2`"] -pub type PAT2_R = crate::R; -#[doc = "Write proxy for field `PAT2`"] +#[doc = "Field `PAT2` reader - Pattern Number 2 for PATGEN of DAC0"] +pub struct PAT2_R(crate::FieldReader); +impl PAT2_R { + pub(crate) fn new(bits: u8) -> Self { + PAT2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT2` writer - Pattern Number 2 for PATGEN of DAC0"] pub struct PAT2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PAT2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 10)) | (((value as u32) & 0x1f) << 10); + self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10); self.w } } -#[doc = "Reader of field `PAT3`"] -pub type PAT3_R = crate::R; -#[doc = "Write proxy for field `PAT3`"] +#[doc = "Field `PAT3` reader - Pattern Number 3 for PATGEN of DAC0"] +pub struct PAT3_R(crate::FieldReader); +impl PAT3_R { + pub(crate) fn new(bits: u8) -> Self { + PAT3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT3` writer - Pattern Number 3 for PATGEN of DAC0"] pub struct PAT3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PAT3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 15)) | (((value as u32) & 0x1f) << 15); + self.w.bits = (self.w.bits & !(0x1f << 15)) | ((value as u32 & 0x1f) << 15); self.w } } -#[doc = "Reader of field `PAT4`"] -pub type PAT4_R = crate::R; -#[doc = "Write proxy for field `PAT4`"] +#[doc = "Field `PAT4` reader - Pattern Number 4 for PATGEN of DAC0"] +pub struct PAT4_R(crate::FieldReader); +impl PAT4_R { + pub(crate) fn new(bits: u8) -> Self { + PAT4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT4` writer - Pattern Number 4 for PATGEN of DAC0"] pub struct PAT4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PAT4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 20)) | (((value as u32) & 0x1f) << 20); + self.w.bits = (self.w.bits & !(0x1f << 20)) | ((value as u32 & 0x1f) << 20); self.w } } -#[doc = "Reader of field `PAT5`"] -pub type PAT5_R = crate::R; -#[doc = "Write proxy for field `PAT5`"] +#[doc = "Field `PAT5` reader - Pattern Number 5 for PATGEN of DAC0"] +pub struct PAT5_R(crate::FieldReader); +impl PAT5_R { + pub(crate) fn new(bits: u8) -> Self { + PAT5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT5` writer - Pattern Number 5 for PATGEN of DAC0"] pub struct PAT5_W<'a> { w: &'a mut W, } @@ -90,7 +186,7 @@ impl<'a> PAT5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 25)) | (((value as u32) & 0x1f) << 25); + self.w.bits = (self.w.bits & !(0x1f << 25)) | ((value as u32 & 0x1f) << 25); self.w } } @@ -157,4 +253,30 @@ impl W { pub fn pat5(&mut self) -> PAT5_W { PAT5_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC0 Lower Pattern Register\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 [dac0patl](index.html) module"] +pub struct DAC0PATL_SPEC; +impl crate::RegisterSpec for DAC0PATL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac0patl::R](R) reader structure"] +impl crate::Readable for DAC0PATL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac0patl::W](W) writer structure"] +impl crate::Writable for DAC0PATL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC0PATL to value 0x3568_b0c0"] +impl crate::Resettable for DAC0PATL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3568_b0c0 + } } diff --git a/src/dac/dac1cfg0.rs b/src/dac/dac1cfg0.rs index 54c26b25..36023c9f 100644 --- a/src/dac/dac1cfg0.rs +++ b/src/dac/dac1cfg0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC1CFG0"] -pub type R = crate::R; -#[doc = "Writer for register DAC1CFG0"] -pub type W = crate::W; -#[doc = "Register DAC1CFG0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC1CFG0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC1CFG0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC1CFG0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `FREQ`"] -pub type FREQ_R = crate::R; -#[doc = "Write proxy for field `FREQ`"] +#[doc = "Field `FREQ` reader - Integer Frequency Divider Value"] +pub struct FREQ_R(crate::FieldReader); +impl FREQ_R { + pub(crate) fn new(bits: u32) -> Self { + FREQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQ` writer - Integer Frequency Divider Value"] pub struct FREQ_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> FREQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x000f_ffff) | ((value as u32) & 0x000f_ffff); + self.w.bits = (self.w.bits & !0x000f_ffff) | (value as u32 & 0x000f_ffff); self.w } } @@ -51,9 +87,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MODE`"] -pub type MODE_R = crate::R; +#[doc = "Field `MODE` reader - Enables and sets the Mode for DAC1"] +pub struct MODE_R(crate::FieldReader); impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODE_A { @@ -72,45 +111,52 @@ impl MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODE_A::VALUE1 + **self == MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODE_A::VALUE2 + **self == MODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MODE_A::VALUE3 + **self == MODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MODE_A::VALUE4 + **self == MODE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == MODE_A::VALUE5 + **self == MODE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == MODE_A::VALUE6 + **self == MODE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == MODE_A::VALUE7 + **self == MODE_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == MODE_A::VALUE8 + **self == MODE_A::VALUE8 + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODE`"] +#[doc = "Field `MODE` writer - Enables and sets the Mode for DAC1"] pub struct MODE_W<'a> { w: &'a mut W, } @@ -118,9 +164,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "disable/switch-off DAC"] #[inline(always)] @@ -165,7 +209,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } @@ -183,9 +227,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SIGN`"] -pub type SIGN_R = crate::R; +#[doc = "Field `SIGN` reader - Selects between signed and unsigned DAC1 mode"] +pub struct SIGN_R(crate::FieldReader); impl SIGN_R { + pub(crate) fn new(bits: bool) -> Self { + SIGN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SIGN_A { @@ -197,15 +244,22 @@ impl SIGN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIGN_A::VALUE1 + **self == SIGN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIGN_A::VALUE2 + **self == SIGN_A::VALUE2 } } -#[doc = "Write proxy for field `SIGN`"] +impl core::ops::Deref for SIGN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIGN` writer - Selects between signed and unsigned DAC1 mode"] pub struct SIGN_W<'a> { w: &'a mut W, } @@ -213,9 +267,7 @@ impl<'a> SIGN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIGN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC expects unsigned input data"] #[inline(always)] @@ -240,12 +292,24 @@ impl<'a> SIGN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Reader of field `FIFOIND`"] -pub type FIFOIND_R = crate::R; +#[doc = "Field `FIFOIND` reader - Current write position inside the data FIFO"] +pub struct FIFOIND_R(crate::FieldReader); +impl FIFOIND_R { + pub(crate) fn new(bits: u8) -> Self { + FIFOIND_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FIFOIND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Indicate if the FIFO is empty\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FIFOEMP_A { @@ -260,9 +324,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFOEMP`"] -pub type FIFOEMP_R = crate::R; +#[doc = "Field `FIFOEMP` reader - Indicate if the FIFO is empty"] +pub struct FIFOEMP_R(crate::FieldReader); impl FIFOEMP_R { + pub(crate) fn new(bits: bool) -> Self { + FIFOEMP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFOEMP_A { @@ -274,12 +341,19 @@ impl FIFOEMP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFOEMP_A::VALUE1 + **self == FIFOEMP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFOEMP_A::VALUE2 + **self == FIFOEMP_A::VALUE2 + } +} +impl core::ops::Deref for FIFOEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Indicate if the FIFO is full\n\nValue on reset: 0"] @@ -296,9 +370,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFOFUL`"] -pub type FIFOFUL_R = crate::R; +#[doc = "Field `FIFOFUL` reader - Indicate if the FIFO is full"] +pub struct FIFOFUL_R(crate::FieldReader); impl FIFOFUL_R { + pub(crate) fn new(bits: bool) -> Self { + FIFOFUL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFOFUL_A { @@ -310,12 +387,19 @@ impl FIFOFUL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFOFUL_A::VALUE1 + **self == FIFOFUL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFOFUL_A::VALUE2 + **self == FIFOFUL_A::VALUE2 + } +} +impl core::ops::Deref for FIFOFUL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Negates the DAC1 output\n\nValue on reset: 0"] @@ -332,9 +416,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NEGATE`"] -pub type NEGATE_R = crate::R; +#[doc = "Field `NEGATE` reader - Negates the DAC1 output"] +pub struct NEGATE_R(crate::FieldReader); impl NEGATE_R { + pub(crate) fn new(bits: bool) -> Self { + NEGATE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NEGATE_A { @@ -346,15 +433,22 @@ impl NEGATE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NEGATE_A::VALUE1 + **self == NEGATE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NEGATE_A::VALUE2 + **self == NEGATE_A::VALUE2 + } +} +impl core::ops::Deref for NEGATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NEGATE`"] +#[doc = "Field `NEGATE` writer - Negates the DAC1 output"] pub struct NEGATE_W<'a> { w: &'a mut W, } @@ -362,9 +456,7 @@ impl<'a> NEGATE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NEGATE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC output not negated"] #[inline(always)] @@ -389,7 +481,7 @@ impl<'a> NEGATE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -407,9 +499,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SIGNEN`"] -pub type SIGNEN_R = crate::R; +#[doc = "Field `SIGNEN` reader - Enable sign output of DAC1 pattern generator"] +pub struct SIGNEN_R(crate::FieldReader); impl SIGNEN_R { + pub(crate) fn new(bits: bool) -> Self { + SIGNEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SIGNEN_A { @@ -421,15 +516,22 @@ impl SIGNEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIGNEN_A::VALUE1 + **self == SIGNEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIGNEN_A::VALUE2 + **self == SIGNEN_A::VALUE2 } } -#[doc = "Write proxy for field `SIGNEN`"] +impl core::ops::Deref for SIGNEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIGNEN` writer - Enable sign output of DAC1 pattern generator"] pub struct SIGNEN_W<'a> { w: &'a mut W, } @@ -437,9 +539,7 @@ impl<'a> SIGNEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIGNEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "disable"] #[inline(always)] @@ -464,7 +564,7 @@ impl<'a> SIGNEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -482,9 +582,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SREN`"] -pub type SREN_R = crate::R; +#[doc = "Field `SREN` reader - Enable DAC1 service request interrupt generation"] +pub struct SREN_R(crate::FieldReader); impl SREN_R { + pub(crate) fn new(bits: bool) -> Self { + SREN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SREN_A { @@ -496,15 +599,22 @@ impl SREN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SREN_A::VALUE1 + **self == SREN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SREN_A::VALUE2 + **self == SREN_A::VALUE2 } } -#[doc = "Write proxy for field `SREN`"] +impl core::ops::Deref for SREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SREN` writer - Enable DAC1 service request interrupt generation"] pub struct SREN_W<'a> { w: &'a mut W, } @@ -512,9 +622,7 @@ impl<'a> SREN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SREN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "disable"] #[inline(always)] @@ -539,7 +647,7 @@ impl<'a> SREN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -557,9 +665,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RUN`"] -pub type RUN_R = crate::R; +#[doc = "Field `RUN` reader - RUN indicates the current DAC1 operation status"] +pub struct RUN_R(crate::FieldReader); impl RUN_R { + pub(crate) fn new(bits: bool) -> Self { + RUN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RUN_A { @@ -571,12 +682,19 @@ impl RUN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RUN_A::VALUE1 + **self == RUN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RUN_A::VALUE2 + **self == RUN_A::VALUE2 + } +} +impl core::ops::Deref for RUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -662,4 +780,30 @@ impl W { pub fn sren(&mut self) -> SREN_W { SREN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC1 Configuration Register 0\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 [dac1cfg0](index.html) module"] +pub struct DAC1CFG0_SPEC; +impl crate::RegisterSpec for DAC1CFG0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac1cfg0::R](R) reader structure"] +impl crate::Readable for DAC1CFG0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac1cfg0::W](W) writer structure"] +impl crate::Writable for DAC1CFG0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC1CFG0 to value 0"] +impl crate::Resettable for DAC1CFG0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac1cfg1.rs b/src/dac/dac1cfg1.rs index c77030af..1f884603 100644 --- a/src/dac/dac1cfg1.rs +++ b/src/dac/dac1cfg1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DAC1CFG1"] -pub type R = crate::R; -#[doc = "Writer for register DAC1CFG1"] -pub type W = crate::W; -#[doc = "Register DAC1CFG1 `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC1CFG1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC1CFG1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC1CFG1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Scale value for up- or downscale of the DAC1 input data in steps by the power of 2 (=shift operation)\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SCALE`"] -pub type SCALE_R = crate::R; +#[doc = "Field `SCALE` reader - Scale value for up- or downscale of the DAC1 input data in steps by the power of 2 (=shift operation)"] +pub struct SCALE_R(crate::FieldReader); impl SCALE_R { + pub(crate) fn new(bits: u8) -> Self { + SCALE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCALE_A { @@ -58,45 +85,52 @@ impl SCALE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCALE_A::VALUE1 + **self == SCALE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCALE_A::VALUE2 + **self == SCALE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SCALE_A::VALUE3 + **self == SCALE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SCALE_A::VALUE4 + **self == SCALE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SCALE_A::VALUE5 + **self == SCALE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SCALE_A::VALUE6 + **self == SCALE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SCALE_A::VALUE7 + **self == SCALE_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == SCALE_A::VALUE8 + **self == SCALE_A::VALUE8 + } +} +impl core::ops::Deref for SCALE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SCALE`"] +#[doc = "Field `SCALE` writer - Scale value for up- or downscale of the DAC1 input data in steps by the power of 2 (=shift operation)"] pub struct SCALE_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> SCALE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCALE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "no shift = multiplication/division by 1"] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> SCALE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MULDIV`"] -pub type MULDIV_R = crate::R; +#[doc = "Field `MULDIV` reader - Switch between up- and downscale of the DAC1 input data values"] +pub struct MULDIV_R(crate::FieldReader); impl MULDIV_R { + pub(crate) fn new(bits: bool) -> Self { + MULDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MULDIV_A { @@ -183,15 +218,22 @@ impl MULDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MULDIV_A::VALUE1 + **self == MULDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MULDIV_A::VALUE2 + **self == MULDIV_A::VALUE2 } } -#[doc = "Write proxy for field `MULDIV`"] +impl core::ops::Deref for MULDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MULDIV` writer - Switch between up- and downscale of the DAC1 input data values"] pub struct MULDIV_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> MULDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MULDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] @@ -226,13 +266,25 @@ impl<'a> MULDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `OFFS`"] -pub type OFFS_R = crate::R; -#[doc = "Write proxy for field `OFFS`"] +#[doc = "Field `OFFS` reader - 8-bit offset value addition"] +pub struct OFFS_R(crate::FieldReader); +impl OFFS_R { + pub(crate) fn new(bits: u8) -> Self { + OFFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OFFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFS` writer - 8-bit offset value addition"] pub struct OFFS_W<'a> { w: &'a mut W, } @@ -240,13 +292,25 @@ impl<'a> OFFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 4)) | (((value as u32) & 0xff) << 4); + self.w.bits = (self.w.bits & !(0xff << 4)) | ((value as u32 & 0xff) << 4); self.w } } -#[doc = "Reader of field `TRIGSEL`"] -pub type TRIGSEL_R = crate::R; -#[doc = "Write proxy for field `TRIGSEL`"] +#[doc = "Field `TRIGSEL` reader - Selects one of the eight external trigger sources for DAC1"] +pub struct TRIGSEL_R(crate::FieldReader); +impl TRIGSEL_R { + pub(crate) fn new(bits: u8) -> Self { + TRIGSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRIGSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGSEL` writer - Selects one of the eight external trigger sources for DAC1"] pub struct TRIGSEL_W<'a> { w: &'a mut W, } @@ -254,13 +318,25 @@ impl<'a> TRIGSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `SWTRIG`"] -pub type SWTRIG_R = crate::R; -#[doc = "Write proxy for field `SWTRIG`"] +#[doc = "Field `SWTRIG` reader - Software Trigger"] +pub struct SWTRIG_R(crate::FieldReader); +impl SWTRIG_R { + pub(crate) fn new(bits: bool) -> Self { + SWTRIG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWTRIG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWTRIG` writer - Software Trigger"] pub struct SWTRIG_W<'a> { w: &'a mut W, } @@ -278,7 +354,7 @@ impl<'a> SWTRIG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -299,37 +375,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRIGMOD`"] -pub type TRIGMOD_R = crate::R; +#[doc = "Field `TRIGMOD` reader - Select the trigger source for channel 1"] +pub struct TRIGMOD_R(crate::FieldReader); impl TRIGMOD_R { + pub(crate) fn new(bits: u8) -> Self { + TRIGMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TRIGMOD_A::VALUE1), - 1 => Val(TRIGMOD_A::VALUE2), - 2 => Val(TRIGMOD_A::VALUE3), - i => Res(i), + 0 => Some(TRIGMOD_A::VALUE1), + 1 => Some(TRIGMOD_A::VALUE2), + 2 => Some(TRIGMOD_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRIGMOD_A::VALUE1 + **self == TRIGMOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRIGMOD_A::VALUE2 + **self == TRIGMOD_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRIGMOD_A::VALUE3 + **self == TRIGMOD_A::VALUE3 + } +} +impl core::ops::Deref for TRIGMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRIGMOD`"] +#[doc = "Field `TRIGMOD` writer - Select the trigger source for channel 1"] pub struct TRIGMOD_W<'a> { w: &'a mut W, } @@ -357,13 +442,25 @@ impl<'a> TRIGMOD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 17)) | (((value as u32) & 0x03) << 17); + self.w.bits = (self.w.bits & !(0x03 << 17)) | ((value as u32 & 0x03) << 17); self.w } } -#[doc = "Reader of field `ANACFG`"] -pub type ANACFG_R = crate::R; -#[doc = "Write proxy for field `ANACFG`"] +#[doc = "Field `ANACFG` reader - DAC1 analog configuration/calibration parameters"] +pub struct ANACFG_R(crate::FieldReader); +impl ANACFG_R { + pub(crate) fn new(bits: u8) -> Self { + ANACFG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ANACFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANACFG` writer - DAC1 analog configuration/calibration parameters"] pub struct ANACFG_W<'a> { w: &'a mut W, } @@ -371,7 +468,7 @@ impl<'a> ANACFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -389,9 +486,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ANAEN`"] -pub type ANAEN_R = crate::R; +#[doc = "Field `ANAEN` reader - Enable analog DAC for channel 1"] +pub struct ANAEN_R(crate::FieldReader); impl ANAEN_R { + pub(crate) fn new(bits: bool) -> Self { + ANAEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ANAEN_A { @@ -403,15 +503,22 @@ impl ANAEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ANAEN_A::VALUE1 + **self == ANAEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ANAEN_A::VALUE2 + **self == ANAEN_A::VALUE2 } } -#[doc = "Write proxy for field `ANAEN`"] +impl core::ops::Deref for ANAEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANAEN` writer - Enable analog DAC for channel 1"] pub struct ANAEN_W<'a> { w: &'a mut W, } @@ -419,9 +526,7 @@ impl<'a> ANAEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ANAEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DAC1 is set to standby (analog output only)"] #[inline(always)] @@ -446,13 +551,25 @@ impl<'a> ANAEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Reader of field `REFCFGH`"] -pub type REFCFGH_R = crate::R; -#[doc = "Write proxy for field `REFCFGH`"] +#[doc = "Field `REFCFGH` reader - Higher 4 band-gap configuration/calibration parameters"] +pub struct REFCFGH_R(crate::FieldReader); +impl REFCFGH_R { + pub(crate) fn new(bits: u8) -> Self { + REFCFGH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REFCFGH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFCFGH` writer - Higher 4 band-gap configuration/calibration parameters"] pub struct REFCFGH_W<'a> { w: &'a mut W, } @@ -460,7 +577,7 @@ impl<'a> REFCFGH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -557,4 +674,30 @@ impl W { pub fn refcfgh(&mut self) -> REFCFGH_W { REFCFGH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC1 Configuration Register 1\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 [dac1cfg1](index.html) module"] +pub struct DAC1CFG1_SPEC; +impl crate::RegisterSpec for DAC1CFG1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac1cfg1::R](R) reader structure"] +impl crate::Readable for DAC1CFG1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac1cfg1::W](W) writer structure"] +impl crate::Writable for DAC1CFG1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC1CFG1 to value 0"] +impl crate::Resettable for DAC1CFG1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac1data.rs b/src/dac/dac1data.rs index 1d4ba429..927fff82 100644 --- a/src/dac/dac1data.rs +++ b/src/dac/dac1data.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC1DATA"] -pub type R = crate::R; -#[doc = "Writer for register DAC1DATA"] -pub type W = crate::W; -#[doc = "Register DAC1DATA `reset()`'s with value 0"] -impl crate::ResetValue for super::DAC1DATA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAC1DATA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC1DATA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DATA1`"] -pub type DATA1_R = crate::R; -#[doc = "Write proxy for field `DATA1`"] +#[doc = "Field `DATA1` reader - DAC1 Data Bits"] +pub struct DATA1_R(crate::FieldReader); +impl DATA1_R { + pub(crate) fn new(bits: u16) -> Self { + DATA1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATA1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATA1` writer - DAC1 Data Bits"] pub struct DATA1_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DATA1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn data1(&mut self) -> DATA1_W { DATA1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC1 Data Register\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 [dac1data](index.html) module"] +pub struct DAC1DATA_SPEC; +impl crate::RegisterSpec for DAC1DATA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac1data::R](R) reader structure"] +impl crate::Readable for DAC1DATA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac1data::W](W) writer structure"] +impl crate::Writable for DAC1DATA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC1DATA to value 0"] +impl crate::Resettable for DAC1DATA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dac/dac1path.rs b/src/dac/dac1path.rs index 6c4b077c..43705402 100644 --- a/src/dac/dac1path.rs +++ b/src/dac/dac1path.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC1PATH"] -pub type R = crate::R; -#[doc = "Writer for register DAC1PATH"] -pub type W = crate::W; -#[doc = "Register DAC1PATH `reset()`'s with value 0x7fdd"] -impl crate::ResetValue for super::DAC1PATH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x7fdd +#[doc = "Register `DAC1PATH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC1PATH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PAT6` reader - Pattern Number 6 for PATGEN of DAC1"] +pub struct PAT6_R(crate::FieldReader); +impl PAT6_R { + pub(crate) fn new(bits: u8) -> Self { + PAT6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PAT6`"] -pub type PAT6_R = crate::R; -#[doc = "Write proxy for field `PAT6`"] +#[doc = "Field `PAT6` writer - Pattern Number 6 for PATGEN of DAC1"] pub struct PAT6_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PAT6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } -#[doc = "Reader of field `PAT7`"] -pub type PAT7_R = crate::R; -#[doc = "Write proxy for field `PAT7`"] +#[doc = "Field `PAT7` reader - Pattern Number 7 for PATGEN of DAC1"] +pub struct PAT7_R(crate::FieldReader); +impl PAT7_R { + pub(crate) fn new(bits: u8) -> Self { + PAT7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT7` writer - Pattern Number 7 for PATGEN of DAC1"] pub struct PAT7_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PAT7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 5)) | (((value as u32) & 0x1f) << 5); + self.w.bits = (self.w.bits & !(0x1f << 5)) | ((value as u32 & 0x1f) << 5); self.w } } -#[doc = "Reader of field `PAT8`"] -pub type PAT8_R = crate::R; -#[doc = "Write proxy for field `PAT8`"] +#[doc = "Field `PAT8` reader - Pattern Number 8 for PATGEN of DAC1"] +pub struct PAT8_R(crate::FieldReader); +impl PAT8_R { + pub(crate) fn new(bits: u8) -> Self { + PAT8_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT8` writer - Pattern Number 8 for PATGEN of DAC1"] pub struct PAT8_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> PAT8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 10)) | (((value as u32) & 0x1f) << 10); + self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10); self.w } } @@ -85,4 +145,30 @@ impl W { pub fn pat8(&mut self) -> PAT8_W { PAT8_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC1 Higher Pattern Register\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 [dac1path](index.html) module"] +pub struct DAC1PATH_SPEC; +impl crate::RegisterSpec for DAC1PATH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac1path::R](R) reader structure"] +impl crate::Readable for DAC1PATH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac1path::W](W) writer structure"] +impl crate::Writable for DAC1PATH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC1PATH to value 0x7fdd"] +impl crate::Resettable for DAC1PATH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x7fdd + } } diff --git a/src/dac/dac1patl.rs b/src/dac/dac1patl.rs index 76c77dfb..225be65d 100644 --- a/src/dac/dac1patl.rs +++ b/src/dac/dac1patl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAC1PATL"] -pub type R = crate::R; -#[doc = "Writer for register DAC1PATL"] -pub type W = crate::W; -#[doc = "Register DAC1PATL `reset()`'s with value 0x3568_b0c0"] -impl crate::ResetValue for super::DAC1PATL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x3568_b0c0 +#[doc = "Register `DAC1PATL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAC1PATL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PAT0`"] -pub type PAT0_R = crate::R; -#[doc = "Write proxy for field `PAT0`"] +#[doc = "Field `PAT0` reader - Pattern Number 0 for PATGEN of DAC1"] +pub struct PAT0_R(crate::FieldReader); +impl PAT0_R { + pub(crate) fn new(bits: u8) -> Self { + PAT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT0` writer - Pattern Number 0 for PATGEN of DAC1"] pub struct PAT0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PAT0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } -#[doc = "Reader of field `PAT1`"] -pub type PAT1_R = crate::R; -#[doc = "Write proxy for field `PAT1`"] +#[doc = "Field `PAT1` reader - Pattern Number 1 for PATGEN of DAC1"] +pub struct PAT1_R(crate::FieldReader); +impl PAT1_R { + pub(crate) fn new(bits: u8) -> Self { + PAT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT1` writer - Pattern Number 1 for PATGEN of DAC1"] pub struct PAT1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PAT1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 5)) | (((value as u32) & 0x1f) << 5); + self.w.bits = (self.w.bits & !(0x1f << 5)) | ((value as u32 & 0x1f) << 5); self.w } } -#[doc = "Reader of field `PAT2`"] -pub type PAT2_R = crate::R; -#[doc = "Write proxy for field `PAT2`"] +#[doc = "Field `PAT2` reader - Pattern Number 2 for PATGEN of DAC1"] +pub struct PAT2_R(crate::FieldReader); +impl PAT2_R { + pub(crate) fn new(bits: u8) -> Self { + PAT2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT2` writer - Pattern Number 2 for PATGEN of DAC1"] pub struct PAT2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PAT2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 10)) | (((value as u32) & 0x1f) << 10); + self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10); self.w } } -#[doc = "Reader of field `PAT3`"] -pub type PAT3_R = crate::R; -#[doc = "Write proxy for field `PAT3`"] +#[doc = "Field `PAT3` reader - Pattern Number 3 for PATGEN of DAC1"] +pub struct PAT3_R(crate::FieldReader); +impl PAT3_R { + pub(crate) fn new(bits: u8) -> Self { + PAT3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT3` writer - Pattern Number 3 for PATGEN of DAC1"] pub struct PAT3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PAT3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 15)) | (((value as u32) & 0x1f) << 15); + self.w.bits = (self.w.bits & !(0x1f << 15)) | ((value as u32 & 0x1f) << 15); self.w } } -#[doc = "Reader of field `PAT4`"] -pub type PAT4_R = crate::R; -#[doc = "Write proxy for field `PAT4`"] +#[doc = "Field `PAT4` reader - Pattern Number 4 for PATGEN of DAC1"] +pub struct PAT4_R(crate::FieldReader); +impl PAT4_R { + pub(crate) fn new(bits: u8) -> Self { + PAT4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT4` writer - Pattern Number 4 for PATGEN of DAC1"] pub struct PAT4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PAT4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 20)) | (((value as u32) & 0x1f) << 20); + self.w.bits = (self.w.bits & !(0x1f << 20)) | ((value as u32 & 0x1f) << 20); self.w } } -#[doc = "Reader of field `PAT5`"] -pub type PAT5_R = crate::R; -#[doc = "Write proxy for field `PAT5`"] +#[doc = "Field `PAT5` reader - Pattern Number 5 for PATGEN of DAC1"] +pub struct PAT5_R(crate::FieldReader); +impl PAT5_R { + pub(crate) fn new(bits: u8) -> Self { + PAT5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAT5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAT5` writer - Pattern Number 5 for PATGEN of DAC1"] pub struct PAT5_W<'a> { w: &'a mut W, } @@ -90,7 +186,7 @@ impl<'a> PAT5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 25)) | (((value as u32) & 0x1f) << 25); + self.w.bits = (self.w.bits & !(0x1f << 25)) | ((value as u32 & 0x1f) << 25); self.w } } @@ -157,4 +253,30 @@ impl W { pub fn pat5(&mut self) -> PAT5_W { PAT5_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC1 Lower Pattern Register\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 [dac1patl](index.html) module"] +pub struct DAC1PATL_SPEC; +impl crate::RegisterSpec for DAC1PATL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dac1patl::R](R) reader structure"] +impl crate::Readable for DAC1PATL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dac1patl::W](W) writer structure"] +impl crate::Writable for DAC1PATL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAC1PATL to value 0x3568_b0c0"] +impl crate::Resettable for DAC1PATL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3568_b0c0 + } } diff --git a/src/dac/id.rs b/src/dac/id.rs index 9837409c..ae7c2be1 100644 --- a/src/dac/id.rs +++ b/src/dac/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MODR`"] -pub type MODR_R = crate::R; -#[doc = "Reader of field `MODT`"] -pub type MODT_R = crate::R; -#[doc = "Reader of field `MODN`"] -pub type MODN_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MODR` reader - Module Revision"] +pub struct MODR_R(crate::FieldReader); +impl MODR_R { + pub(crate) fn new(bits: u8) -> Self { + MODR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODT` reader - Module Type"] +pub struct MODT_R(crate::FieldReader); +impl MODT_R { + pub(crate) fn new(bits: u8) -> Self { + MODT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODN` reader - Module Number"] +pub struct MODN_R(crate::FieldReader); +impl MODN_R { + pub(crate) fn new(bits: u16) -> Self { + MODN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MODN_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00a5_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a5_c000 + } +} diff --git a/src/dlr.rs b/src/dlr.rs index e203a7d7..0f452bc9 100644 --- a/src/dlr.rs +++ b/src/dlr.rs @@ -2,52 +2,28 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Overrun Status"] - pub ovrstat: OVRSTAT, + pub ovrstat: crate::Reg, #[doc = "0x04 - Overrun Clear"] - pub ovrclr: OVRCLR, + pub ovrclr: crate::Reg, #[doc = "0x08 - Service Request Selection 0"] - pub srsel0: SRSEL0, - _reserved3: [u8; 4usize], + pub srsel0: crate::Reg, + _reserved3: [u8; 0x04], #[doc = "0x10 - Line Enable"] - pub lnen: LNEN, + pub lnen: crate::Reg, } -#[doc = "Overrun Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ovrstat](ovrstat) module"] -pub type OVRSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OVRSTAT; -#[doc = "`read()` method returns [ovrstat::R](ovrstat::R) reader structure"] -impl crate::Readable for OVRSTAT {} +#[doc = "OVRSTAT register accessor: an alias for `Reg`"] +pub type OVRSTAT = crate::Reg; #[doc = "Overrun Status"] pub mod ovrstat; -#[doc = "Overrun Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ovrclr](ovrclr) module"] -pub type OVRCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OVRCLR; -#[doc = "`write(|w| ..)` method takes [ovrclr::W](ovrclr::W) writer structure"] -impl crate::Writable for OVRCLR {} +#[doc = "OVRCLR register accessor: an alias for `Reg`"] +pub type OVRCLR = crate::Reg; #[doc = "Overrun Clear"] pub mod ovrclr; -#[doc = "Service Request Selection 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srsel0](srsel0) module"] -pub type SRSEL0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRSEL0; -#[doc = "`read()` method returns [srsel0::R](srsel0::R) reader structure"] -impl crate::Readable for SRSEL0 {} -#[doc = "`write(|w| ..)` method takes [srsel0::W](srsel0::W) writer structure"] -impl crate::Writable for SRSEL0 {} +#[doc = "SRSEL0 register accessor: an alias for `Reg`"] +pub type SRSEL0 = crate::Reg; #[doc = "Service Request Selection 0"] pub mod srsel0; -#[doc = "Line Enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lnen](lnen) module"] -pub type LNEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LNEN; -#[doc = "`read()` method returns [lnen::R](lnen::R) reader structure"] -impl crate::Readable for LNEN {} -#[doc = "`write(|w| ..)` method takes [lnen::W](lnen::W) writer structure"] -impl crate::Writable for LNEN {} +#[doc = "LNEN register accessor: an alias for `Reg`"] +pub type LNEN = crate::Reg; #[doc = "Line Enable"] pub mod lnen; diff --git a/src/dlr/lnen.rs b/src/dlr/lnen.rs index 5cede82d..d989cc85 100644 --- a/src/dlr/lnen.rs +++ b/src/dlr/lnen.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register LNEN"] -pub type R = crate::R; -#[doc = "Writer for register LNEN"] -pub type W = crate::W; -#[doc = "Register LNEN `reset()`'s with value 0"] -impl crate::ResetValue for super::LNEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LNEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LNEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Line 0 Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN0`"] -pub type LN0_R = crate::R; +#[doc = "Field `LN0` reader - Line 0 Enable"] +pub struct LN0_R(crate::FieldReader); impl LN0_R { + pub(crate) fn new(bits: bool) -> Self { + LN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN0_A { @@ -38,15 +65,22 @@ impl LN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN0_A::VALUE1 + **self == LN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN0_A::VALUE2 + **self == LN0_A::VALUE2 + } +} +impl core::ops::Deref for LN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LN0`"] +#[doc = "Field `LN0` writer - Line 0 Enable"] pub struct LN0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> LN0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> LN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN1`"] -pub type LN1_R = crate::R; +#[doc = "Field `LN1` reader - Line 1 Enable"] +pub struct LN1_R(crate::FieldReader); impl LN1_R { + pub(crate) fn new(bits: bool) -> Self { + LN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN1_A { @@ -113,15 +148,22 @@ impl LN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN1_A::VALUE1 + **self == LN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN1_A::VALUE2 + **self == LN1_A::VALUE2 } } -#[doc = "Write proxy for field `LN1`"] +impl core::ops::Deref for LN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN1` writer - Line 1 Enable"] pub struct LN1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> LN1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> LN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN2`"] -pub type LN2_R = crate::R; +#[doc = "Field `LN2` reader - Line 2 Enable"] +pub struct LN2_R(crate::FieldReader); impl LN2_R { + pub(crate) fn new(bits: bool) -> Self { + LN2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN2_A { @@ -188,15 +231,22 @@ impl LN2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN2_A::VALUE1 + **self == LN2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN2_A::VALUE2 + **self == LN2_A::VALUE2 + } +} +impl core::ops::Deref for LN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LN2`"] +#[doc = "Field `LN2` writer - Line 2 Enable"] pub struct LN2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> LN2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> LN2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN3`"] -pub type LN3_R = crate::R; +#[doc = "Field `LN3` reader - Line 3 Enable"] +pub struct LN3_R(crate::FieldReader); impl LN3_R { + pub(crate) fn new(bits: bool) -> Self { + LN3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN3_A { @@ -263,15 +314,22 @@ impl LN3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN3_A::VALUE1 + **self == LN3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN3_A::VALUE2 + **self == LN3_A::VALUE2 } } -#[doc = "Write proxy for field `LN3`"] +impl core::ops::Deref for LN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN3` writer - Line 3 Enable"] pub struct LN3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> LN3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> LN3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN4`"] -pub type LN4_R = crate::R; +#[doc = "Field `LN4` reader - Line 4 Enable"] +pub struct LN4_R(crate::FieldReader); impl LN4_R { + pub(crate) fn new(bits: bool) -> Self { + LN4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN4_A { @@ -338,15 +397,22 @@ impl LN4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN4_A::VALUE1 + **self == LN4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN4_A::VALUE2 + **self == LN4_A::VALUE2 + } +} +impl core::ops::Deref for LN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LN4`"] +#[doc = "Field `LN4` writer - Line 4 Enable"] pub struct LN4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> LN4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> LN4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN5`"] -pub type LN5_R = crate::R; +#[doc = "Field `LN5` reader - Line 5 Enable"] +pub struct LN5_R(crate::FieldReader); impl LN5_R { + pub(crate) fn new(bits: bool) -> Self { + LN5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN5_A { @@ -413,15 +480,22 @@ impl LN5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN5_A::VALUE1 + **self == LN5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN5_A::VALUE2 + **self == LN5_A::VALUE2 } } -#[doc = "Write proxy for field `LN5`"] +impl core::ops::Deref for LN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN5` writer - Line 5 Enable"] pub struct LN5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> LN5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> LN5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN6`"] -pub type LN6_R = crate::R; +#[doc = "Field `LN6` reader - Line 6 Enable"] +pub struct LN6_R(crate::FieldReader); impl LN6_R { + pub(crate) fn new(bits: bool) -> Self { + LN6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN6_A { @@ -488,15 +563,22 @@ impl LN6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN6_A::VALUE1 + **self == LN6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN6_A::VALUE2 + **self == LN6_A::VALUE2 + } +} +impl core::ops::Deref for LN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LN6`"] +#[doc = "Field `LN6` writer - Line 6 Enable"] pub struct LN6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> LN6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> LN6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LN7`"] -pub type LN7_R = crate::R; +#[doc = "Field `LN7` reader - Line 7 Enable"] +pub struct LN7_R(crate::FieldReader); impl LN7_R { + pub(crate) fn new(bits: bool) -> Self { + LN7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LN7_A { @@ -563,15 +646,22 @@ impl LN7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LN7_A::VALUE1 + **self == LN7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LN7_A::VALUE2 + **self == LN7_A::VALUE2 + } +} +impl core::ops::Deref for LN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LN7`"] +#[doc = "Field `LN7` writer - Line 7 Enable"] pub struct LN7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> LN7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LN7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables the line"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> LN7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -693,4 +781,30 @@ impl W { pub fn ln7(&mut self) -> LN7_W { LN7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Line Enable\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 [lnen](index.html) module"] +pub struct LNEN_SPEC; +impl crate::RegisterSpec for LNEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lnen::R](R) reader structure"] +impl crate::Readable for LNEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lnen::W](W) writer structure"] +impl crate::Writable for LNEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LNEN to value 0"] +impl crate::Resettable for LNEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dlr/ovrclr.rs b/src/dlr/ovrclr.rs index 614804f4..23614d1c 100644 --- a/src/dlr/ovrclr.rs +++ b/src/dlr/ovrclr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OVRCLR"] -pub type W = crate::W; -#[doc = "Register OVRCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::OVRCLR { - type Type = u32; +#[doc = "Register `OVRCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `LN0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LN0` writer - Line 0 Overrun Status Clear"] pub struct LN0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> LN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `LN1`"] +#[doc = "Field `LN1` writer - Line 1 Overrun Status Clear"] pub struct LN1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> LN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `LN2`"] +#[doc = "Field `LN2` writer - Line 2 Overrun Status Clear"] pub struct LN2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> LN2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `LN3`"] +#[doc = "Field `LN3` writer - Line 3 Overrun Status Clear"] pub struct LN3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> LN3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `LN4`"] +#[doc = "Field `LN4` writer - Line 4 Overrun Status Clear"] pub struct LN4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> LN4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `LN5`"] +#[doc = "Field `LN5` writer - Line 5 Overrun Status Clear"] pub struct LN5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> LN5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `LN6`"] +#[doc = "Field `LN6` writer - Line 6 Overrun Status Clear"] pub struct LN6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> LN6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `LN7`"] +#[doc = "Field `LN7` writer - Line 7 Overrun Status Clear"] pub struct LN7_W<'a> { w: &'a mut W, } @@ -180,7 +191,7 @@ impl<'a> LN7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -225,4 +236,26 @@ impl W { pub fn ln7(&mut self) -> LN7_W { LN7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Overrun Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ovrclr](index.html) module"] +pub struct OVRCLR_SPEC; +impl crate::RegisterSpec for OVRCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [ovrclr::W](W) writer structure"] +impl crate::Writable for OVRCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OVRCLR to value 0"] +impl crate::Resettable for OVRCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/dlr/ovrstat.rs b/src/dlr/ovrstat.rs index 92cffb2b..39db0890 100644 --- a/src/dlr/ovrstat.rs +++ b/src/dlr/ovrstat.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register OVRSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `LN0`"] -pub type LN0_R = crate::R; -#[doc = "Reader of field `LN1`"] -pub type LN1_R = crate::R; -#[doc = "Reader of field `LN2`"] -pub type LN2_R = crate::R; -#[doc = "Reader of field `LN3`"] -pub type LN3_R = crate::R; -#[doc = "Reader of field `LN4`"] -pub type LN4_R = crate::R; -#[doc = "Reader of field `LN5`"] -pub type LN5_R = crate::R; -#[doc = "Reader of field `LN6`"] -pub type LN6_R = crate::R; -#[doc = "Reader of field `LN7`"] -pub type LN7_R = crate::R; +#[doc = "Register `OVRSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `LN0` reader - Line 0 Overrun Status"] +pub struct LN0_R(crate::FieldReader); +impl LN0_R { + pub(crate) fn new(bits: bool) -> Self { + LN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN1` reader - Line 1 Overrun Status"] +pub struct LN1_R(crate::FieldReader); +impl LN1_R { + pub(crate) fn new(bits: bool) -> Self { + LN1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN2` reader - Line 2 Overrun Status"] +pub struct LN2_R(crate::FieldReader); +impl LN2_R { + pub(crate) fn new(bits: bool) -> Self { + LN2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN3` reader - Line 3 Overrun Status"] +pub struct LN3_R(crate::FieldReader); +impl LN3_R { + pub(crate) fn new(bits: bool) -> Self { + LN3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN4` reader - Line 4 Overrun Status"] +pub struct LN4_R(crate::FieldReader); +impl LN4_R { + pub(crate) fn new(bits: bool) -> Self { + LN4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN5` reader - Line 5 Overrun Status"] +pub struct LN5_R(crate::FieldReader); +impl LN5_R { + pub(crate) fn new(bits: bool) -> Self { + LN5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN6` reader - Line 6 Overrun Status"] +pub struct LN6_R(crate::FieldReader); +impl LN6_R { + pub(crate) fn new(bits: bool) -> Self { + LN6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LN7` reader - Line 7 Overrun Status"] +pub struct LN7_R(crate::FieldReader); +impl LN7_R { + pub(crate) fn new(bits: bool) -> Self { + LN7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Line 0 Overrun Status"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { LN7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "Overrun Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ovrstat](index.html) module"] +pub struct OVRSTAT_SPEC; +impl crate::RegisterSpec for OVRSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ovrstat::R](R) reader structure"] +impl crate::Readable for OVRSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets OVRSTAT to value 0"] +impl crate::Resettable for OVRSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/dlr/srsel0.rs b/src/dlr/srsel0.rs index a3c2f640..8645539c 100644 --- a/src/dlr/srsel0.rs +++ b/src/dlr/srsel0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SRSEL0"] -pub type R = crate::R; -#[doc = "Writer for register SRSEL0"] -pub type W = crate::W; -#[doc = "Register SRSEL0 `reset()`'s with value 0"] -impl crate::ResetValue for super::SRSEL0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRSEL0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRSEL0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RS0` reader - Request Source for Line 0"] +pub struct RS0_R(crate::FieldReader); +impl RS0_R { + pub(crate) fn new(bits: u8) -> Self { + RS0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `RS0`"] -pub type RS0_R = crate::R; -#[doc = "Write proxy for field `RS0`"] +impl core::ops::Deref for RS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS0` writer - Request Source for Line 0"] pub struct RS0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> RS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `RS1`"] -pub type RS1_R = crate::R; -#[doc = "Write proxy for field `RS1`"] +#[doc = "Field `RS1` reader - Request Source for Line 1"] +pub struct RS1_R(crate::FieldReader); +impl RS1_R { + pub(crate) fn new(bits: u8) -> Self { + RS1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS1` writer - Request Source for Line 1"] pub struct RS1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> RS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } -#[doc = "Reader of field `RS2`"] -pub type RS2_R = crate::R; -#[doc = "Write proxy for field `RS2`"] +#[doc = "Field `RS2` reader - Request Source for Line 2"] +pub struct RS2_R(crate::FieldReader); +impl RS2_R { + pub(crate) fn new(bits: u8) -> Self { + RS2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS2` writer - Request Source for Line 2"] pub struct RS2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> RS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `RS3`"] -pub type RS3_R = crate::R; -#[doc = "Write proxy for field `RS3`"] +#[doc = "Field `RS3` reader - Request Source for Line 3"] +pub struct RS3_R(crate::FieldReader); +impl RS3_R { + pub(crate) fn new(bits: u8) -> Self { + RS3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS3` writer - Request Source for Line 3"] pub struct RS3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> RS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } -#[doc = "Reader of field `RS4`"] -pub type RS4_R = crate::R; -#[doc = "Write proxy for field `RS4`"] +#[doc = "Field `RS4` reader - Request Source for Line 4"] +pub struct RS4_R(crate::FieldReader); +impl RS4_R { + pub(crate) fn new(bits: u8) -> Self { + RS4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS4` writer - Request Source for Line 4"] pub struct RS4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> RS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } -#[doc = "Reader of field `RS5`"] -pub type RS5_R = crate::R; -#[doc = "Write proxy for field `RS5`"] +#[doc = "Field `RS5` reader - Request Source for Line 5"] +pub struct RS5_R(crate::FieldReader); +impl RS5_R { + pub(crate) fn new(bits: u8) -> Self { + RS5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS5` writer - Request Source for Line 5"] pub struct RS5_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> RS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } -#[doc = "Reader of field `RS6`"] -pub type RS6_R = crate::R; -#[doc = "Write proxy for field `RS6`"] +#[doc = "Field `RS6` reader - Request Source for Line 6"] +pub struct RS6_R(crate::FieldReader); +impl RS6_R { + pub(crate) fn new(bits: u8) -> Self { + RS6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS6` writer - Request Source for Line 6"] pub struct RS6_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> RS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } -#[doc = "Reader of field `RS7`"] -pub type RS7_R = crate::R; -#[doc = "Write proxy for field `RS7`"] +#[doc = "Field `RS7` reader - Request Source for Line 7"] +pub struct RS7_R(crate::FieldReader); +impl RS7_R { + pub(crate) fn new(bits: u8) -> Self { + RS7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RS7` writer - Request Source for Line 7"] pub struct RS7_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> RS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn rs7(&mut self) -> RS7_W { RS7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Selection 0\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 [srsel0](index.html) module"] +pub struct SRSEL0_SPEC; +impl crate::RegisterSpec for SRSEL0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srsel0::R](R) reader structure"] +impl crate::Readable for SRSEL0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [srsel0::W](W) writer structure"] +impl crate::Writable for SRSEL0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRSEL0 to value 0"] +impl crate::Resettable for SRSEL0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/eru0.rs b/src/eru0.rs index b72ad526..74e9c3b6 100644 --- a/src/eru0.rs +++ b/src/eru0.rs @@ -2,43 +2,22 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Event Input Select"] - pub exisel: EXISEL, - _reserved1: [u8; 12usize], - #[doc = "0x10 - Event Input Control"] - pub exicon: [EXICON; 4], - #[doc = "0x20 - Event Output Trigger Control"] - pub exocon: [EXOCON; 4], + pub exisel: crate::Reg, + _reserved1: [u8; 0x0c], + #[doc = "0x10..0x20 - Event Input Control"] + pub exicon: [crate::Reg; 4], + #[doc = "0x20..0x30 - Event Output Trigger Control"] + pub exocon: [crate::Reg; 4], } -#[doc = "Event Input Select\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [exisel](exisel) module"] -pub type EXISEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EXISEL; -#[doc = "`read()` method returns [exisel::R](exisel::R) reader structure"] -impl crate::Readable for EXISEL {} -#[doc = "`write(|w| ..)` method takes [exisel::W](exisel::W) writer structure"] -impl crate::Writable for EXISEL {} +#[doc = "EXISEL register accessor: an alias for `Reg`"] +pub type EXISEL = crate::Reg; #[doc = "Event Input Select"] pub mod exisel; -#[doc = "Event Input Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [exicon](exicon) module"] -pub type EXICON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EXICON; -#[doc = "`read()` method returns [exicon::R](exicon::R) reader structure"] -impl crate::Readable for EXICON {} -#[doc = "`write(|w| ..)` method takes [exicon::W](exicon::W) writer structure"] -impl crate::Writable for EXICON {} +#[doc = "EXICON register accessor: an alias for `Reg`"] +pub type EXICON = crate::Reg; #[doc = "Event Input Control"] pub mod exicon; -#[doc = "Event Output Trigger Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [exocon](exocon) module"] -pub type EXOCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EXOCON; -#[doc = "`read()` method returns [exocon::R](exocon::R) reader structure"] -impl crate::Readable for EXOCON {} -#[doc = "`write(|w| ..)` method takes [exocon::W](exocon::W) writer structure"] -impl crate::Writable for EXOCON {} +#[doc = "EXOCON register accessor: an alias for `Reg`"] +pub type EXOCON = crate::Reg; #[doc = "Event Output Trigger Control"] pub mod exocon; diff --git a/src/eru0/exicon.rs b/src/eru0/exicon.rs index 2934150d..49daf11a 100644 --- a/src/eru0/exicon.rs +++ b/src/eru0/exicon.rs @@ -1,14 +1,37 @@ -#[doc = "Reader of register EXICON[%s]"] -pub type R = crate::R; -#[doc = "Writer for register EXICON[%s]"] -pub type W = crate::W; -#[doc = "Register EXICON[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::EXICON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `EXICON[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXICON[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Output Trigger Pulse Enable for ETLx\n\nValue on reset: 0"] @@ -25,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PE`"] -pub type PE_R = crate::R; +#[doc = "Field `PE` reader - Output Trigger Pulse Enable for ETLx"] +pub struct PE_R(crate::FieldReader); impl PE_R { + pub(crate) fn new(bits: bool) -> Self { + PE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PE_A { @@ -39,15 +65,22 @@ impl PE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PE_A::VALUE1 + **self == PE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PE_A::VALUE2 + **self == PE_A::VALUE2 + } +} +impl core::ops::Deref for PE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PE`"] +#[doc = "Field `PE` writer - Output Trigger Pulse Enable for ETLx"] pub struct PE_W<'a> { w: &'a mut W, } @@ -55,9 +88,7 @@ impl<'a> PE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The trigger pulse generation is disabled"] #[inline(always)] @@ -82,7 +113,7 @@ impl<'a> PE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -100,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LD`"] -pub type LD_R = crate::R; +#[doc = "Field `LD` reader - Rebuild Level Detection for Status Flag for ETLx"] +pub struct LD_R(crate::FieldReader); impl LD_R { + pub(crate) fn new(bits: bool) -> Self { + LD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LD_A { @@ -114,15 +148,22 @@ impl LD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LD_A::VALUE1 + **self == LD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LD_A::VALUE2 + **self == LD_A::VALUE2 } } -#[doc = "Write proxy for field `LD`"] +impl core::ops::Deref for LD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LD` writer - Rebuild Level Detection for Status Flag for ETLx"] pub struct LD_W<'a> { w: &'a mut W, } @@ -130,9 +171,7 @@ impl<'a> LD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The status flag FL is not cleared by hardware and is used as \"sticky\" bit. Once set, it is not influenced by any edge until it becomes cleared by software."] #[inline(always)] @@ -157,7 +196,7 @@ impl<'a> LD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -175,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RE`"] -pub type RE_R = crate::R; +#[doc = "Field `RE` reader - Rising Edge Detection Enable ETLx"] +pub struct RE_R(crate::FieldReader); impl RE_R { + pub(crate) fn new(bits: bool) -> Self { + RE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RE_A { @@ -189,15 +231,22 @@ impl RE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RE_A::VALUE1 + **self == RE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RE_A::VALUE2 + **self == RE_A::VALUE2 } } -#[doc = "Write proxy for field `RE`"] +impl core::ops::Deref for RE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RE` writer - Rising Edge Detection Enable ETLx"] pub struct RE_W<'a> { w: &'a mut W, } @@ -205,9 +254,7 @@ impl<'a> RE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A rising edge is not considered as edge event"] #[inline(always)] @@ -232,7 +279,7 @@ impl<'a> RE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -250,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FE`"] -pub type FE_R = crate::R; +#[doc = "Field `FE` reader - Falling Edge Detection Enable ETLx"] +pub struct FE_R(crate::FieldReader); impl FE_R { + pub(crate) fn new(bits: bool) -> Self { + FE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FE_A { @@ -264,15 +314,22 @@ impl FE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FE_A::VALUE1 + **self == FE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FE_A::VALUE2 + **self == FE_A::VALUE2 } } -#[doc = "Write proxy for field `FE`"] +impl core::ops::Deref for FE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FE` writer - Falling Edge Detection Enable ETLx"] pub struct FE_W<'a> { w: &'a mut W, } @@ -280,9 +337,7 @@ impl<'a> FE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A falling edge is not considered as edge event"] #[inline(always)] @@ -307,7 +362,7 @@ impl<'a> FE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -330,43 +385,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `OCS`"] -pub type OCS_R = crate::R; +#[doc = "Field `OCS` reader - Output Channel Select for ETLx Output Trigger Pulse"] +pub struct OCS_R(crate::FieldReader); impl OCS_R { + pub(crate) fn new(bits: u8) -> Self { + OCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(OCS_A::VALUE1), - 1 => Val(OCS_A::VALUE2), - 2 => Val(OCS_A::VALUE3), - 3 => Val(OCS_A::VALUE4), - i => Res(i), + 0 => Some(OCS_A::VALUE1), + 1 => Some(OCS_A::VALUE2), + 2 => Some(OCS_A::VALUE3), + 3 => Some(OCS_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS_A::VALUE1 + **self == OCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS_A::VALUE2 + **self == OCS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == OCS_A::VALUE3 + **self == OCS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == OCS_A::VALUE4 + **self == OCS_A::VALUE4 } } -#[doc = "Write proxy for field `OCS`"] +impl core::ops::Deref for OCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OCS` writer - Output Channel Select for ETLx Output Trigger Pulse"] pub struct OCS_W<'a> { w: &'a mut W, } @@ -399,7 +463,7 @@ impl<'a> OCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } @@ -417,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FL`"] -pub type FL_R = crate::R; +#[doc = "Field `FL` reader - Status Flag for ETLx"] +pub struct FL_R(crate::FieldReader); impl FL_R { + pub(crate) fn new(bits: bool) -> Self { + FL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FL_A { @@ -431,15 +498,22 @@ impl FL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FL_A::VALUE1 + **self == FL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FL_A::VALUE2 + **self == FL_A::VALUE2 } } -#[doc = "Write proxy for field `FL`"] +impl core::ops::Deref for FL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FL` writer - Status Flag for ETLx"] pub struct FL_W<'a> { w: &'a mut W, } @@ -447,9 +521,7 @@ impl<'a> FL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The enabled edge event has not been detected"] #[inline(always)] @@ -474,7 +546,7 @@ impl<'a> FL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -497,9 +569,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SS`"] -pub type SS_R = crate::R; +#[doc = "Field `SS` reader - Input Source Select for ERSx"] +pub struct SS_R(crate::FieldReader); impl SS_R { + pub(crate) fn new(bits: u8) -> Self { + SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SS_A { @@ -514,25 +589,32 @@ impl SS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SS_A::VALUE1 + **self == SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SS_A::VALUE2 + **self == SS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SS_A::VALUE3 + **self == SS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SS_A::VALUE4 + **self == SS_A::VALUE4 + } +} +impl core::ops::Deref for SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SS`"] +#[doc = "Field `SS` writer - Input Source Select for ERSx"] pub struct SS_W<'a> { w: &'a mut W, } @@ -540,9 +622,7 @@ impl<'a> SS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input A without additional combination"] #[inline(always)] @@ -567,7 +647,7 @@ impl<'a> SS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -585,9 +665,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NA`"] -pub type NA_R = crate::R; +#[doc = "Field `NA` reader - Input A Negation Select for ERSx"] +pub struct NA_R(crate::FieldReader); impl NA_R { + pub(crate) fn new(bits: bool) -> Self { + NA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NA_A { @@ -599,15 +682,22 @@ impl NA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NA_A::VALUE1 + **self == NA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NA_A::VALUE2 + **self == NA_A::VALUE2 } } -#[doc = "Write proxy for field `NA`"] +impl core::ops::Deref for NA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NA` writer - Input A Negation Select for ERSx"] pub struct NA_W<'a> { w: &'a mut W, } @@ -615,9 +705,7 @@ impl<'a> NA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Input A is used directly"] #[inline(always)] @@ -642,7 +730,7 @@ impl<'a> NA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -660,9 +748,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NB`"] -pub type NB_R = crate::R; +#[doc = "Field `NB` reader - Input B Negation Select for ERSx"] +pub struct NB_R(crate::FieldReader); impl NB_R { + pub(crate) fn new(bits: bool) -> Self { + NB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NB_A { @@ -674,15 +765,22 @@ impl NB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NB_A::VALUE1 + **self == NB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NB_A::VALUE2 + **self == NB_A::VALUE2 + } +} +impl core::ops::Deref for NB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NB`"] +#[doc = "Field `NB` writer - Input B Negation Select for ERSx"] pub struct NB_W<'a> { w: &'a mut W, } @@ -690,9 +788,7 @@ impl<'a> NB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Input B is used directly"] #[inline(always)] @@ -717,7 +813,7 @@ impl<'a> NB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -814,4 +910,31 @@ impl W { pub fn nb(&mut self) -> NB_W { NB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event Input Control\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 [exicon](index.html) module"] +pub struct EXICON_SPEC; +impl crate::RegisterSpec for EXICON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [exicon::R](R) reader structure"] +impl crate::Readable for EXICON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [exicon::W](W) writer structure"] +impl crate::Writable for EXICON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXICON[%s] +to value 0"] +impl crate::Resettable for EXICON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/eru0/exisel.rs b/src/eru0/exisel.rs index 7aee35c4..cf415bba 100644 --- a/src/eru0/exisel.rs +++ b/src/eru0/exisel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register EXISEL"] -pub type R = crate::R; -#[doc = "Writer for register EXISEL"] -pub type W = crate::W; -#[doc = "Register EXISEL `reset()`'s with value 0"] -impl crate::ResetValue for super::EXISEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `EXISEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXISEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Event Source Select for A0 (ERS0)\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS0A`"] -pub type EXS0A_R = crate::R; +#[doc = "Field `EXS0A` reader - Event Source Select for A0 (ERS0)"] +pub struct EXS0A_R(crate::FieldReader); impl EXS0A_R { + pub(crate) fn new(bits: u8) -> Self { + EXS0A_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS0A_A { @@ -46,25 +73,32 @@ impl EXS0A_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS0A_A::VALUE1 + **self == EXS0A_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS0A_A::VALUE2 + **self == EXS0A_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS0A_A::VALUE3 + **self == EXS0A_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS0A_A::VALUE4 + **self == EXS0A_A::VALUE4 + } +} +impl core::ops::Deref for EXS0A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EXS0A`"] +#[doc = "Field `EXS0A` writer - Event Source Select for A0 (ERS0)"] pub struct EXS0A_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> EXS0A_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS0A_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_0A0 is selected"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> EXS0A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS0B`"] -pub type EXS0B_R = crate::R; +#[doc = "Field `EXS0B` reader - Event Source Select for B0 (ERS0)"] +pub struct EXS0B_R(crate::FieldReader); impl EXS0B_R { + pub(crate) fn new(bits: u8) -> Self { + EXS0B_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS0B_A { @@ -139,25 +174,32 @@ impl EXS0B_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS0B_A::VALUE1 + **self == EXS0B_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS0B_A::VALUE2 + **self == EXS0B_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS0B_A::VALUE3 + **self == EXS0B_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS0B_A::VALUE4 + **self == EXS0B_A::VALUE4 } } -#[doc = "Write proxy for field `EXS0B`"] +impl core::ops::Deref for EXS0B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXS0B` writer - Event Source Select for B0 (ERS0)"] pub struct EXS0B_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> EXS0B_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS0B_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_0B0 is selected"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> EXS0B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS1A`"] -pub type EXS1A_R = crate::R; +#[doc = "Field `EXS1A` reader - Event Source Select for A1 (ERS1)"] +pub struct EXS1A_R(crate::FieldReader); impl EXS1A_R { + pub(crate) fn new(bits: u8) -> Self { + EXS1A_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS1A_A { @@ -232,25 +275,32 @@ impl EXS1A_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS1A_A::VALUE1 + **self == EXS1A_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS1A_A::VALUE2 + **self == EXS1A_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS1A_A::VALUE3 + **self == EXS1A_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS1A_A::VALUE4 + **self == EXS1A_A::VALUE4 + } +} +impl core::ops::Deref for EXS1A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EXS1A`"] +#[doc = "Field `EXS1A` writer - Event Source Select for A1 (ERS1)"] pub struct EXS1A_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> EXS1A_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS1A_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_1A0 is selected"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> EXS1A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS1B`"] -pub type EXS1B_R = crate::R; +#[doc = "Field `EXS1B` reader - Event Source Select for B1 (ERS1)"] +pub struct EXS1B_R(crate::FieldReader); impl EXS1B_R { + pub(crate) fn new(bits: u8) -> Self { + EXS1B_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS1B_A { @@ -325,25 +376,32 @@ impl EXS1B_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS1B_A::VALUE1 + **self == EXS1B_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS1B_A::VALUE2 + **self == EXS1B_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS1B_A::VALUE3 + **self == EXS1B_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS1B_A::VALUE4 + **self == EXS1B_A::VALUE4 } } -#[doc = "Write proxy for field `EXS1B`"] +impl core::ops::Deref for EXS1B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXS1B` writer - Event Source Select for B1 (ERS1)"] pub struct EXS1B_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> EXS1B_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS1B_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_1B0 is selected"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> EXS1B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS2A`"] -pub type EXS2A_R = crate::R; +#[doc = "Field `EXS2A` reader - Event Source Select for A2 (ERS2)"] +pub struct EXS2A_R(crate::FieldReader); impl EXS2A_R { + pub(crate) fn new(bits: u8) -> Self { + EXS2A_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS2A_A { @@ -418,25 +477,32 @@ impl EXS2A_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS2A_A::VALUE1 + **self == EXS2A_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS2A_A::VALUE2 + **self == EXS2A_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS2A_A::VALUE3 + **self == EXS2A_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS2A_A::VALUE4 + **self == EXS2A_A::VALUE4 + } +} +impl core::ops::Deref for EXS2A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EXS2A`"] +#[doc = "Field `EXS2A` writer - Event Source Select for A2 (ERS2)"] pub struct EXS2A_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> EXS2A_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS2A_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_2A0 is selected"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> EXS2A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -494,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS2B`"] -pub type EXS2B_R = crate::R; +#[doc = "Field `EXS2B` reader - Event Source Select for B2 (ERS2)"] +pub struct EXS2B_R(crate::FieldReader); impl EXS2B_R { + pub(crate) fn new(bits: u8) -> Self { + EXS2B_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS2B_A { @@ -511,25 +578,32 @@ impl EXS2B_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS2B_A::VALUE1 + **self == EXS2B_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS2B_A::VALUE2 + **self == EXS2B_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS2B_A::VALUE3 + **self == EXS2B_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS2B_A::VALUE4 + **self == EXS2B_A::VALUE4 } } -#[doc = "Write proxy for field `EXS2B`"] +impl core::ops::Deref for EXS2B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXS2B` writer - Event Source Select for B2 (ERS2)"] pub struct EXS2B_W<'a> { w: &'a mut W, } @@ -537,9 +611,7 @@ impl<'a> EXS2B_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS2B_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_2B0 is selected"] #[inline(always)] @@ -564,7 +636,7 @@ impl<'a> EXS2B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -587,9 +659,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS3A`"] -pub type EXS3A_R = crate::R; +#[doc = "Field `EXS3A` reader - Event Source Select for A3 (ERS3)"] +pub struct EXS3A_R(crate::FieldReader); impl EXS3A_R { + pub(crate) fn new(bits: u8) -> Self { + EXS3A_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS3A_A { @@ -604,25 +679,32 @@ impl EXS3A_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS3A_A::VALUE1 + **self == EXS3A_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS3A_A::VALUE2 + **self == EXS3A_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS3A_A::VALUE3 + **self == EXS3A_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS3A_A::VALUE4 + **self == EXS3A_A::VALUE4 + } +} +impl core::ops::Deref for EXS3A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EXS3A`"] +#[doc = "Field `EXS3A` writer - Event Source Select for A3 (ERS3)"] pub struct EXS3A_W<'a> { w: &'a mut W, } @@ -630,9 +712,7 @@ impl<'a> EXS3A_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS3A_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_3A0 is selected"] #[inline(always)] @@ -657,7 +737,7 @@ impl<'a> EXS3A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -680,9 +760,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EXS3B`"] -pub type EXS3B_R = crate::R; +#[doc = "Field `EXS3B` reader - Event Source Select for B3 (ERS3)"] +pub struct EXS3B_R(crate::FieldReader); impl EXS3B_R { + pub(crate) fn new(bits: u8) -> Self { + EXS3B_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXS3B_A { @@ -697,25 +780,32 @@ impl EXS3B_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXS3B_A::VALUE1 + **self == EXS3B_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXS3B_A::VALUE2 + **self == EXS3B_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EXS3B_A::VALUE3 + **self == EXS3B_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EXS3B_A::VALUE4 + **self == EXS3B_A::VALUE4 + } +} +impl core::ops::Deref for EXS3B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EXS3B`"] +#[doc = "Field `EXS3B` writer - Event Source Select for B3 (ERS3)"] pub struct EXS3B_W<'a> { w: &'a mut W, } @@ -723,9 +813,7 @@ impl<'a> EXS3B_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXS3B_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Input ERU_3B0 is selected"] #[inline(always)] @@ -750,7 +838,7 @@ impl<'a> EXS3B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -837,4 +925,30 @@ impl W { pub fn exs3b(&mut self) -> EXS3B_W { EXS3B_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event Input Select\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 [exisel](index.html) module"] +pub struct EXISEL_SPEC; +impl crate::RegisterSpec for EXISEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [exisel::R](R) reader structure"] +impl crate::Readable for EXISEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [exisel::W](W) writer structure"] +impl crate::Writable for EXISEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXISEL to value 0"] +impl crate::Resettable for EXISEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/eru0/exocon.rs b/src/eru0/exocon.rs index 2f3030fa..d0145460 100644 --- a/src/eru0/exocon.rs +++ b/src/eru0/exocon.rs @@ -1,14 +1,37 @@ -#[doc = "Reader of register EXOCON[%s]"] -pub type R = crate::R; -#[doc = "Writer for register EXOCON[%s]"] -pub type W = crate::W; -#[doc = "Register EXOCON[%s] -`reset()`'s with value 0x08"] -impl crate::ResetValue for super::EXOCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x08 +#[doc = "Register `EXOCON[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXOCON[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Internal Trigger Source Selection\n\nValue on reset: 0"] @@ -30,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ISS`"] -pub type ISS_R = crate::R; +#[doc = "Field `ISS` reader - Internal Trigger Source Selection"] +pub struct ISS_R(crate::FieldReader); impl ISS_R { + pub(crate) fn new(bits: u8) -> Self { + ISS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ISS_A { @@ -47,25 +73,32 @@ impl ISS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ISS_A::VALUE1 + **self == ISS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ISS_A::VALUE2 + **self == ISS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ISS_A::VALUE3 + **self == ISS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ISS_A::VALUE4 + **self == ISS_A::VALUE4 } } -#[doc = "Write proxy for field `ISS`"] +impl core::ops::Deref for ISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ISS` writer - Internal Trigger Source Selection"] pub struct ISS_W<'a> { w: &'a mut W, } @@ -73,9 +106,7 @@ impl<'a> ISS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ISS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The peripheral trigger function is disabled"] #[inline(always)] @@ -100,7 +131,7 @@ impl<'a> ISS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -118,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GEEN`"] -pub type GEEN_R = crate::R; +#[doc = "Field `GEEN` reader - Gating Event Enable"] +pub struct GEEN_R(crate::FieldReader); impl GEEN_R { + pub(crate) fn new(bits: bool) -> Self { + GEEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GEEN_A { @@ -132,15 +166,22 @@ impl GEEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GEEN_A::VALUE1 + **self == GEEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GEEN_A::VALUE2 + **self == GEEN_A::VALUE2 } } -#[doc = "Write proxy for field `GEEN`"] +impl core::ops::Deref for GEEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GEEN` writer - Gating Event Enable"] pub struct GEEN_W<'a> { w: &'a mut W, } @@ -148,9 +189,7 @@ impl<'a> GEEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GEEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The event detection is disabled"] #[inline(always)] @@ -175,7 +214,7 @@ impl<'a> GEEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -193,9 +232,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDR`"] -pub type PDR_R = crate::R; +#[doc = "Field `PDR` reader - Pattern Detection Result Flag"] +pub struct PDR_R(crate::FieldReader); impl PDR_R { + pub(crate) fn new(bits: bool) -> Self { + PDR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDR_A { @@ -207,12 +249,19 @@ impl PDR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDR_A::VALUE1 + **self == PDR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDR_A::VALUE2 + **self == PDR_A::VALUE2 + } +} +impl core::ops::Deref for PDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Gating Selection for Pattern Detection Result\n\nValue on reset: 0"] @@ -234,9 +283,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `GP`"] -pub type GP_R = crate::R; +#[doc = "Field `GP` reader - Gating Selection for Pattern Detection Result"] +pub struct GP_R(crate::FieldReader); impl GP_R { + pub(crate) fn new(bits: u8) -> Self { + GP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GP_A { @@ -251,25 +303,32 @@ impl GP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GP_A::VALUE1 + **self == GP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GP_A::VALUE2 + **self == GP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == GP_A::VALUE3 + **self == GP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == GP_A::VALUE4 + **self == GP_A::VALUE4 + } +} +impl core::ops::Deref for GP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GP`"] +#[doc = "Field `GP` writer - Gating Selection for Pattern Detection Result"] pub struct GP_W<'a> { w: &'a mut W, } @@ -277,9 +336,7 @@ impl<'a> GP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GP_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "ERU_GOUTy is always disabled and ERU_IOUTy can not be activated"] #[inline(always)] @@ -304,7 +361,7 @@ impl<'a> GP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -322,9 +379,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IPEN0`"] -pub type IPEN0_R = crate::R; +#[doc = "Field `IPEN0` reader - Pattern Detection Enable for ETL0"] +pub struct IPEN0_R(crate::FieldReader); impl IPEN0_R { + pub(crate) fn new(bits: bool) -> Self { + IPEN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IPEN0_A { @@ -336,15 +396,22 @@ impl IPEN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IPEN0_A::VALUE1 + **self == IPEN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IPEN0_A::VALUE2 + **self == IPEN0_A::VALUE2 + } +} +impl core::ops::Deref for IPEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IPEN0`"] +#[doc = "Field `IPEN0` writer - Pattern Detection Enable for ETL0"] pub struct IPEN0_W<'a> { w: &'a mut W, } @@ -352,9 +419,7 @@ impl<'a> IPEN0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IPEN0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] @@ -379,7 +444,7 @@ impl<'a> IPEN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -397,9 +462,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IPEN1`"] -pub type IPEN1_R = crate::R; +#[doc = "Field `IPEN1` reader - Pattern Detection Enable for ETL1"] +pub struct IPEN1_R(crate::FieldReader); impl IPEN1_R { + pub(crate) fn new(bits: bool) -> Self { + IPEN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IPEN1_A { @@ -411,15 +479,22 @@ impl IPEN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IPEN1_A::VALUE1 + **self == IPEN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IPEN1_A::VALUE2 + **self == IPEN1_A::VALUE2 } } -#[doc = "Write proxy for field `IPEN1`"] +impl core::ops::Deref for IPEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IPEN1` writer - Pattern Detection Enable for ETL1"] pub struct IPEN1_W<'a> { w: &'a mut W, } @@ -427,9 +502,7 @@ impl<'a> IPEN1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IPEN1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] @@ -454,7 +527,7 @@ impl<'a> IPEN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -472,9 +545,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IPEN2`"] -pub type IPEN2_R = crate::R; +#[doc = "Field `IPEN2` reader - Pattern Detection Enable for ETL2"] +pub struct IPEN2_R(crate::FieldReader); impl IPEN2_R { + pub(crate) fn new(bits: bool) -> Self { + IPEN2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IPEN2_A { @@ -486,15 +562,22 @@ impl IPEN2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IPEN2_A::VALUE1 + **self == IPEN2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IPEN2_A::VALUE2 + **self == IPEN2_A::VALUE2 + } +} +impl core::ops::Deref for IPEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IPEN2`"] +#[doc = "Field `IPEN2` writer - Pattern Detection Enable for ETL2"] pub struct IPEN2_W<'a> { w: &'a mut W, } @@ -502,9 +585,7 @@ impl<'a> IPEN2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IPEN2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] @@ -529,7 +610,7 @@ impl<'a> IPEN2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -547,9 +628,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IPEN3`"] -pub type IPEN3_R = crate::R; +#[doc = "Field `IPEN3` reader - Pattern Detection Enable for ETL3"] +pub struct IPEN3_R(crate::FieldReader); impl IPEN3_R { + pub(crate) fn new(bits: bool) -> Self { + IPEN3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IPEN3_A { @@ -561,15 +645,22 @@ impl IPEN3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IPEN3_A::VALUE1 + **self == IPEN3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IPEN3_A::VALUE2 + **self == IPEN3_A::VALUE2 + } +} +impl core::ops::Deref for IPEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IPEN3`"] +#[doc = "Field `IPEN3` writer - Pattern Detection Enable for ETL3"] pub struct IPEN3_W<'a> { w: &'a mut W, } @@ -577,9 +668,7 @@ impl<'a> IPEN3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IPEN3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] @@ -604,7 +693,7 @@ impl<'a> IPEN3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -686,4 +775,31 @@ impl W { pub fn ipen3(&mut self) -> IPEN3_W { IPEN3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event Output Trigger Control\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 [exocon](index.html) module"] +pub struct EXOCON_SPEC; +impl crate::RegisterSpec for EXOCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [exocon::R](R) reader structure"] +impl crate::Readable for EXOCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [exocon::W](W) writer structure"] +impl crate::Writable for EXOCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXOCON[%s] +to value 0x08"] +impl crate::Resettable for EXOCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x08 + } } diff --git a/src/fce.rs b/src/fce.rs index e4360b41..3405f94d 100644 --- a/src/fce.rs +++ b/src/fce.rs @@ -2,28 +2,16 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Clock Control Register"] - pub clc: CLC, - _reserved1: [u8; 4usize], + pub clc: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Module Identification Register"] - pub id: ID, + pub id: crate::Reg, } -#[doc = "Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clc](clc) module"] -pub type CLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLC; -#[doc = "`read()` method returns [clc::R](clc::R) reader structure"] -impl crate::Readable for CLC {} -#[doc = "`write(|w| ..)` method takes [clc::W](clc::W) writer structure"] -impl crate::Writable for CLC {} +#[doc = "CLC register accessor: an alias for `Reg`"] +pub type CLC = crate::Reg; #[doc = "Clock Control Register"] pub mod clc; -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; diff --git a/src/fce/clc.rs b/src/fce/clc.rs index 510c5231..b610936b 100644 --- a/src/fce/clc.rs +++ b/src/fce/clc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CLC"] -pub type R = crate::R; -#[doc = "Writer for register CLC"] -pub type W = crate::W; -#[doc = "Register CLC `reset()`'s with value 0x03"] -impl crate::ResetValue for super::CLC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x03 +#[doc = "Register `CLC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `DISR`"] -pub type DISR_R = crate::R; -#[doc = "Write proxy for field `DISR`"] +#[doc = "Register `CLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DISR` reader - Module Disable Request Bit"] +pub struct DISR_R(crate::FieldReader); +impl DISR_R { + pub(crate) fn new(bits: bool) -> Self { + DISR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISR` writer - Module Disable Request Bit"] pub struct DISR_W<'a> { w: &'a mut W, } @@ -30,12 +66,24 @@ impl<'a> DISR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `DISS`"] -pub type DISS_R = crate::R; +#[doc = "Field `DISS` reader - Module Disable Status Bit"] +pub struct DISS_R(crate::FieldReader); +impl DISS_R { + pub(crate) fn new(bits: bool) -> Self { + DISS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] @@ -54,4 +102,30 @@ impl W { pub fn disr(&mut self) -> DISR_W { DISR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clock Control Register\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 [clc](index.html) module"] +pub struct CLC_SPEC; +impl crate::RegisterSpec for CLC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clc::R](R) reader structure"] +impl crate::Readable for CLC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [clc::W](W) writer structure"] +impl crate::Writable for CLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLC to value 0x03"] +impl crate::Resettable for CLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03 + } } diff --git a/src/fce/id.rs b/src/fce/id.rs index ad754b74..407a4867 100644 --- a/src/fce/id.rs +++ b/src/fce/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00ca_c001"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00ca_c001 + } +} diff --git a/src/fce_ke0.rs b/src/fce_ke0.rs index ba23b37a..dba9b52f 100644 --- a/src/fce_ke0.rs +++ b/src/fce_ke0.rs @@ -2,105 +2,51 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Input Register"] - pub ir: IR, + pub ir: crate::Reg, #[doc = "0x04 - CRC Result Register"] - pub res: RES, + pub res: crate::Reg, #[doc = "0x08 - CRC Configuration Register"] - pub cfg: CFG, + pub cfg: crate::Reg, #[doc = "0x0c - CRC Status Register"] - pub sts: STS, + pub sts: crate::Reg, #[doc = "0x10 - CRC Length Register"] - pub length: LENGTH, + pub length: crate::Reg, #[doc = "0x14 - CRC Check Register"] - pub check: CHECK, + pub check: crate::Reg, #[doc = "0x18 - CRC Register"] - pub crc: CRC, + pub crc: crate::Reg, #[doc = "0x1c - CRC Test Register"] - pub ctr: CTR, + pub ctr: crate::Reg, } -#[doc = "Input Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ir](ir) module"] -pub type IR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IR; -#[doc = "`read()` method returns [ir::R](ir::R) reader structure"] -impl crate::Readable for IR {} -#[doc = "`write(|w| ..)` method takes [ir::W](ir::W) writer structure"] -impl crate::Writable for IR {} +#[doc = "IR register accessor: an alias for `Reg`"] +pub type IR = crate::Reg; #[doc = "Input Register"] pub mod ir; -#[doc = "CRC Result Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [res](res) module"] -pub type RES = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RES; -#[doc = "`read()` method returns [res::R](res::R) reader structure"] -impl crate::Readable for RES {} +#[doc = "RES register accessor: an alias for `Reg`"] +pub type RES = crate::Reg; #[doc = "CRC Result Register"] pub mod res; -#[doc = "CRC Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] -pub type CFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFG; -#[doc = "`read()` method returns [cfg::R](cfg::R) reader structure"] -impl crate::Readable for CFG {} -#[doc = "`write(|w| ..)` method takes [cfg::W](cfg::W) writer structure"] -impl crate::Writable for CFG {} +#[doc = "CFG register accessor: an alias for `Reg`"] +pub type CFG = crate::Reg; #[doc = "CRC Configuration Register"] pub mod cfg; -#[doc = "CRC Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sts](sts) module"] -pub type STS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STS; -#[doc = "`read()` method returns [sts::R](sts::R) reader structure"] -impl crate::Readable for STS {} -#[doc = "`write(|w| ..)` method takes [sts::W](sts::W) writer structure"] -impl crate::Writable for STS {} +#[doc = "STS register accessor: an alias for `Reg`"] +pub type STS = crate::Reg; #[doc = "CRC Status Register"] pub mod sts; -#[doc = "CRC Length Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [length](length) module"] -pub type LENGTH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LENGTH; -#[doc = "`read()` method returns [length::R](length::R) reader structure"] -impl crate::Readable for LENGTH {} -#[doc = "`write(|w| ..)` method takes [length::W](length::W) writer structure"] -impl crate::Writable for LENGTH {} +#[doc = "LENGTH register accessor: an alias for `Reg`"] +pub type LENGTH = crate::Reg; #[doc = "CRC Length Register"] pub mod length; -#[doc = "CRC Check Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [check](check) module"] -pub type CHECK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CHECK; -#[doc = "`read()` method returns [check::R](check::R) reader structure"] -impl crate::Readable for CHECK {} -#[doc = "`write(|w| ..)` method takes [check::W](check::W) writer structure"] -impl crate::Writable for CHECK {} +#[doc = "CHECK register accessor: an alias for `Reg`"] +pub type CHECK = crate::Reg; #[doc = "CRC Check Register"] pub mod check; -#[doc = "CRC Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crc](crc) module"] -pub type CRC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CRC; -#[doc = "`read()` method returns [crc::R](crc::R) reader structure"] -impl crate::Readable for CRC {} -#[doc = "`write(|w| ..)` method takes [crc::W](crc::W) writer structure"] -impl crate::Writable for CRC {} +#[doc = "CRC register accessor: an alias for `Reg`"] +pub type CRC = crate::Reg; #[doc = "CRC Register"] pub mod crc; -#[doc = "CRC Test Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctr](ctr) module"] -pub type CTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTR; -#[doc = "`read()` method returns [ctr::R](ctr::R) reader structure"] -impl crate::Readable for CTR {} -#[doc = "`write(|w| ..)` method takes [ctr::W](ctr::W) writer structure"] -impl crate::Writable for CTR {} +#[doc = "CTR register accessor: an alias for `Reg`"] +pub type CTR = crate::Reg; #[doc = "CRC Test Register"] pub mod ctr; diff --git a/src/fce_ke0/cfg.rs b/src/fce_ke0/cfg.rs index 419e3669..f7d965fc 100644 --- a/src/fce_ke0/cfg.rs +++ b/src/fce_ke0/cfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CFG"] -pub type R = crate::R; -#[doc = "Writer for register CFG"] -pub type W = crate::W; -#[doc = "Register CFG `reset()`'s with value 0x0700"] -impl crate::ResetValue for super::CFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0700 +#[doc = "Register `CFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "CRC Mismatch Interrupt\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMI`"] -pub type CMI_R = crate::R; +#[doc = "Field `CMI` reader - CRC Mismatch Interrupt"] +pub struct CMI_R(crate::FieldReader); impl CMI_R { + pub(crate) fn new(bits: bool) -> Self { + CMI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMI_A { @@ -38,15 +65,22 @@ impl CMI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMI_A::VALUE1 + **self == CMI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMI_A::VALUE2 + **self == CMI_A::VALUE2 + } +} +impl core::ops::Deref for CMI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CMI`"] +#[doc = "Field `CMI` writer - CRC Mismatch Interrupt"] pub struct CMI_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CMI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CRC Mismatch Interrupt is disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CMI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEI`"] -pub type CEI_R = crate::R; +#[doc = "Field `CEI` reader - Configuration Error Interrupt"] +pub struct CEI_R(crate::FieldReader); impl CEI_R { + pub(crate) fn new(bits: bool) -> Self { + CEI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEI_A { @@ -113,15 +148,22 @@ impl CEI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEI_A::VALUE1 + **self == CEI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEI_A::VALUE2 + **self == CEI_A::VALUE2 } } -#[doc = "Write proxy for field `CEI`"] +impl core::ops::Deref for CEI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEI` writer - Configuration Error Interrupt"] pub struct CEI_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> CEI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Configuration Error Interrupt is disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> CEI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LEI`"] -pub type LEI_R = crate::R; +#[doc = "Field `LEI` reader - Length Error Interrupt"] +pub struct LEI_R(crate::FieldReader); impl LEI_R { + pub(crate) fn new(bits: bool) -> Self { + LEI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LEI_A { @@ -188,15 +231,22 @@ impl LEI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LEI_A::VALUE1 + **self == LEI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LEI_A::VALUE2 + **self == LEI_A::VALUE2 } } -#[doc = "Write proxy for field `LEI`"] +impl core::ops::Deref for LEI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEI` writer - Length Error Interrupt"] pub struct LEI_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> LEI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LEI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Length Error Interrupt is disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> LEI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BEI`"] -pub type BEI_R = crate::R; +#[doc = "Field `BEI` reader - Bus Error Interrupt"] +pub struct BEI_R(crate::FieldReader); impl BEI_R { + pub(crate) fn new(bits: bool) -> Self { + BEI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BEI_A { @@ -263,15 +314,22 @@ impl BEI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BEI_A::VALUE1 + **self == BEI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BEI_A::VALUE2 + **self == BEI_A::VALUE2 } } -#[doc = "Write proxy for field `BEI`"] +impl core::ops::Deref for BEI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BEI` writer - Bus Error Interrupt"] pub struct BEI_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> BEI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BEI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Bus Error Interrupt is disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> BEI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCE`"] -pub type CCE_R = crate::R; +#[doc = "Field `CCE` reader - CRC Check Comparison"] +pub struct CCE_R(crate::FieldReader); impl CCE_R { + pub(crate) fn new(bits: bool) -> Self { + CCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCE_A { @@ -338,15 +397,22 @@ impl CCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCE_A::VALUE1 + **self == CCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCE_A::VALUE2 + **self == CCE_A::VALUE2 } } -#[doc = "Write proxy for field `CCE`"] +impl core::ops::Deref for CCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCE` writer - CRC Check Comparison"] pub struct CCE_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CRC check comparison at the end of a message is disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ALR`"] -pub type ALR_R = crate::R; +#[doc = "Field `ALR` reader - Automatic Length Reload"] +pub struct ALR_R(crate::FieldReader); impl ALR_R { + pub(crate) fn new(bits: bool) -> Self { + ALR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ALR_A { @@ -413,15 +480,22 @@ impl ALR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ALR_A::VALUE1 + **self == ALR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ALR_A::VALUE2 + **self == ALR_A::VALUE2 + } +} +impl core::ops::Deref for ALR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ALR`"] +#[doc = "Field `ALR` writer - Automatic Length Reload"] pub struct ALR_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> ALR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ALR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disables automatic reload of the LENGTH field."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> ALR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REFIN`"] -pub type REFIN_R = crate::R; +#[doc = "Field `REFIN` reader - IR Byte Wise Reflection"] +pub struct REFIN_R(crate::FieldReader); impl REFIN_R { + pub(crate) fn new(bits: bool) -> Self { + REFIN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REFIN_A { @@ -488,15 +563,22 @@ impl REFIN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REFIN_A::VALUE1 + **self == REFIN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REFIN_A::VALUE2 + **self == REFIN_A::VALUE2 + } +} +impl core::ops::Deref for REFIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REFIN`"] +#[doc = "Field `REFIN` writer - IR Byte Wise Reflection"] pub struct REFIN_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> REFIN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REFIN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "IR Byte Wise Reflection is disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> REFIN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REFOUT`"] -pub type REFOUT_R = crate::R; +#[doc = "Field `REFOUT` reader - CRC 32-Bit Wise Reflection"] +pub struct REFOUT_R(crate::FieldReader); impl REFOUT_R { + pub(crate) fn new(bits: bool) -> Self { + REFOUT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REFOUT_A { @@ -563,15 +646,22 @@ impl REFOUT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REFOUT_A::VALUE1 + **self == REFOUT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REFOUT_A::VALUE2 + **self == REFOUT_A::VALUE2 + } +} +impl core::ops::Deref for REFOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REFOUT`"] +#[doc = "Field `REFOUT` writer - CRC 32-Bit Wise Reflection"] pub struct REFOUT_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> REFOUT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REFOUT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "CRC 32-bit wise is disabled"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> REFOUT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XSEL`"] -pub type XSEL_R = crate::R; +#[doc = "Field `XSEL` reader - Selects the value to be xored with the final CRC"] +pub struct XSEL_R(crate::FieldReader); impl XSEL_R { + pub(crate) fn new(bits: bool) -> Self { + XSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XSEL_A { @@ -638,15 +729,22 @@ impl XSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XSEL_A::VALUE1 + **self == XSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XSEL_A::VALUE2 + **self == XSEL_A::VALUE2 } } -#[doc = "Write proxy for field `XSEL`"] +impl core::ops::Deref for XSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XSEL` writer - Selects the value to be xored with the final CRC"] pub struct XSEL_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> XSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "0x00000000"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> XSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -778,4 +874,30 @@ impl W { pub fn xsel(&mut self) -> XSEL_W { XSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Configuration Register\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)."] +pub struct CFG_SPEC; +impl crate::RegisterSpec for CFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfg::R](R) reader structure"] +impl crate::Readable for CFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"] +impl crate::Writable for CFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFG to value 0x0700"] +impl crate::Resettable for CFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0700 + } } diff --git a/src/fce_ke0/check.rs b/src/fce_ke0/check.rs index a329f3a3..5a99ea38 100644 --- a/src/fce_ke0/check.rs +++ b/src/fce_ke0/check.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CHECK"] -pub type R = crate::R; -#[doc = "Writer for register CHECK"] -pub type W = crate::W; -#[doc = "Register CHECK `reset()`'s with value 0"] -impl crate::ResetValue for super::CHECK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CHECK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHECK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CHECK`"] -pub type CHECK_R = crate::R; -#[doc = "Write proxy for field `CHECK`"] +#[doc = "Field `CHECK` reader - CHECK Register"] +pub struct CHECK_R(crate::FieldReader); +impl CHECK_R { + pub(crate) fn new(bits: u32) -> Self { + CHECK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CHECK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHECK` writer - CHECK Register"] pub struct CHECK_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CHECK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn check(&mut self) -> CHECK_W { CHECK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Check Register\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 [check](index.html) module"] +pub struct CHECK_SPEC; +impl crate::RegisterSpec for CHECK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [check::R](R) reader structure"] +impl crate::Readable for CHECK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [check::W](W) writer structure"] +impl crate::Writable for CHECK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHECK to value 0"] +impl crate::Resettable for CHECK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/fce_ke0/crc.rs b/src/fce_ke0/crc.rs index 10899d3e..dee928f4 100644 --- a/src/fce_ke0/crc.rs +++ b/src/fce_ke0/crc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CRC"] -pub type R = crate::R; -#[doc = "Writer for register CRC"] -pub type W = crate::W; -#[doc = "Register CRC `reset()`'s with value 0"] -impl crate::ResetValue for super::CRC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CRC`"] -pub type CRC_R = crate::R; -#[doc = "Write proxy for field `CRC`"] +#[doc = "Field `CRC` reader - CRC Register"] +pub struct CRC_R(crate::FieldReader); +impl CRC_R { + pub(crate) fn new(bits: u32) -> Self { + CRC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRC` writer - CRC Register"] pub struct CRC_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CRC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn crc(&mut self) -> CRC_W { CRC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Register\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 [crc](index.html) module"] +pub struct CRC_SPEC; +impl crate::RegisterSpec for CRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crc::R](R) reader structure"] +impl crate::Readable for CRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crc::W](W) writer structure"] +impl crate::Writable for CRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRC to value 0"] +impl crate::Resettable for CRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/fce_ke0/ctr.rs b/src/fce_ke0/ctr.rs index 07b932a1..fe9fcd25 100644 --- a/src/fce_ke0/ctr.rs +++ b/src/fce_ke0/ctr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTR"] -pub type R = crate::R; -#[doc = "Writer for register CTR"] -pub type W = crate::W; -#[doc = "Register CTR `reset()`'s with value 0"] -impl crate::ResetValue for super::CTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `FCM` reader - Force CRC Mismatch"] +pub struct FCM_R(crate::FieldReader); +impl FCM_R { + pub(crate) fn new(bits: bool) -> Self { + FCM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FCM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `FCM`"] -pub type FCM_R = crate::R; -#[doc = "Write proxy for field `FCM`"] +#[doc = "Field `FCM` writer - Force CRC Mismatch"] pub struct FCM_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> FCM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `FRM_CFG`"] -pub type FRM_CFG_R = crate::R; -#[doc = "Write proxy for field `FRM_CFG`"] +#[doc = "Field `FRM_CFG` reader - Force CFG Register Mismatch"] +pub struct FRM_CFG_R(crate::FieldReader); +impl FRM_CFG_R { + pub(crate) fn new(bits: bool) -> Self { + FRM_CFG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FRM_CFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRM_CFG` writer - Force CFG Register Mismatch"] pub struct FRM_CFG_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> FRM_CFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `FRM_CHECK`"] -pub type FRM_CHECK_R = crate::R; -#[doc = "Write proxy for field `FRM_CHECK`"] +#[doc = "Field `FRM_CHECK` reader - Force Check Register Mismatch"] +pub struct FRM_CHECK_R(crate::FieldReader); +impl FRM_CHECK_R { + pub(crate) fn new(bits: bool) -> Self { + FRM_CHECK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FRM_CHECK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRM_CHECK` writer - Force Check Register Mismatch"] pub struct FRM_CHECK_W<'a> { w: &'a mut W, } @@ -78,7 +138,7 @@ impl<'a> FRM_CHECK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -115,4 +175,30 @@ impl W { pub fn frm_check(&mut self) -> FRM_CHECK_W { FRM_CHECK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Test Register\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 [ctr](index.html) module"] +pub struct CTR_SPEC; +impl crate::RegisterSpec for CTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctr::R](R) reader structure"] +impl crate::Readable for CTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctr::W](W) writer structure"] +impl crate::Writable for CTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTR to value 0"] +impl crate::Resettable for CTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/fce_ke0/ir.rs b/src/fce_ke0/ir.rs index 5d4df795..359b27a8 100644 --- a/src/fce_ke0/ir.rs +++ b/src/fce_ke0/ir.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register IR"] -pub type R = crate::R; -#[doc = "Writer for register IR"] -pub type W = crate::W; -#[doc = "Register IR `reset()`'s with value 0"] -impl crate::ResetValue for super::IR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `IR`"] -pub type IR_R = crate::R; -#[doc = "Write proxy for field `IR`"] +#[doc = "Field `IR` reader - Input Register"] +pub struct IR_R(crate::FieldReader); +impl IR_R { + pub(crate) fn new(bits: u32) -> Self { + IR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IR` writer - Input Register"] pub struct IR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> IR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn ir(&mut self) -> IR_W { IR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Register\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 [ir](index.html) module"] +pub struct IR_SPEC; +impl crate::RegisterSpec for IR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ir::R](R) reader structure"] +impl crate::Readable for IR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ir::W](W) writer structure"] +impl crate::Writable for IR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IR to value 0"] +impl crate::Resettable for IR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/fce_ke0/length.rs b/src/fce_ke0/length.rs index 4d8708b6..deca4771 100644 --- a/src/fce_ke0/length.rs +++ b/src/fce_ke0/length.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LENGTH"] -pub type R = crate::R; -#[doc = "Writer for register LENGTH"] -pub type W = crate::W; -#[doc = "Register LENGTH `reset()`'s with value 0"] -impl crate::ResetValue for super::LENGTH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LENGTH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LENGTH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `LENGTH`"] -pub type LENGTH_R = crate::R; -#[doc = "Write proxy for field `LENGTH`"] +#[doc = "Field `LENGTH` reader - Message Length Register"] +pub struct LENGTH_R(crate::FieldReader); +impl LENGTH_R { + pub(crate) fn new(bits: u16) -> Self { + LENGTH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LENGTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LENGTH` writer - Message Length Register"] pub struct LENGTH_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> LENGTH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn length(&mut self) -> LENGTH_W { LENGTH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Length Register\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 [length](index.html) module"] +pub struct LENGTH_SPEC; +impl crate::RegisterSpec for LENGTH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [length::R](R) reader structure"] +impl crate::Readable for LENGTH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [length::W](W) writer structure"] +impl crate::Writable for LENGTH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LENGTH to value 0"] +impl crate::Resettable for LENGTH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/fce_ke0/res.rs b/src/fce_ke0/res.rs index a00416e4..d3a9e8e4 100644 --- a/src/fce_ke0/res.rs +++ b/src/fce_ke0/res.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RES"] -pub type R = crate::R; -#[doc = "Reader of field `RES`"] -pub type RES_R = crate::R; +#[doc = "Register `RES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RES` reader - Result Register"] +pub struct RES_R(crate::FieldReader); +impl RES_R { + pub(crate) fn new(bits: u32) -> Self { + RES_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Result Register"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { RES_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "CRC Result Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [res](index.html) module"] +pub struct RES_SPEC; +impl crate::RegisterSpec for RES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [res::R](R) reader structure"] +impl crate::Readable for RES_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RES to value 0xffff_ffff"] +impl crate::Resettable for RES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/fce_ke0/sts.rs b/src/fce_ke0/sts.rs index b5f919d1..532ccbe8 100644 --- a/src/fce_ke0/sts.rs +++ b/src/fce_ke0/sts.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register STS"] -pub type R = crate::R; -#[doc = "Writer for register STS"] -pub type W = crate::W; -#[doc = "Register STS `reset()`'s with value 0"] -impl crate::ResetValue for super::STS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `STS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CMF`"] -pub type CMF_R = crate::R; -#[doc = "Write proxy for field `CMF`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CMF` reader - CRC Mismatch Flag"] +pub struct CMF_R(crate::FieldReader); +impl CMF_R { + pub(crate) fn new(bits: bool) -> Self { + CMF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMF` writer - CRC Mismatch Flag"] pub struct CMF_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CMF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CEF`"] -pub type CEF_R = crate::R; -#[doc = "Write proxy for field `CEF`"] +#[doc = "Field `CEF` reader - Configuration Error Flag"] +pub struct CEF_R(crate::FieldReader); +impl CEF_R { + pub(crate) fn new(bits: bool) -> Self { + CEF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CEF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEF` writer - Configuration Error Flag"] pub struct CEF_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CEF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `LEF`"] -pub type LEF_R = crate::R; -#[doc = "Write proxy for field `LEF`"] +#[doc = "Field `LEF` reader - Length Error Flag"] +pub struct LEF_R(crate::FieldReader); +impl LEF_R { + pub(crate) fn new(bits: bool) -> Self { + LEF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LEF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEF` writer - Length Error Flag"] pub struct LEF_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> LEF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `BEF`"] -pub type BEF_R = crate::R; -#[doc = "Write proxy for field `BEF`"] +#[doc = "Field `BEF` reader - Bus Error Flag"] +pub struct BEF_R(crate::FieldReader); +impl BEF_R { + pub(crate) fn new(bits: bool) -> Self { + BEF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BEF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BEF` writer - Bus Error Flag"] pub struct BEF_W<'a> { w: &'a mut W, } @@ -102,7 +174,7 @@ impl<'a> BEF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -149,4 +221,30 @@ impl W { pub fn bef(&mut self) -> BEF_W { BEF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC Status Register\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 [sts](index.html) module"] +pub struct STS_SPEC; +impl crate::RegisterSpec for STS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sts::R](R) reader structure"] +impl crate::Readable for STS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sts::W](W) writer structure"] +impl crate::Writable for STS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STS to value 0"] +impl crate::Resettable for STS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/flash0.rs b/src/flash0.rs index fb7ba3dc..aefb817a 100644 --- a/src/flash0.rs +++ b/src/flash0.rs @@ -1,88 +1,49 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved0: [u8; 4104usize], + _reserved0: [u8; 0x1008], #[doc = "0x1008 - Flash Module Identification Register"] - pub id: ID, - _reserved1: [u8; 4usize], + pub id: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x1010 - Flash Status Register"] - pub fsr: FSR, + pub fsr: crate::Reg, #[doc = "0x1014 - Flash Configuration Register"] - pub fcon: FCON, + pub fcon: crate::Reg, #[doc = "0x1018 - Margin Control Register PFLASH"] - pub marp: MARP, - _reserved4: [u8; 4usize], + pub marp: crate::Reg, + _reserved4: [u8; 0x04], #[doc = "0x1020 - Flash Protection Configuration Register User 0"] - pub procon0: PROCON0, + pub procon0: crate::Reg, #[doc = "0x1024 - Flash Protection Configuration Register User 1"] - pub procon1: PROCON1, + pub procon1: crate::Reg, #[doc = "0x1028 - Flash Protection Configuration Register User 2"] - pub procon2: PROCON2, + pub procon2: crate::Reg, } -#[doc = "Flash Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Flash Module Identification Register"] pub mod id; -#[doc = "Flash Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fsr](fsr) module"] -pub type FSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FSR; -#[doc = "`read()` method returns [fsr::R](fsr::R) reader structure"] -impl crate::Readable for FSR {} +#[doc = "FSR register accessor: an alias for `Reg`"] +pub type FSR = crate::Reg; #[doc = "Flash Status Register"] pub mod fsr; -#[doc = "Flash Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcon](fcon) module"] -pub type FCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FCON; -#[doc = "`read()` method returns [fcon::R](fcon::R) reader structure"] -impl crate::Readable for FCON {} -#[doc = "`write(|w| ..)` method takes [fcon::W](fcon::W) writer structure"] -impl crate::Writable for FCON {} +#[doc = "FCON register accessor: an alias for `Reg`"] +pub type FCON = crate::Reg; #[doc = "Flash Configuration Register"] pub mod fcon; -#[doc = "Margin Control Register PFLASH\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [marp](marp) module"] -pub type MARP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MARP; -#[doc = "`read()` method returns [marp::R](marp::R) reader structure"] -impl crate::Readable for MARP {} -#[doc = "`write(|w| ..)` method takes [marp::W](marp::W) writer structure"] -impl crate::Writable for MARP {} +#[doc = "MARP register accessor: an alias for `Reg`"] +pub type MARP = crate::Reg; #[doc = "Margin Control Register PFLASH"] pub mod marp; -#[doc = "Flash Protection Configuration Register User 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon0](procon0) module"] -pub type PROCON0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PROCON0; -#[doc = "`read()` method returns [procon0::R](procon0::R) reader structure"] -impl crate::Readable for PROCON0 {} +#[doc = "PROCON0 register accessor: an alias for `Reg`"] +pub type PROCON0 = crate::Reg; #[doc = "Flash Protection Configuration Register User 0"] pub mod procon0; -#[doc = "Flash Protection Configuration Register User 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon1](procon1) module"] -pub type PROCON1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PROCON1; -#[doc = "`read()` method returns [procon1::R](procon1::R) reader structure"] -impl crate::Readable for PROCON1 {} +#[doc = "PROCON1 register accessor: an alias for `Reg`"] +pub type PROCON1 = crate::Reg; #[doc = "Flash Protection Configuration Register User 1"] pub mod procon1; -#[doc = "Flash Protection Configuration Register User 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon2](procon2) module"] -pub type PROCON2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PROCON2; -#[doc = "`read()` method returns [procon2::R](procon2::R) reader structure"] -impl crate::Readable for PROCON2 {} +#[doc = "PROCON2 register accessor: an alias for `Reg`"] +pub type PROCON2 = crate::Reg; #[doc = "Flash Protection Configuration Register User 2"] pub mod procon2; diff --git a/src/flash0/fcon.rs b/src/flash0/fcon.rs index d92a18b2..629f6d05 100644 --- a/src/flash0/fcon.rs +++ b/src/flash0/fcon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register FCON"] -pub type R = crate::R; -#[doc = "Writer for register FCON"] -pub type W = crate::W; -#[doc = "Register FCON `reset()`'s with value 0x06"] -impl crate::ResetValue for super::FCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x06 +#[doc = "Register `FCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Wait States for read access to PFLASH\n\nValue on reset: 6"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `WSPFLASH`"] -pub type WSPFLASH_R = crate::R; +#[doc = "Field `WSPFLASH` reader - Wait States for read access to PFLASH"] +pub struct WSPFLASH_R(crate::FieldReader); impl WSPFLASH_R { + pub(crate) fn new(bits: u8) -> Self { + WSPFLASH_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(WSPFLASH_A::VALUE1), - 1 => Val(WSPFLASH_A::VALUE2), - 2 => Val(WSPFLASH_A::VALUE3), - 3 => Val(WSPFLASH_A::VALUE4), - 15 => Val(WSPFLASH_A::VALUE5), - i => Res(i), + 0 => Some(WSPFLASH_A::VALUE1), + 1 => Some(WSPFLASH_A::VALUE2), + 2 => Some(WSPFLASH_A::VALUE3), + 3 => Some(WSPFLASH_A::VALUE4), + 15 => Some(WSPFLASH_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WSPFLASH_A::VALUE1 + **self == WSPFLASH_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WSPFLASH_A::VALUE2 + **self == WSPFLASH_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == WSPFLASH_A::VALUE3 + **self == WSPFLASH_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == WSPFLASH_A::VALUE4 + **self == WSPFLASH_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == WSPFLASH_A::VALUE5 + **self == WSPFLASH_A::VALUE5 + } +} +impl core::ops::Deref for WSPFLASH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WSPFLASH`"] +#[doc = "Field `WSPFLASH` writer - Wait States for read access to PFLASH"] pub struct WSPFLASH_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> WSPFLASH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -129,9 +162,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WSECPF`"] -pub type WSECPF_R = crate::R; +#[doc = "Field `WSECPF` reader - Wait State for Error Correction of PFLASH"] +pub struct WSECPF_R(crate::FieldReader); impl WSECPF_R { + pub(crate) fn new(bits: bool) -> Self { + WSECPF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WSECPF_A { @@ -143,15 +179,22 @@ impl WSECPF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WSECPF_A::VALUE1 + **self == WSECPF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WSECPF_A::VALUE2 + **self == WSECPF_A::VALUE2 } } -#[doc = "Write proxy for field `WSECPF`"] +impl core::ops::Deref for WSECPF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WSECPF` writer - Wait State for Error Correction of PFLASH"] pub struct WSECPF_W<'a> { w: &'a mut W, } @@ -159,9 +202,7 @@ impl<'a> WSECPF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WSECPF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No additional wait state for error correction"] #[inline(always)] @@ -186,7 +227,7 @@ impl<'a> WSECPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -204,9 +245,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IDLE`"] -pub type IDLE_R = crate::R; +#[doc = "Field `IDLE` reader - Dynamic Flash Idle"] +pub struct IDLE_R(crate::FieldReader); impl IDLE_R { + pub(crate) fn new(bits: bool) -> Self { + IDLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IDLE_A { @@ -218,15 +262,22 @@ impl IDLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IDLE_A::VALUE1 + **self == IDLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IDLE_A::VALUE2 + **self == IDLE_A::VALUE2 + } +} +impl core::ops::Deref for IDLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IDLE`"] +#[doc = "Field `IDLE` writer - Dynamic Flash Idle"] pub struct IDLE_W<'a> { w: &'a mut W, } @@ -234,9 +285,7 @@ impl<'a> IDLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IDLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal/standard Flash read operation"] #[inline(always)] @@ -261,7 +310,7 @@ impl<'a> IDLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -279,9 +328,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ESLDIS`"] -pub type ESLDIS_R = crate::R; +#[doc = "Field `ESLDIS` reader - External Sleep Request Disable"] +pub struct ESLDIS_R(crate::FieldReader); impl ESLDIS_R { + pub(crate) fn new(bits: bool) -> Self { + ESLDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ESLDIS_A { @@ -293,15 +345,22 @@ impl ESLDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ESLDIS_A::VALUE1 + **self == ESLDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ESLDIS_A::VALUE2 + **self == ESLDIS_A::VALUE2 } } -#[doc = "Write proxy for field `ESLDIS`"] +impl core::ops::Deref for ESLDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ESLDIS` writer - External Sleep Request Disable"] pub struct ESLDIS_W<'a> { w: &'a mut W, } @@ -309,9 +368,7 @@ impl<'a> ESLDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ESLDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External sleep request signal input is enabled"] #[inline(always)] @@ -336,7 +393,7 @@ impl<'a> ESLDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -354,9 +411,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLEEP`"] -pub type SLEEP_R = crate::R; +#[doc = "Field `SLEEP` reader - Flash SLEEP"] +pub struct SLEEP_R(crate::FieldReader); impl SLEEP_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLEEP_A { @@ -368,15 +428,22 @@ impl SLEEP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLEEP_A::VALUE1 + **self == SLEEP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLEEP_A::VALUE2 + **self == SLEEP_A::VALUE2 } } -#[doc = "Write proxy for field `SLEEP`"] +impl core::ops::Deref for SLEEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLEEP` writer - Flash SLEEP"] pub struct SLEEP_W<'a> { w: &'a mut W, } @@ -384,9 +451,7 @@ impl<'a> SLEEP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLEEP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal state or wake-up"] #[inline(always)] @@ -411,7 +476,7 @@ impl<'a> SLEEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -429,9 +494,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPA`"] -pub type RPA_R = crate::R; +#[doc = "Field `RPA` reader - Read Protection Activated"] +pub struct RPA_R(crate::FieldReader); impl RPA_R { + pub(crate) fn new(bits: bool) -> Self { + RPA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPA_A { @@ -443,12 +511,19 @@ impl RPA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPA_A::VALUE1 + **self == RPA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPA_A::VALUE2 + **self == RPA_A::VALUE2 + } +} +impl core::ops::Deref for RPA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Disable Code Fetch from Flash Memory\n\nValue on reset: 0"] @@ -465,9 +540,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCF`"] -pub type DCF_R = crate::R; +#[doc = "Field `DCF` reader - Disable Code Fetch from Flash Memory"] +pub struct DCF_R(crate::FieldReader); impl DCF_R { + pub(crate) fn new(bits: bool) -> Self { + DCF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCF_A { @@ -479,15 +557,22 @@ impl DCF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCF_A::VALUE1 + **self == DCF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCF_A::VALUE2 + **self == DCF_A::VALUE2 + } +} +impl core::ops::Deref for DCF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DCF`"] +#[doc = "Field `DCF` writer - Disable Code Fetch from Flash Memory"] pub struct DCF_W<'a> { w: &'a mut W, } @@ -495,9 +580,7 @@ impl<'a> DCF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Code fetching from the Flash memory area is allowed."] #[inline(always)] @@ -522,7 +605,7 @@ impl<'a> DCF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -540,9 +623,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DDF`"] -pub type DDF_R = crate::R; +#[doc = "Field `DDF` reader - Disable Any Data Fetch from Flash"] +pub struct DDF_R(crate::FieldReader); impl DDF_R { + pub(crate) fn new(bits: bool) -> Self { + DDF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DDF_A { @@ -554,15 +640,22 @@ impl DDF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DDF_A::VALUE1 + **self == DDF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DDF_A::VALUE2 + **self == DDF_A::VALUE2 + } +} +impl core::ops::Deref for DDF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DDF`"] +#[doc = "Field `DDF` writer - Disable Any Data Fetch from Flash"] pub struct DDF_W<'a> { w: &'a mut W, } @@ -570,9 +663,7 @@ impl<'a> DDF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DDF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Data read access to the Flash memory area is allowed."] #[inline(always)] @@ -597,7 +688,7 @@ impl<'a> DDF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -615,9 +706,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VOPERM`"] -pub type VOPERM_R = crate::R; +#[doc = "Field `VOPERM` reader - Verify and Operation Error Interrupt Mask"] +pub struct VOPERM_R(crate::FieldReader); impl VOPERM_R { + pub(crate) fn new(bits: bool) -> Self { + VOPERM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VOPERM_A { @@ -629,15 +723,22 @@ impl VOPERM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VOPERM_A::VALUE1 + **self == VOPERM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VOPERM_A::VALUE2 + **self == VOPERM_A::VALUE2 + } +} +impl core::ops::Deref for VOPERM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VOPERM`"] +#[doc = "Field `VOPERM` writer - Verify and Operation Error Interrupt Mask"] pub struct VOPERM_W<'a> { w: &'a mut W, } @@ -645,9 +746,7 @@ impl<'a> VOPERM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VOPERM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Interrupt not enabled"] #[inline(always)] @@ -672,7 +771,7 @@ impl<'a> VOPERM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -690,9 +789,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SQERM`"] -pub type SQERM_R = crate::R; +#[doc = "Field `SQERM` reader - Command Sequence Error Interrupt Mask"] +pub struct SQERM_R(crate::FieldReader); impl SQERM_R { + pub(crate) fn new(bits: bool) -> Self { + SQERM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SQERM_A { @@ -704,15 +806,22 @@ impl SQERM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SQERM_A::VALUE1 + **self == SQERM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SQERM_A::VALUE2 + **self == SQERM_A::VALUE2 } } -#[doc = "Write proxy for field `SQERM`"] +impl core::ops::Deref for SQERM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SQERM` writer - Command Sequence Error Interrupt Mask"] pub struct SQERM_W<'a> { w: &'a mut W, } @@ -720,9 +829,7 @@ impl<'a> SQERM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SQERM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Interrupt not enabled"] #[inline(always)] @@ -747,7 +854,7 @@ impl<'a> SQERM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -765,9 +872,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PROERM`"] -pub type PROERM_R = crate::R; +#[doc = "Field `PROERM` reader - Protection Error Interrupt Mask"] +pub struct PROERM_R(crate::FieldReader); impl PROERM_R { + pub(crate) fn new(bits: bool) -> Self { + PROERM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PROERM_A { @@ -779,15 +889,22 @@ impl PROERM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PROERM_A::VALUE1 + **self == PROERM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PROERM_A::VALUE2 + **self == PROERM_A::VALUE2 } } -#[doc = "Write proxy for field `PROERM`"] +impl core::ops::Deref for PROERM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PROERM` writer - Protection Error Interrupt Mask"] pub struct PROERM_W<'a> { w: &'a mut W, } @@ -795,9 +912,7 @@ impl<'a> PROERM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PROERM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Interrupt not enabled"] #[inline(always)] @@ -822,7 +937,7 @@ impl<'a> PROERM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -840,9 +955,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFSBERM`"] -pub type PFSBERM_R = crate::R; +#[doc = "Field `PFSBERM` reader - PFLASH Single-Bit Error Interrupt Mask"] +pub struct PFSBERM_R(crate::FieldReader); impl PFSBERM_R { + pub(crate) fn new(bits: bool) -> Self { + PFSBERM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFSBERM_A { @@ -854,15 +972,22 @@ impl PFSBERM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFSBERM_A::VALUE1 + **self == PFSBERM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFSBERM_A::VALUE2 + **self == PFSBERM_A::VALUE2 } } -#[doc = "Write proxy for field `PFSBERM`"] +impl core::ops::Deref for PFSBERM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PFSBERM` writer - PFLASH Single-Bit Error Interrupt Mask"] pub struct PFSBERM_W<'a> { w: &'a mut W, } @@ -870,9 +995,7 @@ impl<'a> PFSBERM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PFSBERM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No Single-Bit Error interrupt enabled"] #[inline(always)] @@ -897,7 +1020,7 @@ impl<'a> PFSBERM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -915,9 +1038,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFDBERM`"] -pub type PFDBERM_R = crate::R; +#[doc = "Field `PFDBERM` reader - PFLASH Double-Bit Error Interrupt Mask"] +pub struct PFDBERM_R(crate::FieldReader); impl PFDBERM_R { + pub(crate) fn new(bits: bool) -> Self { + PFDBERM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFDBERM_A { @@ -929,15 +1055,22 @@ impl PFDBERM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFDBERM_A::VALUE1 + **self == PFDBERM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFDBERM_A::VALUE2 + **self == PFDBERM_A::VALUE2 } } -#[doc = "Write proxy for field `PFDBERM`"] +impl core::ops::Deref for PFDBERM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PFDBERM` writer - PFLASH Double-Bit Error Interrupt Mask"] pub struct PFDBERM_W<'a> { w: &'a mut W, } @@ -945,9 +1078,7 @@ impl<'a> PFDBERM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PFDBERM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Double-Bit Error interrupt for PFLASH not enabled"] #[inline(always)] @@ -972,7 +1103,7 @@ impl<'a> PFDBERM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -990,9 +1121,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EOBM`"] -pub type EOBM_R = crate::R; +#[doc = "Field `EOBM` reader - End of Busy Interrupt Mask"] +pub struct EOBM_R(crate::FieldReader); impl EOBM_R { + pub(crate) fn new(bits: bool) -> Self { + EOBM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOBM_A { @@ -1004,15 +1138,22 @@ impl EOBM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EOBM_A::VALUE1 + **self == EOBM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EOBM_A::VALUE2 + **self == EOBM_A::VALUE2 + } +} +impl core::ops::Deref for EOBM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EOBM`"] +#[doc = "Field `EOBM` writer - End of Busy Interrupt Mask"] pub struct EOBM_W<'a> { w: &'a mut W, } @@ -1020,9 +1161,7 @@ impl<'a> EOBM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOBM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Interrupt not enabled"] #[inline(always)] @@ -1047,7 +1186,7 @@ impl<'a> EOBM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1189,4 +1328,30 @@ impl W { pub fn eobm(&mut self) -> EOBM_W { EOBM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Flash Configuration Register\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 [fcon](index.html) module"] +pub struct FCON_SPEC; +impl crate::RegisterSpec for FCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fcon::R](R) reader structure"] +impl crate::Readable for FCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fcon::W](W) writer structure"] +impl crate::Writable for FCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FCON to value 0x06"] +impl crate::Resettable for FCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x06 + } } diff --git a/src/flash0/fsr.rs b/src/flash0/fsr.rs index 1cba1395..5a27c461 100644 --- a/src/flash0/fsr.rs +++ b/src/flash0/fsr.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register FSR"] -pub type R = crate::R; +#[doc = "Register `FSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Program Flash Busy\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PBUSY_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PBUSY`"] -pub type PBUSY_R = crate::R; +#[doc = "Field `PBUSY` reader - Program Flash Busy"] +pub struct PBUSY_R(crate::FieldReader); impl PBUSY_R { + pub(crate) fn new(bits: bool) -> Self { + PBUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PBUSY_A { @@ -28,16 +44,35 @@ impl PBUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PBUSY_A::VALUE1 + **self == PBUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PBUSY_A::VALUE2 + **self == PBUSY_A::VALUE2 + } +} +impl core::ops::Deref for PBUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FABUSY` reader - Flash Array Busy"] +pub struct FABUSY_R(crate::FieldReader); +impl FABUSY_R { + pub(crate) fn new(bits: bool) -> Self { + FABUSY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FABUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `FABUSY`"] -pub type FABUSY_R = crate::R; #[doc = "Programming State\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PROG_A { @@ -52,9 +87,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PROG`"] -pub type PROG_R = crate::R; +#[doc = "Field `PROG` reader - Programming State"] +pub struct PROG_R(crate::FieldReader); impl PROG_R { + pub(crate) fn new(bits: bool) -> Self { + PROG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PROG_A { @@ -66,12 +104,19 @@ impl PROG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PROG_A::VALUE1 + **self == PROG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PROG_A::VALUE2 + **self == PROG_A::VALUE2 + } +} +impl core::ops::Deref for PROG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Erase State\n\nValue on reset: 0"] @@ -88,9 +133,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERASE`"] -pub type ERASE_R = crate::R; +#[doc = "Field `ERASE` reader - Erase State"] +pub struct ERASE_R(crate::FieldReader); impl ERASE_R { + pub(crate) fn new(bits: bool) -> Self { + ERASE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERASE_A { @@ -102,12 +150,19 @@ impl ERASE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERASE_A::VALUE1 + **self == ERASE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERASE_A::VALUE2 + **self == ERASE_A::VALUE2 + } +} +impl core::ops::Deref for ERASE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Program Flash in Page Mode\n\nValue on reset: 0"] @@ -124,9 +179,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFPAGE`"] -pub type PFPAGE_R = crate::R; +#[doc = "Field `PFPAGE` reader - Program Flash in Page Mode"] +pub struct PFPAGE_R(crate::FieldReader); impl PFPAGE_R { + pub(crate) fn new(bits: bool) -> Self { + PFPAGE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFPAGE_A { @@ -138,12 +196,19 @@ impl PFPAGE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFPAGE_A::VALUE1 + **self == PFPAGE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFPAGE_A::VALUE2 + **self == PFPAGE_A::VALUE2 + } +} +impl core::ops::Deref for PFPAGE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Program Flash Operation Error\n\nValue on reset: 0"] @@ -160,9 +225,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFOPER`"] -pub type PFOPER_R = crate::R; +#[doc = "Field `PFOPER` reader - Program Flash Operation Error"] +pub struct PFOPER_R(crate::FieldReader); impl PFOPER_R { + pub(crate) fn new(bits: bool) -> Self { + PFOPER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFOPER_A { @@ -174,12 +242,19 @@ impl PFOPER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFOPER_A::VALUE1 + **self == PFOPER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFOPER_A::VALUE2 + **self == PFOPER_A::VALUE2 + } +} +impl core::ops::Deref for PFOPER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Command Sequence Error\n\nValue on reset: 0"] @@ -196,9 +271,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SQER`"] -pub type SQER_R = crate::R; +#[doc = "Field `SQER` reader - Command Sequence Error"] +pub struct SQER_R(crate::FieldReader); impl SQER_R { + pub(crate) fn new(bits: bool) -> Self { + SQER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SQER_A { @@ -210,12 +288,19 @@ impl SQER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SQER_A::VALUE1 + **self == SQER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SQER_A::VALUE2 + **self == SQER_A::VALUE2 + } +} +impl core::ops::Deref for SQER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Protection Error\n\nValue on reset: 0"] @@ -232,9 +317,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PROER`"] -pub type PROER_R = crate::R; +#[doc = "Field `PROER` reader - Protection Error"] +pub struct PROER_R(crate::FieldReader); impl PROER_R { + pub(crate) fn new(bits: bool) -> Self { + PROER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PROER_A { @@ -246,12 +334,19 @@ impl PROER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PROER_A::VALUE1 + **self == PROER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PROER_A::VALUE2 + **self == PROER_A::VALUE2 + } +} +impl core::ops::Deref for PROER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PFLASH Single-Bit Error and Correction\n\nValue on reset: 0"] @@ -268,9 +363,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFSBER`"] -pub type PFSBER_R = crate::R; +#[doc = "Field `PFSBER` reader - PFLASH Single-Bit Error and Correction"] +pub struct PFSBER_R(crate::FieldReader); impl PFSBER_R { + pub(crate) fn new(bits: bool) -> Self { + PFSBER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFSBER_A { @@ -282,12 +380,19 @@ impl PFSBER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFSBER_A::VALUE1 + **self == PFSBER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFSBER_A::VALUE2 + **self == PFSBER_A::VALUE2 + } +} +impl core::ops::Deref for PFSBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PFLASH Double-Bit Error\n\nValue on reset: 0"] @@ -304,9 +409,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PFDBER`"] -pub type PFDBER_R = crate::R; +#[doc = "Field `PFDBER` reader - PFLASH Double-Bit Error"] +pub struct PFDBER_R(crate::FieldReader); impl PFDBER_R { + pub(crate) fn new(bits: bool) -> Self { + PFDBER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PFDBER_A { @@ -318,12 +426,19 @@ impl PFDBER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PFDBER_A::VALUE1 + **self == PFDBER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PFDBER_A::VALUE2 + **self == PFDBER_A::VALUE2 + } +} +impl core::ops::Deref for PFDBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Protection Installed\n\nValue on reset: 0"] @@ -340,9 +455,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PROIN`"] -pub type PROIN_R = crate::R; +#[doc = "Field `PROIN` reader - Protection Installed"] +pub struct PROIN_R(crate::FieldReader); impl PROIN_R { + pub(crate) fn new(bits: bool) -> Self { + PROIN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PROIN_A { @@ -354,12 +472,19 @@ impl PROIN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PROIN_A::VALUE1 + **self == PROIN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PROIN_A::VALUE2 + **self == PROIN_A::VALUE2 + } +} +impl core::ops::Deref for PROIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Read Protection Installed\n\nValue on reset: 0"] @@ -376,9 +501,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPROIN`"] -pub type RPROIN_R = crate::R; +#[doc = "Field `RPROIN` reader - Read Protection Installed"] +pub struct RPROIN_R(crate::FieldReader); impl RPROIN_R { + pub(crate) fn new(bits: bool) -> Self { + RPROIN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPROIN_A { @@ -390,12 +518,19 @@ impl RPROIN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPROIN_A::VALUE1 + **self == RPROIN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPROIN_A::VALUE2 + **self == RPROIN_A::VALUE2 + } +} +impl core::ops::Deref for RPROIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Read Protection Disable State\n\nValue on reset: 0"] @@ -412,9 +547,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPRODIS`"] -pub type RPRODIS_R = crate::R; +#[doc = "Field `RPRODIS` reader - Read Protection Disable State"] +pub struct RPRODIS_R(crate::FieldReader); impl RPRODIS_R { + pub(crate) fn new(bits: bool) -> Self { + RPRODIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPRODIS_A { @@ -426,12 +564,19 @@ impl RPRODIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPRODIS_A::VALUE1 + **self == RPRODIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPRODIS_A::VALUE2 + **self == RPRODIS_A::VALUE2 + } +} +impl core::ops::Deref for RPRODIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector Write Protection Installed for User 0\n\nValue on reset: 0"] @@ -448,9 +593,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WPROIN0`"] -pub type WPROIN0_R = crate::R; +#[doc = "Field `WPROIN0` reader - Sector Write Protection Installed for User 0"] +pub struct WPROIN0_R(crate::FieldReader); impl WPROIN0_R { + pub(crate) fn new(bits: bool) -> Self { + WPROIN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WPROIN0_A { @@ -462,12 +610,19 @@ impl WPROIN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WPROIN0_A::VALUE1 + **self == WPROIN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WPROIN0_A::VALUE2 + **self == WPROIN0_A::VALUE2 + } +} +impl core::ops::Deref for WPROIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector Write Protection Installed for User 1\n\nValue on reset: 0"] @@ -484,9 +639,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WPROIN1`"] -pub type WPROIN1_R = crate::R; +#[doc = "Field `WPROIN1` reader - Sector Write Protection Installed for User 1"] +pub struct WPROIN1_R(crate::FieldReader); impl WPROIN1_R { + pub(crate) fn new(bits: bool) -> Self { + WPROIN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WPROIN1_A { @@ -498,12 +656,19 @@ impl WPROIN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WPROIN1_A::VALUE1 + **self == WPROIN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WPROIN1_A::VALUE2 + **self == WPROIN1_A::VALUE2 + } +} +impl core::ops::Deref for WPROIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector OTP Protection Installed for User 2\n\nValue on reset: 0"] @@ -520,9 +685,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WPROIN2`"] -pub type WPROIN2_R = crate::R; +#[doc = "Field `WPROIN2` reader - Sector OTP Protection Installed for User 2"] +pub struct WPROIN2_R(crate::FieldReader); impl WPROIN2_R { + pub(crate) fn new(bits: bool) -> Self { + WPROIN2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WPROIN2_A { @@ -534,12 +702,19 @@ impl WPROIN2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WPROIN2_A::VALUE1 + **self == WPROIN2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WPROIN2_A::VALUE2 + **self == WPROIN2_A::VALUE2 + } +} +impl core::ops::Deref for WPROIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector Write Protection Disabled for User 0\n\nValue on reset: 0"] @@ -556,9 +731,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WPRODIS0`"] -pub type WPRODIS0_R = crate::R; +#[doc = "Field `WPRODIS0` reader - Sector Write Protection Disabled for User 0"] +pub struct WPRODIS0_R(crate::FieldReader); impl WPRODIS0_R { + pub(crate) fn new(bits: bool) -> Self { + WPRODIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WPRODIS0_A { @@ -570,12 +748,19 @@ impl WPRODIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WPRODIS0_A::VALUE1 + **self == WPRODIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WPRODIS0_A::VALUE2 + **self == WPRODIS0_A::VALUE2 + } +} +impl core::ops::Deref for WPRODIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector Write Protection Disabled for User 1\n\nValue on reset: 0"] @@ -592,9 +777,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WPRODIS1`"] -pub type WPRODIS1_R = crate::R; +#[doc = "Field `WPRODIS1` reader - Sector Write Protection Disabled for User 1"] +pub struct WPRODIS1_R(crate::FieldReader); impl WPRODIS1_R { + pub(crate) fn new(bits: bool) -> Self { + WPRODIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WPRODIS1_A { @@ -606,12 +794,19 @@ impl WPRODIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WPRODIS1_A::VALUE1 + **self == WPRODIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WPRODIS1_A::VALUE2 + **self == WPRODIS1_A::VALUE2 + } +} +impl core::ops::Deref for WPRODIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Flash Sleep Mode\n\nValue on reset: 0"] @@ -628,9 +823,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLM`"] -pub type SLM_R = crate::R; +#[doc = "Field `SLM` reader - Flash Sleep Mode"] +pub struct SLM_R(crate::FieldReader); impl SLM_R { + pub(crate) fn new(bits: bool) -> Self { + SLM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLM_A { @@ -642,12 +840,19 @@ impl SLM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLM_A::VALUE1 + **self == SLM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLM_A::VALUE2 + **self == SLM_A::VALUE2 + } +} +impl core::ops::Deref for SLM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Verify Error\n\nValue on reset: 0"] @@ -664,9 +869,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VER`"] -pub type VER_R = crate::R; +#[doc = "Field `VER` reader - Verify Error"] +pub struct VER_R(crate::FieldReader); impl VER_R { + pub(crate) fn new(bits: bool) -> Self { + VER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VER_A { @@ -678,12 +886,19 @@ impl VER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VER_A::VALUE1 + **self == VER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VER_A::VALUE2 + **self == VER_A::VALUE2 + } +} +impl core::ops::Deref for VER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -788,3 +1003,19 @@ impl R { VER_R::new(((self.bits >> 31) & 0x01) != 0) } } +#[doc = "Flash Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fsr](index.html) module"] +pub struct FSR_SPEC; +impl crate::RegisterSpec for FSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fsr::R](R) reader structure"] +impl crate::Readable for FSR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets FSR to value 0"] +impl crate::Resettable for FSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/flash0/id.rs b/src/flash0/id.rs index ad754b74..20aa17ac 100644 --- a/src/flash0/id.rs +++ b/src/flash0/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Flash Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x009c_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x009c_c000 + } +} diff --git a/src/flash0/marp.rs b/src/flash0/marp.rs index a6d92ba4..68136398 100644 --- a/src/flash0/marp.rs +++ b/src/flash0/marp.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MARP"] -pub type R = crate::R; -#[doc = "Writer for register MARP"] -pub type W = crate::W; -#[doc = "Register MARP `reset()`'s with value 0"] -impl crate::ResetValue for super::MARP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MARP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MARP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "PFLASH Margin Selection\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MARGIN`"] -pub type MARGIN_R = crate::R; +#[doc = "Field `MARGIN` reader - PFLASH Margin Selection"] +pub struct MARGIN_R(crate::FieldReader); impl MARGIN_R { + pub(crate) fn new(bits: u8) -> Self { + MARGIN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MARGIN_A::VALUE1), - 1 => Val(MARGIN_A::VALUE2), - 4 => Val(MARGIN_A::VALUE3), - i => Res(i), + 0 => Some(MARGIN_A::VALUE1), + 1 => Some(MARGIN_A::VALUE2), + 4 => Some(MARGIN_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MARGIN_A::VALUE1 + **self == MARGIN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MARGIN_A::VALUE2 + **self == MARGIN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MARGIN_A::VALUE3 + **self == MARGIN_A::VALUE3 + } +} +impl core::ops::Deref for MARGIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MARGIN`"] +#[doc = "Field `MARGIN` writer - PFLASH Margin Selection"] pub struct MARGIN_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> MARGIN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -103,9 +136,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRAPDIS`"] -pub type TRAPDIS_R = crate::R; +#[doc = "Field `TRAPDIS` reader - PFLASH Double-Bit Error Trap Disable"] +pub struct TRAPDIS_R(crate::FieldReader); impl TRAPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + TRAPDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRAPDIS_A { @@ -117,15 +153,22 @@ impl TRAPDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRAPDIS_A::VALUE1 + **self == TRAPDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRAPDIS_A::VALUE2 + **self == TRAPDIS_A::VALUE2 + } +} +impl core::ops::Deref for TRAPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRAPDIS`"] +#[doc = "Field `TRAPDIS` writer - PFLASH Double-Bit Error Trap Disable"] pub struct TRAPDIS_W<'a> { w: &'a mut W, } @@ -133,9 +176,7 @@ impl<'a> TRAPDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRAPDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "If a double-bit error occurs in PFLASH, a bus error trap is generated."] #[inline(always)] @@ -160,7 +201,7 @@ impl<'a> TRAPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -187,4 +228,30 @@ impl W { pub fn trapdis(&mut self) -> TRAPDIS_W { TRAPDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Margin Control Register PFLASH\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 [marp](index.html) module"] +pub struct MARP_SPEC; +impl crate::RegisterSpec for MARP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [marp::R](R) reader structure"] +impl crate::Readable for MARP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [marp::W](W) writer structure"] +impl crate::Writable for MARP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MARP to value 0"] +impl crate::Resettable for MARP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/flash0/procon0.rs b/src/flash0/procon0.rs index b251c399..fbaa10bc 100644 --- a/src/flash0/procon0.rs +++ b/src/flash0/procon0.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PROCON0"] -pub type R = crate::R; +#[doc = "Register `PROCON0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Sector 0 Locked for Write Protection by User 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0L_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0L`"] -pub type S0L_R = crate::R; +#[doc = "Field `S0L` reader - Sector 0 Locked for Write Protection by User 0"] +pub struct S0L_R(crate::FieldReader); impl S0L_R { + pub(crate) fn new(bits: bool) -> Self { + S0L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0L_A { @@ -28,12 +44,19 @@ impl S0L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0L_A::VALUE1 + **self == S0L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0L_A::VALUE2 + **self == S0L_A::VALUE2 + } +} +impl core::ops::Deref for S0L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 1 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1L`"] -pub type S1L_R = crate::R; +#[doc = "Field `S1L` reader - Sector 1 Locked for Write Protection by User 0"] +pub struct S1L_R(crate::FieldReader); impl S1L_R { + pub(crate) fn new(bits: bool) -> Self { + S1L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1L_A { @@ -64,12 +90,19 @@ impl S1L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1L_A::VALUE1 + **self == S1L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1L_A::VALUE2 + **self == S1L_A::VALUE2 + } +} +impl core::ops::Deref for S1L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 2 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2L`"] -pub type S2L_R = crate::R; +#[doc = "Field `S2L` reader - Sector 2 Locked for Write Protection by User 0"] +pub struct S2L_R(crate::FieldReader); impl S2L_R { + pub(crate) fn new(bits: bool) -> Self { + S2L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2L_A { @@ -100,12 +136,19 @@ impl S2L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2L_A::VALUE1 + **self == S2L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2L_A::VALUE2 + **self == S2L_A::VALUE2 + } +} +impl core::ops::Deref for S2L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 3 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3L`"] -pub type S3L_R = crate::R; +#[doc = "Field `S3L` reader - Sector 3 Locked for Write Protection by User 0"] +pub struct S3L_R(crate::FieldReader); impl S3L_R { + pub(crate) fn new(bits: bool) -> Self { + S3L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3L_A { @@ -136,12 +182,19 @@ impl S3L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3L_A::VALUE1 + **self == S3L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3L_A::VALUE2 + **self == S3L_A::VALUE2 + } +} +impl core::ops::Deref for S3L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 4 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S4L`"] -pub type S4L_R = crate::R; +#[doc = "Field `S4L` reader - Sector 4 Locked for Write Protection by User 0"] +pub struct S4L_R(crate::FieldReader); impl S4L_R { + pub(crate) fn new(bits: bool) -> Self { + S4L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S4L_A { @@ -172,12 +228,19 @@ impl S4L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S4L_A::VALUE1 + **self == S4L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S4L_A::VALUE2 + **self == S4L_A::VALUE2 + } +} +impl core::ops::Deref for S4L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 5 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S5L`"] -pub type S5L_R = crate::R; +#[doc = "Field `S5L` reader - Sector 5 Locked for Write Protection by User 0"] +pub struct S5L_R(crate::FieldReader); impl S5L_R { + pub(crate) fn new(bits: bool) -> Self { + S5L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S5L_A { @@ -208,12 +274,19 @@ impl S5L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S5L_A::VALUE1 + **self == S5L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S5L_A::VALUE2 + **self == S5L_A::VALUE2 + } +} +impl core::ops::Deref for S5L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 6 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S6L`"] -pub type S6L_R = crate::R; +#[doc = "Field `S6L` reader - Sector 6 Locked for Write Protection by User 0"] +pub struct S6L_R(crate::FieldReader); impl S6L_R { + pub(crate) fn new(bits: bool) -> Self { + S6L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S6L_A { @@ -244,12 +320,19 @@ impl S6L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S6L_A::VALUE1 + **self == S6L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S6L_A::VALUE2 + **self == S6L_A::VALUE2 + } +} +impl core::ops::Deref for S6L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 7 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S7L`"] -pub type S7L_R = crate::R; +#[doc = "Field `S7L` reader - Sector 7 Locked for Write Protection by User 0"] +pub struct S7L_R(crate::FieldReader); impl S7L_R { + pub(crate) fn new(bits: bool) -> Self { + S7L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S7L_A { @@ -280,12 +366,19 @@ impl S7L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S7L_A::VALUE1 + **self == S7L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S7L_A::VALUE2 + **self == S7L_A::VALUE2 + } +} +impl core::ops::Deref for S7L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 8 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S8L`"] -pub type S8L_R = crate::R; +#[doc = "Field `S8L` reader - Sector 8 Locked for Write Protection by User 0"] +pub struct S8L_R(crate::FieldReader); impl S8L_R { + pub(crate) fn new(bits: bool) -> Self { + S8L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S8L_A { @@ -316,12 +412,19 @@ impl S8L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S8L_A::VALUE1 + **self == S8L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S8L_A::VALUE2 + **self == S8L_A::VALUE2 + } +} +impl core::ops::Deref for S8L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Read Protection Configuration\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPRO`"] -pub type RPRO_R = crate::R; +#[doc = "Field `RPRO` reader - Read Protection Configuration"] +pub struct RPRO_R(crate::FieldReader); impl RPRO_R { + pub(crate) fn new(bits: bool) -> Self { + RPRO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPRO_A { @@ -352,12 +458,19 @@ impl RPRO_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPRO_A::VALUE1 + **self == RPRO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPRO_A::VALUE2 + **self == RPRO_A::VALUE2 + } +} +impl core::ops::Deref for RPRO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -412,3 +525,19 @@ impl R { RPRO_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Flash Protection Configuration Register User 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon0](index.html) module"] +pub struct PROCON0_SPEC; +impl crate::RegisterSpec for PROCON0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [procon0::R](R) reader structure"] +impl crate::Readable for PROCON0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PROCON0 to value 0"] +impl crate::Resettable for PROCON0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/flash0/procon1.rs b/src/flash0/procon1.rs index 59cdae63..9c1a2776 100644 --- a/src/flash0/procon1.rs +++ b/src/flash0/procon1.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PROCON1"] -pub type R = crate::R; +#[doc = "Register `PROCON1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Sector 0 Locked for Write Protection by User 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0L_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0L`"] -pub type S0L_R = crate::R; +#[doc = "Field `S0L` reader - Sector 0 Locked for Write Protection by User 1"] +pub struct S0L_R(crate::FieldReader); impl S0L_R { + pub(crate) fn new(bits: bool) -> Self { + S0L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0L_A { @@ -28,12 +44,19 @@ impl S0L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0L_A::VALUE1 + **self == S0L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0L_A::VALUE2 + **self == S0L_A::VALUE2 + } +} +impl core::ops::Deref for S0L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 1 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1L`"] -pub type S1L_R = crate::R; +#[doc = "Field `S1L` reader - Sector 1 Locked for Write Protection by User 1"] +pub struct S1L_R(crate::FieldReader); impl S1L_R { + pub(crate) fn new(bits: bool) -> Self { + S1L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1L_A { @@ -64,12 +90,19 @@ impl S1L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1L_A::VALUE1 + **self == S1L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1L_A::VALUE2 + **self == S1L_A::VALUE2 + } +} +impl core::ops::Deref for S1L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 2 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2L`"] -pub type S2L_R = crate::R; +#[doc = "Field `S2L` reader - Sector 2 Locked for Write Protection by User 1"] +pub struct S2L_R(crate::FieldReader); impl S2L_R { + pub(crate) fn new(bits: bool) -> Self { + S2L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2L_A { @@ -100,12 +136,19 @@ impl S2L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2L_A::VALUE1 + **self == S2L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2L_A::VALUE2 + **self == S2L_A::VALUE2 + } +} +impl core::ops::Deref for S2L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 3 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3L`"] -pub type S3L_R = crate::R; +#[doc = "Field `S3L` reader - Sector 3 Locked for Write Protection by User 1"] +pub struct S3L_R(crate::FieldReader); impl S3L_R { + pub(crate) fn new(bits: bool) -> Self { + S3L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3L_A { @@ -136,12 +182,19 @@ impl S3L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3L_A::VALUE1 + **self == S3L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3L_A::VALUE2 + **self == S3L_A::VALUE2 + } +} +impl core::ops::Deref for S3L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 4 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S4L`"] -pub type S4L_R = crate::R; +#[doc = "Field `S4L` reader - Sector 4 Locked for Write Protection by User 1"] +pub struct S4L_R(crate::FieldReader); impl S4L_R { + pub(crate) fn new(bits: bool) -> Self { + S4L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S4L_A { @@ -172,12 +228,19 @@ impl S4L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S4L_A::VALUE1 + **self == S4L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S4L_A::VALUE2 + **self == S4L_A::VALUE2 + } +} +impl core::ops::Deref for S4L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 5 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S5L`"] -pub type S5L_R = crate::R; +#[doc = "Field `S5L` reader - Sector 5 Locked for Write Protection by User 1"] +pub struct S5L_R(crate::FieldReader); impl S5L_R { + pub(crate) fn new(bits: bool) -> Self { + S5L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S5L_A { @@ -208,12 +274,19 @@ impl S5L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S5L_A::VALUE1 + **self == S5L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S5L_A::VALUE2 + **self == S5L_A::VALUE2 + } +} +impl core::ops::Deref for S5L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 6 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S6L`"] -pub type S6L_R = crate::R; +#[doc = "Field `S6L` reader - Sector 6 Locked for Write Protection by User 1"] +pub struct S6L_R(crate::FieldReader); impl S6L_R { + pub(crate) fn new(bits: bool) -> Self { + S6L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S6L_A { @@ -244,12 +320,19 @@ impl S6L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S6L_A::VALUE1 + **self == S6L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S6L_A::VALUE2 + **self == S6L_A::VALUE2 + } +} +impl core::ops::Deref for S6L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 7 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S7L`"] -pub type S7L_R = crate::R; +#[doc = "Field `S7L` reader - Sector 7 Locked for Write Protection by User 1"] +pub struct S7L_R(crate::FieldReader); impl S7L_R { + pub(crate) fn new(bits: bool) -> Self { + S7L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S7L_A { @@ -280,12 +366,19 @@ impl S7L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S7L_A::VALUE1 + **self == S7L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S7L_A::VALUE2 + **self == S7L_A::VALUE2 + } +} +impl core::ops::Deref for S7L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 8 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S8L`"] -pub type S8L_R = crate::R; +#[doc = "Field `S8L` reader - Sector 8 Locked for Write Protection by User 1"] +pub struct S8L_R(crate::FieldReader); impl S8L_R { + pub(crate) fn new(bits: bool) -> Self { + S8L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S8L_A { @@ -316,12 +412,19 @@ impl S8L_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S8L_A::VALUE1 + **self == S8L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S8L_A::VALUE2 + **self == S8L_A::VALUE2 + } +} +impl core::ops::Deref for S8L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { S8L_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Flash Protection Configuration Register User 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon1](index.html) module"] +pub struct PROCON1_SPEC; +impl crate::RegisterSpec for PROCON1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [procon1::R](R) reader structure"] +impl crate::Readable for PROCON1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PROCON1 to value 0"] +impl crate::Resettable for PROCON1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/flash0/procon2.rs b/src/flash0/procon2.rs index c3499307..da8b5a0e 100644 --- a/src/flash0/procon2.rs +++ b/src/flash0/procon2.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PROCON2"] -pub type R = crate::R; +#[doc = "Register `PROCON2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Sector 0 Locked Forever by User 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0ROM_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0ROM`"] -pub type S0ROM_R = crate::R; +#[doc = "Field `S0ROM` reader - Sector 0 Locked Forever by User 2"] +pub struct S0ROM_R(crate::FieldReader); impl S0ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S0ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0ROM_A { @@ -28,12 +44,19 @@ impl S0ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0ROM_A::VALUE1 + **self == S0ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0ROM_A::VALUE2 + **self == S0ROM_A::VALUE2 + } +} +impl core::ops::Deref for S0ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 1 Locked Forever by User 2\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1ROM`"] -pub type S1ROM_R = crate::R; +#[doc = "Field `S1ROM` reader - Sector 1 Locked Forever by User 2"] +pub struct S1ROM_R(crate::FieldReader); impl S1ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S1ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1ROM_A { @@ -64,12 +90,19 @@ impl S1ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1ROM_A::VALUE1 + **self == S1ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1ROM_A::VALUE2 + **self == S1ROM_A::VALUE2 + } +} +impl core::ops::Deref for S1ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 2 Locked Forever by User 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2ROM`"] -pub type S2ROM_R = crate::R; +#[doc = "Field `S2ROM` reader - Sector 2 Locked Forever by User 2"] +pub struct S2ROM_R(crate::FieldReader); impl S2ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S2ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2ROM_A { @@ -100,12 +136,19 @@ impl S2ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2ROM_A::VALUE1 + **self == S2ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2ROM_A::VALUE2 + **self == S2ROM_A::VALUE2 + } +} +impl core::ops::Deref for S2ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 3 Locked Forever by User 2\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S3ROM`"] -pub type S3ROM_R = crate::R; +#[doc = "Field `S3ROM` reader - Sector 3 Locked Forever by User 2"] +pub struct S3ROM_R(crate::FieldReader); impl S3ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S3ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S3ROM_A { @@ -136,12 +182,19 @@ impl S3ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S3ROM_A::VALUE1 + **self == S3ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S3ROM_A::VALUE2 + **self == S3ROM_A::VALUE2 + } +} +impl core::ops::Deref for S3ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 4 Locked Forever by User 2\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S4ROM`"] -pub type S4ROM_R = crate::R; +#[doc = "Field `S4ROM` reader - Sector 4 Locked Forever by User 2"] +pub struct S4ROM_R(crate::FieldReader); impl S4ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S4ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S4ROM_A { @@ -172,12 +228,19 @@ impl S4ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S4ROM_A::VALUE1 + **self == S4ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S4ROM_A::VALUE2 + **self == S4ROM_A::VALUE2 + } +} +impl core::ops::Deref for S4ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 5 Locked Forever by User 2\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S5ROM`"] -pub type S5ROM_R = crate::R; +#[doc = "Field `S5ROM` reader - Sector 5 Locked Forever by User 2"] +pub struct S5ROM_R(crate::FieldReader); impl S5ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S5ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S5ROM_A { @@ -208,12 +274,19 @@ impl S5ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S5ROM_A::VALUE1 + **self == S5ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S5ROM_A::VALUE2 + **self == S5ROM_A::VALUE2 + } +} +impl core::ops::Deref for S5ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 6 Locked Forever by User 2\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S6ROM`"] -pub type S6ROM_R = crate::R; +#[doc = "Field `S6ROM` reader - Sector 6 Locked Forever by User 2"] +pub struct S6ROM_R(crate::FieldReader); impl S6ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S6ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S6ROM_A { @@ -244,12 +320,19 @@ impl S6ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S6ROM_A::VALUE1 + **self == S6ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S6ROM_A::VALUE2 + **self == S6ROM_A::VALUE2 + } +} +impl core::ops::Deref for S6ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 7 Locked Forever by User 2\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S7ROM`"] -pub type S7ROM_R = crate::R; +#[doc = "Field `S7ROM` reader - Sector 7 Locked Forever by User 2"] +pub struct S7ROM_R(crate::FieldReader); impl S7ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S7ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S7ROM_A { @@ -280,12 +366,19 @@ impl S7ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S7ROM_A::VALUE1 + **self == S7ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S7ROM_A::VALUE2 + **self == S7ROM_A::VALUE2 + } +} +impl core::ops::Deref for S7ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sector 8 Locked Forever by User 2\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S8ROM`"] -pub type S8ROM_R = crate::R; +#[doc = "Field `S8ROM` reader - Sector 8 Locked Forever by User 2"] +pub struct S8ROM_R(crate::FieldReader); impl S8ROM_R { + pub(crate) fn new(bits: bool) -> Self { + S8ROM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S8ROM_A { @@ -316,12 +412,19 @@ impl S8ROM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S8ROM_A::VALUE1 + **self == S8ROM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S8ROM_A::VALUE2 + **self == S8ROM_A::VALUE2 + } +} +impl core::ops::Deref for S8ROM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { S8ROM_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Flash Protection Configuration Register User 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [procon2](index.html) module"] +pub struct PROCON2_SPEC; +impl crate::RegisterSpec for PROCON2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [procon2::R](R) reader structure"] +impl crate::Readable for PROCON2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PROCON2 to value 0"] +impl crate::Resettable for PROCON2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/generic.rs b/src/generic.rs index 557dbe34..acccb122 100644 --- a/src/generic.rs +++ b/src/generic.rs @@ -1,162 +1,207 @@ use core::marker; -#[doc = "This trait shows that register has `read` method"] +#[doc = " Raw register type"] +pub trait RegisterSpec { + #[doc = " Raw register type (`u8`, `u16`, `u32`, ...)."] + type Ux: Copy; +} +#[doc = " Trait implemented by readable registers to enable the `read` method."] +#[doc = ""] +#[doc = " Registers marked with `Writable` can be also `modify`'ed."] +pub trait Readable: RegisterSpec { + #[doc = " Result from a call to `read` and argument to `modify`."] + type Reader: From> + core::ops::Deref>; +} +#[doc = " Trait implemented by writeable registers."] #[doc = ""] -#[doc = "Registers marked with `Writable` can be also `modify`'ed"] -pub trait Readable {} -#[doc = "This trait shows that register has `write`, `write_with_zero` and `reset` method"] +#[doc = " This enables the `write`, `write_with_zero` and `reset` methods."] #[doc = ""] -#[doc = "Registers marked with `Readable` can be also `modify`'ed"] -pub trait Writable {} -#[doc = "Reset value of the register"] +#[doc = " Registers marked with `Readable` can be also `modify`'ed."] +pub trait Writable: RegisterSpec { + #[doc = " Writer type argument to `write`, et al."] + type Writer: From> + core::ops::DerefMut>; +} +#[doc = " Reset value of the register."] #[doc = ""] -#[doc = "This value is initial value for `write` method."] -#[doc = "It can be also directly writed to register by `reset` method."] -pub trait ResetValue { - #[doc = "Register size"] - type Type; - #[doc = "Reset value of the register"] - fn reset_value() -> Self::Type; -} -#[doc = "This structure provides volatile access to register"] -pub struct Reg { - register: vcell::VolatileCell, +#[doc = " This value is the initial value for the `write` method. It can also be directly written to the"] +#[doc = " register by using the `reset` method."] +pub trait Resettable: RegisterSpec { + #[doc = " Reset value of the register."] + fn reset_value() -> Self::Ux; +} +#[doc = " This structure provides volatile access to registers."] +#[repr(transparent)] +pub struct Reg { + register: vcell::VolatileCell, _marker: marker::PhantomData, } -unsafe impl Send for Reg {} -impl Reg -where - Self: Readable, - U: Copy, -{ - #[doc = "Reads the contents of `Readable` register"] +unsafe impl Send for Reg where REG::Ux: Send {} +impl Reg { + #[doc = " Returns the underlying memory address of register."] #[doc = ""] - #[doc = "You can read the contents of a register in such way:"] - #[doc = "```ignore"] - #[doc = "let bits = periph.reg.read().bits();"] - #[doc = "```"] - #[doc = "or get the content of a particular field of a register."] - #[doc = "```ignore"] - #[doc = "let reader = periph.reg.read();"] - #[doc = "let bits = reader.field1().bits();"] - #[doc = "let flag = reader.field2().bit_is_set();"] - #[doc = "```"] + #[doc = " ```ignore"] + #[doc = " let reg_ptr = periph.reg.as_ptr();"] + #[doc = " ```"] #[inline(always)] - pub fn read(&self) -> R { - R { bits: self.register.get(), _reg: marker::PhantomData } + pub fn as_ptr(&self) -> *mut REG::Ux { + self.register.as_ptr() } } -impl Reg -where - Self: ResetValue + Writable, - U: Copy, -{ - #[doc = "Writes the reset value to `Writable` register"] +impl Reg { + #[doc = " Reads the contents of a `Readable` register."] #[doc = ""] - #[doc = "Resets the register to its initial state"] + #[doc = " You can read the raw contents of a register by using `bits`:"] + #[doc = " ```ignore"] + #[doc = " let bits = periph.reg.read().bits();"] + #[doc = " ```"] + #[doc = " or get the content of a particular field of a register:"] + #[doc = " ```ignore"] + #[doc = " let reader = periph.reg.read();"] + #[doc = " let bits = reader.field1().bits();"] + #[doc = " let flag = reader.field2().bit_is_set();"] + #[doc = " ```"] #[inline(always)] - pub fn reset(&self) { - self.register.set(Self::reset_value()) + pub fn read(&self) -> REG::Reader { + REG::Reader::from(R { bits: self.register.get(), _reg: marker::PhantomData }) } } -impl Reg -where - Self: ResetValue + Writable, - U: Copy, -{ - #[doc = "Writes bits to `Writable` register"] +impl Reg { + #[doc = " Writes the reset value to `Writable` register."] #[doc = ""] - #[doc = "You can write raw bits into a register:"] - #[doc = "```ignore"] - #[doc = "periph.reg.write(|w| unsafe { w.bits(rawbits) });"] - #[doc = "```"] - #[doc = "or write only the fields you need:"] - #[doc = "```ignore"] - #[doc = "periph.reg.write(|w| w"] - #[doc = " .field1().bits(newfield1bits)"] - #[doc = " .field2().set_bit()"] - #[doc = " .field3().variant(VARIANT)"] - #[doc = ");"] - #[doc = "```"] - #[doc = "Other fields will have reset value."] + #[doc = " Resets the register to its initial state."] + #[inline(always)] + pub fn reset(&self) { + self.register.set(REG::reset_value()) + } + #[doc = " Writes bits to a `Writable` register."] + #[doc = ""] + #[doc = " You can write raw bits into a register:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.write(|w| unsafe { w.bits(rawbits) });"] + #[doc = " ```"] + #[doc = " or write only the fields you need:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.write(|w| w"] + #[doc = " .field1().bits(newfield1bits)"] + #[doc = " .field2().set_bit()"] + #[doc = " .field3().variant(VARIANT)"] + #[doc = " );"] + #[doc = " ```"] + #[doc = " In the latter case, other fields will be set to their reset value."] #[inline(always)] pub fn write(&self, f: F) where - F: FnOnce(&mut W) -> &mut W, + F: FnOnce(&mut REG::Writer) -> &mut W, { - self.register.set(f(&mut W { bits: Self::reset_value(), _reg: marker::PhantomData }).bits); + self.register.set(f(&mut REG::Writer::from(W { bits: REG::reset_value(), _reg: marker::PhantomData })).bits); } } -impl Reg +impl Reg where - Self: Writable, - U: Copy + Default, + REG::Ux: Default, { - #[doc = "Writes Zero to `Writable` register"] + #[doc = " Writes 0 to a `Writable` register."] #[doc = ""] - #[doc = "Similar to `write`, but unused bits will contain 0."] + #[doc = " Similar to `write`, but unused bits will contain 0."] #[inline(always)] - pub fn write_with_zero(&self, f: F) + pub unsafe fn write_with_zero(&self, f: F) where - F: FnOnce(&mut W) -> &mut W, + F: FnOnce(&mut REG::Writer) -> &mut W, { - self.register.set(f(&mut W { bits: U::default(), _reg: marker::PhantomData }).bits); + self.register.set((*f(&mut REG::Writer::from(W { bits: REG::Ux::default(), _reg: marker::PhantomData }))).bits); } } -impl Reg -where - Self: Readable + Writable, - U: Copy, -{ - #[doc = "Modifies the contents of the register"] +impl Reg { + #[doc = " Modifies the contents of the register by reading and then writing it."] #[doc = ""] - #[doc = "E.g. to do a read-modify-write sequence to change parts of a register:"] - #[doc = "```ignore"] - #[doc = "periph.reg.modify(|r, w| unsafe { w.bits("] - #[doc = " r.bits() | 3"] - #[doc = ") });"] - #[doc = "```"] - #[doc = "or"] - #[doc = "```ignore"] - #[doc = "periph.reg.modify(|_, w| w"] - #[doc = " .field1().bits(newfield1bits)"] - #[doc = " .field2().set_bit()"] - #[doc = " .field3().variant(VARIANT)"] - #[doc = ");"] - #[doc = "```"] - #[doc = "Other fields will have value they had before call `modify`."] + #[doc = " E.g. to do a read-modify-write sequence to change parts of a register:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.modify(|r, w| unsafe { w.bits("] + #[doc = " r.bits() | 3"] + #[doc = " ) });"] + #[doc = " ```"] + #[doc = " or"] + #[doc = " ```ignore"] + #[doc = " periph.reg.modify(|_, w| w"] + #[doc = " .field1().bits(newfield1bits)"] + #[doc = " .field2().set_bit()"] + #[doc = " .field3().variant(VARIANT)"] + #[doc = " );"] + #[doc = " ```"] + #[doc = " Other fields will have the value they had before the call to `modify`."] #[inline(always)] pub fn modify(&self, f: F) where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, + for<'w> F: FnOnce(®::Reader, &'w mut REG::Writer) -> &'w mut W, { let bits = self.register.get(); - self.register.set(f(&R { bits, _reg: marker::PhantomData }, &mut W { bits, _reg: marker::PhantomData }).bits); + self.register.set(f(®::Reader::from(R { bits, _reg: marker::PhantomData }), &mut REG::Writer::from(W { bits, _reg: marker::PhantomData })).bits); + } +} +#[doc = " Register reader."] +#[doc = ""] +#[doc = " Result of the `read` methods of registers. Also used as a closure argument in the `modify`"] +#[doc = " method."] +pub struct R { + pub(crate) bits: REG::Ux, + _reg: marker::PhantomData, +} +impl R { + #[doc = " Reads raw bits from register."] + #[inline(always)] + pub fn bits(&self) -> REG::Ux { + self.bits + } +} +impl PartialEq for R +where + REG::Ux: PartialEq, + FI: Copy + Into, +{ + #[inline(always)] + fn eq(&self, other: &FI) -> bool { + self.bits.eq(&(*other).into()) + } +} +#[doc = " Register writer."] +#[doc = ""] +#[doc = " Used as an argument to the closures in the `write` and `modify` methods of the register."] +pub struct W { + #[doc = "Writable bits"] + pub(crate) bits: REG::Ux, + _reg: marker::PhantomData, +} +impl W { + #[doc = " Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: REG::Ux) -> &mut Self { + self.bits = bits; + self } } -#[doc = "Register/field reader"] +#[doc = " Field reader."] #[doc = ""] -#[doc = "Result of the [`read`](Reg::read) method of a register."] -#[doc = "Also it can be used in the [`modify`](Reg::read) method"] -pub struct R { +#[doc = " Result of the `read` methods of fields."] +pub struct FieldReader { pub(crate) bits: U, _reg: marker::PhantomData, } -impl R +impl FieldReader where U: Copy, { - #[doc = "Create new instance of reader"] + #[doc = " Creates a new instance of the reader."] + #[allow(unused)] #[inline(always)] pub(crate) fn new(bits: U) -> Self { Self { bits, _reg: marker::PhantomData } } - #[doc = "Read raw bits from register/field"] + #[doc = " Reads raw bits from field."] #[inline(always)] pub fn bits(&self) -> U { self.bits } } -impl PartialEq for R +impl PartialEq for FieldReader where U: PartialEq, FI: Copy + Into, @@ -166,44 +211,20 @@ where self.bits.eq(&(*other).into()) } } -impl R { - #[doc = "Value of the field as raw bits"] +impl FieldReader { + #[doc = " Value of the field as raw bits."] #[inline(always)] pub fn bit(&self) -> bool { self.bits } - #[doc = "Returns `true` if the bit is clear (0)"] + #[doc = " Returns `true` if the bit is clear (0)."] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } - #[doc = "Returns `true` if the bit is set (1)"] + #[doc = " Returns `true` if the bit is set (1)."] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } -#[doc = "Register writer"] -#[doc = ""] -#[doc = "Used as an argument to the closures in the [`write`](Reg::write) and [`modify`](Reg::modify) methods of the register"] -pub struct W { - #[doc = "Writable bits"] - pub(crate) bits: U, - _reg: marker::PhantomData, -} -impl W { - #[doc = "Writes raw bits to the register"] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: U) -> &mut Self { - self.bits = bits; - self - } -} -#[doc = "Used if enumerated values cover not the whole range"] -#[derive(Clone, Copy, PartialEq)] -pub enum Variant { - #[doc = "Expected variant"] - Val(T), - #[doc = "Raw bits"] - Res(U), -} diff --git a/src/gpdma0.rs b/src/gpdma0.rs index c690b78b..bbc79176 100644 --- a/src/gpdma0.rs +++ b/src/gpdma0.rs @@ -2,421 +2,225 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Raw IntTfr Status"] - pub rawtfr: RAWTFR, - _reserved1: [u8; 4usize], + pub rawtfr: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Raw IntBlock Status"] - pub rawblock: RAWBLOCK, - _reserved2: [u8; 4usize], + pub rawblock: crate::Reg, + _reserved2: [u8; 0x04], #[doc = "0x10 - Raw IntSrcTran Status"] - pub rawsrctran: RAWSRCTRAN, - _reserved3: [u8; 4usize], + pub rawsrctran: crate::Reg, + _reserved3: [u8; 0x04], #[doc = "0x18 - Raw IntBlock Status"] - pub rawdsttran: RAWDSTTRAN, - _reserved4: [u8; 4usize], + pub rawdsttran: crate::Reg, + _reserved4: [u8; 0x04], #[doc = "0x20 - Raw IntErr Status"] - pub rawerr: RAWERR, - _reserved5: [u8; 4usize], + pub rawerr: crate::Reg, + _reserved5: [u8; 0x04], #[doc = "0x28 - IntTfr Status"] - pub statustfr: STATUSTFR, - _reserved6: [u8; 4usize], + pub statustfr: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0x30 - IntBlock Status"] - pub statusblock: STATUSBLOCK, - _reserved7: [u8; 4usize], + pub statusblock: crate::Reg, + _reserved7: [u8; 0x04], #[doc = "0x38 - IntSrcTran Status"] - pub statussrctran: STATUSSRCTRAN, - _reserved8: [u8; 4usize], + pub statussrctran: crate::Reg, + _reserved8: [u8; 0x04], #[doc = "0x40 - IntBlock Status"] - pub statusdsttran: STATUSDSTTRAN, - _reserved9: [u8; 4usize], + pub statusdsttran: crate::Reg, + _reserved9: [u8; 0x04], #[doc = "0x48 - IntErr Status"] - pub statuserr: STATUSERR, - _reserved10: [u8; 4usize], + pub statuserr: crate::Reg, + _reserved10: [u8; 0x04], #[doc = "0x50 - Mask for Raw IntTfr Status"] - pub masktfr: MASKTFR, - _reserved11: [u8; 4usize], + pub masktfr: crate::Reg, + _reserved11: [u8; 0x04], #[doc = "0x58 - Mask for Raw IntBlock Status"] - pub maskblock: MASKBLOCK, - _reserved12: [u8; 4usize], + pub maskblock: crate::Reg, + _reserved12: [u8; 0x04], #[doc = "0x60 - Mask for Raw IntSrcTran Status"] - pub masksrctran: MASKSRCTRAN, - _reserved13: [u8; 4usize], + pub masksrctran: crate::Reg, + _reserved13: [u8; 0x04], #[doc = "0x68 - Mask for Raw IntBlock Status"] - pub maskdsttran: MASKDSTTRAN, - _reserved14: [u8; 4usize], + pub maskdsttran: crate::Reg, + _reserved14: [u8; 0x04], #[doc = "0x70 - Mask for Raw IntErr Status"] - pub maskerr: MASKERR, - _reserved15: [u8; 4usize], + pub maskerr: crate::Reg, + _reserved15: [u8; 0x04], #[doc = "0x78 - IntTfr Status"] - pub cleartfr: CLEARTFR, - _reserved16: [u8; 4usize], + pub cleartfr: crate::Reg, + _reserved16: [u8; 0x04], #[doc = "0x80 - IntBlock Status"] - pub clearblock: CLEARBLOCK, - _reserved17: [u8; 4usize], + pub clearblock: crate::Reg, + _reserved17: [u8; 0x04], #[doc = "0x88 - IntSrcTran Status"] - pub clearsrctran: CLEARSRCTRAN, - _reserved18: [u8; 4usize], + pub clearsrctran: crate::Reg, + _reserved18: [u8; 0x04], #[doc = "0x90 - IntBlock Status"] - pub cleardsttran: CLEARDSTTRAN, - _reserved19: [u8; 4usize], + pub cleardsttran: crate::Reg, + _reserved19: [u8; 0x04], #[doc = "0x98 - IntErr Status"] - pub clearerr: CLEARERR, - _reserved20: [u8; 4usize], + pub clearerr: crate::Reg, + _reserved20: [u8; 0x04], #[doc = "0xa0 - Combined Interrupt Status Register"] - pub statusint: STATUSINT, - _reserved21: [u8; 4usize], + pub statusint: crate::Reg, + _reserved21: [u8; 0x04], #[doc = "0xa8 - Source Software Transaction Request Register"] - pub reqsrcreg: REQSRCREG, - _reserved22: [u8; 4usize], + pub reqsrcreg: crate::Reg, + _reserved22: [u8; 0x04], #[doc = "0xb0 - Destination Software Transaction Request Register"] - pub reqdstreg: REQDSTREG, - _reserved23: [u8; 4usize], + pub reqdstreg: crate::Reg, + _reserved23: [u8; 0x04], #[doc = "0xb8 - Single Source Transaction Request Register"] - pub sglreqsrcreg: SGLREQSRCREG, - _reserved24: [u8; 4usize], + pub sglreqsrcreg: crate::Reg, + _reserved24: [u8; 0x04], #[doc = "0xc0 - Single Destination Transaction Request Register"] - pub sglreqdstreg: SGLREQDSTREG, - _reserved25: [u8; 4usize], + pub sglreqdstreg: crate::Reg, + _reserved25: [u8; 0x04], #[doc = "0xc8 - Last Source Transaction Request Register"] - pub lstsrcreg: LSTSRCREG, - _reserved26: [u8; 4usize], + pub lstsrcreg: crate::Reg, + _reserved26: [u8; 0x04], #[doc = "0xd0 - Last Destination Transaction Request Register"] - pub lstdstreg: LSTDSTREG, - _reserved27: [u8; 4usize], + pub lstdstreg: crate::Reg, + _reserved27: [u8; 0x04], #[doc = "0xd8 - GPDMA Configuration Register"] - pub dmacfgreg: DMACFGREG, - _reserved28: [u8; 4usize], + pub dmacfgreg: crate::Reg, + _reserved28: [u8; 0x04], #[doc = "0xe0 - GPDMA Channel Enable Register"] - pub chenreg: CHENREG, - _reserved29: [u8; 4usize], + pub chenreg: crate::Reg, + _reserved29: [u8; 0x04], #[doc = "0xe8 - GPDMA0 ID Register"] - pub id: ID, - _reserved30: [u8; 76usize], + pub id: crate::Reg, + _reserved30: [u8; 0x4c], #[doc = "0x138 - GPDMA Component Type"] - pub type_: TYPE, + pub type_: crate::Reg, #[doc = "0x13c - DMA Component Version"] - pub version: VERSION, + pub version: crate::Reg, } -#[doc = "Raw IntTfr Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawtfr](rawtfr) module"] -pub type RAWTFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWTFR; -#[doc = "`read()` method returns [rawtfr::R](rawtfr::R) reader structure"] -impl crate::Readable for RAWTFR {} -#[doc = "`write(|w| ..)` method takes [rawtfr::W](rawtfr::W) writer structure"] -impl crate::Writable for RAWTFR {} +#[doc = "RAWTFR register accessor: an alias for `Reg`"] +pub type RAWTFR = crate::Reg; #[doc = "Raw IntTfr Status"] pub mod rawtfr; -#[doc = "Raw IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawblock](rawblock) module"] -pub type RAWBLOCK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWBLOCK; -#[doc = "`read()` method returns [rawblock::R](rawblock::R) reader structure"] -impl crate::Readable for RAWBLOCK {} -#[doc = "`write(|w| ..)` method takes [rawblock::W](rawblock::W) writer structure"] -impl crate::Writable for RAWBLOCK {} +#[doc = "RAWBLOCK register accessor: an alias for `Reg`"] +pub type RAWBLOCK = crate::Reg; #[doc = "Raw IntBlock Status"] pub mod rawblock; -#[doc = "Raw IntSrcTran Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawsrctran](rawsrctran) module"] -pub type RAWSRCTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWSRCTRAN; -#[doc = "`read()` method returns [rawsrctran::R](rawsrctran::R) reader structure"] -impl crate::Readable for RAWSRCTRAN {} -#[doc = "`write(|w| ..)` method takes [rawsrctran::W](rawsrctran::W) writer structure"] -impl crate::Writable for RAWSRCTRAN {} +#[doc = "RAWSRCTRAN register accessor: an alias for `Reg`"] +pub type RAWSRCTRAN = crate::Reg; #[doc = "Raw IntSrcTran Status"] pub mod rawsrctran; -#[doc = "Raw IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawdsttran](rawdsttran) module"] -pub type RAWDSTTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWDSTTRAN; -#[doc = "`read()` method returns [rawdsttran::R](rawdsttran::R) reader structure"] -impl crate::Readable for RAWDSTTRAN {} -#[doc = "`write(|w| ..)` method takes [rawdsttran::W](rawdsttran::W) writer structure"] -impl crate::Writable for RAWDSTTRAN {} +#[doc = "RAWDSTTRAN register accessor: an alias for `Reg`"] +pub type RAWDSTTRAN = crate::Reg; #[doc = "Raw IntBlock Status"] pub mod rawdsttran; -#[doc = "Raw IntErr Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawerr](rawerr) module"] -pub type RAWERR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWERR; -#[doc = "`read()` method returns [rawerr::R](rawerr::R) reader structure"] -impl crate::Readable for RAWERR {} -#[doc = "`write(|w| ..)` method takes [rawerr::W](rawerr::W) writer structure"] -impl crate::Writable for RAWERR {} +#[doc = "RAWERR register accessor: an alias for `Reg`"] +pub type RAWERR = crate::Reg; #[doc = "Raw IntErr Status"] pub mod rawerr; -#[doc = "IntTfr Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statustfr](statustfr) module"] -pub type STATUSTFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSTFR; -#[doc = "`read()` method returns [statustfr::R](statustfr::R) reader structure"] -impl crate::Readable for STATUSTFR {} +#[doc = "STATUSTFR register accessor: an alias for `Reg`"] +pub type STATUSTFR = crate::Reg; #[doc = "IntTfr Status"] pub mod statustfr; -#[doc = "IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusblock](statusblock) module"] -pub type STATUSBLOCK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSBLOCK; -#[doc = "`read()` method returns [statusblock::R](statusblock::R) reader structure"] -impl crate::Readable for STATUSBLOCK {} +#[doc = "STATUSBLOCK register accessor: an alias for `Reg`"] +pub type STATUSBLOCK = crate::Reg; #[doc = "IntBlock Status"] pub mod statusblock; -#[doc = "IntSrcTran Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statussrctran](statussrctran) module"] -pub type STATUSSRCTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSSRCTRAN; -#[doc = "`read()` method returns [statussrctran::R](statussrctran::R) reader structure"] -impl crate::Readable for STATUSSRCTRAN {} +#[doc = "STATUSSRCTRAN register accessor: an alias for `Reg`"] +pub type STATUSSRCTRAN = crate::Reg; #[doc = "IntSrcTran Status"] pub mod statussrctran; -#[doc = "IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusdsttran](statusdsttran) module"] -pub type STATUSDSTTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSDSTTRAN; -#[doc = "`read()` method returns [statusdsttran::R](statusdsttran::R) reader structure"] -impl crate::Readable for STATUSDSTTRAN {} +#[doc = "STATUSDSTTRAN register accessor: an alias for `Reg`"] +pub type STATUSDSTTRAN = crate::Reg; #[doc = "IntBlock Status"] pub mod statusdsttran; -#[doc = "IntErr Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statuserr](statuserr) module"] -pub type STATUSERR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSERR; -#[doc = "`read()` method returns [statuserr::R](statuserr::R) reader structure"] -impl crate::Readable for STATUSERR {} +#[doc = "STATUSERR register accessor: an alias for `Reg`"] +pub type STATUSERR = crate::Reg; #[doc = "IntErr Status"] pub mod statuserr; -#[doc = "Mask for Raw IntTfr Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [masktfr](masktfr) module"] -pub type MASKTFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MASKTFR; -#[doc = "`read()` method returns [masktfr::R](masktfr::R) reader structure"] -impl crate::Readable for MASKTFR {} -#[doc = "`write(|w| ..)` method takes [masktfr::W](masktfr::W) writer structure"] -impl crate::Writable for MASKTFR {} +#[doc = "MASKTFR register accessor: an alias for `Reg`"] +pub type MASKTFR = crate::Reg; #[doc = "Mask for Raw IntTfr Status"] pub mod masktfr; -#[doc = "Mask for Raw IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maskblock](maskblock) module"] -pub type MASKBLOCK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MASKBLOCK; -#[doc = "`read()` method returns [maskblock::R](maskblock::R) reader structure"] -impl crate::Readable for MASKBLOCK {} -#[doc = "`write(|w| ..)` method takes [maskblock::W](maskblock::W) writer structure"] -impl crate::Writable for MASKBLOCK {} +#[doc = "MASKBLOCK register accessor: an alias for `Reg`"] +pub type MASKBLOCK = crate::Reg; #[doc = "Mask for Raw IntBlock Status"] pub mod maskblock; -#[doc = "Mask for Raw IntSrcTran Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [masksrctran](masksrctran) module"] -pub type MASKSRCTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MASKSRCTRAN; -#[doc = "`read()` method returns [masksrctran::R](masksrctran::R) reader structure"] -impl crate::Readable for MASKSRCTRAN {} -#[doc = "`write(|w| ..)` method takes [masksrctran::W](masksrctran::W) writer structure"] -impl crate::Writable for MASKSRCTRAN {} +#[doc = "MASKSRCTRAN register accessor: an alias for `Reg`"] +pub type MASKSRCTRAN = crate::Reg; #[doc = "Mask for Raw IntSrcTran Status"] pub mod masksrctran; -#[doc = "Mask for Raw IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maskdsttran](maskdsttran) module"] -pub type MASKDSTTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MASKDSTTRAN; -#[doc = "`read()` method returns [maskdsttran::R](maskdsttran::R) reader structure"] -impl crate::Readable for MASKDSTTRAN {} -#[doc = "`write(|w| ..)` method takes [maskdsttran::W](maskdsttran::W) writer structure"] -impl crate::Writable for MASKDSTTRAN {} +#[doc = "MASKDSTTRAN register accessor: an alias for `Reg`"] +pub type MASKDSTTRAN = crate::Reg; #[doc = "Mask for Raw IntBlock Status"] pub mod maskdsttran; -#[doc = "Mask for Raw IntErr Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maskerr](maskerr) module"] -pub type MASKERR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MASKERR; -#[doc = "`read()` method returns [maskerr::R](maskerr::R) reader structure"] -impl crate::Readable for MASKERR {} -#[doc = "`write(|w| ..)` method takes [maskerr::W](maskerr::W) writer structure"] -impl crate::Writable for MASKERR {} +#[doc = "MASKERR register accessor: an alias for `Reg`"] +pub type MASKERR = crate::Reg; #[doc = "Mask for Raw IntErr Status"] pub mod maskerr; -#[doc = "IntTfr Status\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cleartfr](cleartfr) module"] -pub type CLEARTFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLEARTFR; -#[doc = "`write(|w| ..)` method takes [cleartfr::W](cleartfr::W) writer structure"] -impl crate::Writable for CLEARTFR {} +#[doc = "CLEARTFR register accessor: an alias for `Reg`"] +pub type CLEARTFR = crate::Reg; #[doc = "IntTfr Status"] pub mod cleartfr; -#[doc = "IntBlock Status\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearblock](clearblock) module"] -pub type CLEARBLOCK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLEARBLOCK; -#[doc = "`write(|w| ..)` method takes [clearblock::W](clearblock::W) writer structure"] -impl crate::Writable for CLEARBLOCK {} +#[doc = "CLEARBLOCK register accessor: an alias for `Reg`"] +pub type CLEARBLOCK = crate::Reg; #[doc = "IntBlock Status"] pub mod clearblock; -#[doc = "IntSrcTran Status\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearsrctran](clearsrctran) module"] -pub type CLEARSRCTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLEARSRCTRAN; -#[doc = "`write(|w| ..)` method takes [clearsrctran::W](clearsrctran::W) writer structure"] -impl crate::Writable for CLEARSRCTRAN {} +#[doc = "CLEARSRCTRAN register accessor: an alias for `Reg`"] +pub type CLEARSRCTRAN = crate::Reg; #[doc = "IntSrcTran Status"] pub mod clearsrctran; -#[doc = "IntBlock Status\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cleardsttran](cleardsttran) module"] -pub type CLEARDSTTRAN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLEARDSTTRAN; -#[doc = "`write(|w| ..)` method takes [cleardsttran::W](cleardsttran::W) writer structure"] -impl crate::Writable for CLEARDSTTRAN {} +#[doc = "CLEARDSTTRAN register accessor: an alias for `Reg`"] +pub type CLEARDSTTRAN = crate::Reg; #[doc = "IntBlock Status"] pub mod cleardsttran; -#[doc = "IntErr Status\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearerr](clearerr) module"] -pub type CLEARERR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLEARERR; -#[doc = "`write(|w| ..)` method takes [clearerr::W](clearerr::W) writer structure"] -impl crate::Writable for CLEARERR {} +#[doc = "CLEARERR register accessor: an alias for `Reg`"] +pub type CLEARERR = crate::Reg; #[doc = "IntErr Status"] pub mod clearerr; -#[doc = "Combined Interrupt Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusint](statusint) module"] -pub type STATUSINT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STATUSINT; -#[doc = "`read()` method returns [statusint::R](statusint::R) reader structure"] -impl crate::Readable for STATUSINT {} +#[doc = "STATUSINT register accessor: an alias for `Reg`"] +pub type STATUSINT = crate::Reg; #[doc = "Combined Interrupt Status Register"] pub mod statusint; -#[doc = "Source Software Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [reqsrcreg](reqsrcreg) module"] -pub type REQSRCREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REQSRCREG; -#[doc = "`read()` method returns [reqsrcreg::R](reqsrcreg::R) reader structure"] -impl crate::Readable for REQSRCREG {} -#[doc = "`write(|w| ..)` method takes [reqsrcreg::W](reqsrcreg::W) writer structure"] -impl crate::Writable for REQSRCREG {} +#[doc = "REQSRCREG register accessor: an alias for `Reg`"] +pub type REQSRCREG = crate::Reg; #[doc = "Source Software Transaction Request Register"] pub mod reqsrcreg; -#[doc = "Destination Software Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [reqdstreg](reqdstreg) module"] -pub type REQDSTREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REQDSTREG; -#[doc = "`read()` method returns [reqdstreg::R](reqdstreg::R) reader structure"] -impl crate::Readable for REQDSTREG {} -#[doc = "`write(|w| ..)` method takes [reqdstreg::W](reqdstreg::W) writer structure"] -impl crate::Writable for REQDSTREG {} +#[doc = "REQDSTREG register accessor: an alias for `Reg`"] +pub type REQDSTREG = crate::Reg; #[doc = "Destination Software Transaction Request Register"] pub mod reqdstreg; -#[doc = "Single Source Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sglreqsrcreg](sglreqsrcreg) module"] -pub type SGLREQSRCREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SGLREQSRCREG; -#[doc = "`read()` method returns [sglreqsrcreg::R](sglreqsrcreg::R) reader structure"] -impl crate::Readable for SGLREQSRCREG {} -#[doc = "`write(|w| ..)` method takes [sglreqsrcreg::W](sglreqsrcreg::W) writer structure"] -impl crate::Writable for SGLREQSRCREG {} +#[doc = "SGLREQSRCREG register accessor: an alias for `Reg`"] +pub type SGLREQSRCREG = crate::Reg; #[doc = "Single Source Transaction Request Register"] pub mod sglreqsrcreg; -#[doc = "Single Destination Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sglreqdstreg](sglreqdstreg) module"] -pub type SGLREQDSTREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SGLREQDSTREG; -#[doc = "`read()` method returns [sglreqdstreg::R](sglreqdstreg::R) reader structure"] -impl crate::Readable for SGLREQDSTREG {} -#[doc = "`write(|w| ..)` method takes [sglreqdstreg::W](sglreqdstreg::W) writer structure"] -impl crate::Writable for SGLREQDSTREG {} +#[doc = "SGLREQDSTREG register accessor: an alias for `Reg`"] +pub type SGLREQDSTREG = crate::Reg; #[doc = "Single Destination Transaction Request Register"] pub mod sglreqdstreg; -#[doc = "Last Source Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lstsrcreg](lstsrcreg) module"] -pub type LSTSRCREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LSTSRCREG; -#[doc = "`read()` method returns [lstsrcreg::R](lstsrcreg::R) reader structure"] -impl crate::Readable for LSTSRCREG {} -#[doc = "`write(|w| ..)` method takes [lstsrcreg::W](lstsrcreg::W) writer structure"] -impl crate::Writable for LSTSRCREG {} +#[doc = "LSTSRCREG register accessor: an alias for `Reg`"] +pub type LSTSRCREG = crate::Reg; #[doc = "Last Source Transaction Request Register"] pub mod lstsrcreg; -#[doc = "Last Destination Transaction Request Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lstdstreg](lstdstreg) module"] -pub type LSTDSTREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LSTDSTREG; -#[doc = "`read()` method returns [lstdstreg::R](lstdstreg::R) reader structure"] -impl crate::Readable for LSTDSTREG {} -#[doc = "`write(|w| ..)` method takes [lstdstreg::W](lstdstreg::W) writer structure"] -impl crate::Writable for LSTDSTREG {} +#[doc = "LSTDSTREG register accessor: an alias for `Reg`"] +pub type LSTDSTREG = crate::Reg; #[doc = "Last Destination Transaction Request Register"] pub mod lstdstreg; -#[doc = "GPDMA Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dmacfgreg](dmacfgreg) module"] -pub type DMACFGREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DMACFGREG; -#[doc = "`read()` method returns [dmacfgreg::R](dmacfgreg::R) reader structure"] -impl crate::Readable for DMACFGREG {} -#[doc = "`write(|w| ..)` method takes [dmacfgreg::W](dmacfgreg::W) writer structure"] -impl crate::Writable for DMACFGREG {} +#[doc = "DMACFGREG register accessor: an alias for `Reg`"] +pub type DMACFGREG = crate::Reg; #[doc = "GPDMA Configuration Register"] pub mod dmacfgreg; -#[doc = "GPDMA Channel Enable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chenreg](chenreg) module"] -pub type CHENREG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CHENREG; -#[doc = "`read()` method returns [chenreg::R](chenreg::R) reader structure"] -impl crate::Readable for CHENREG {} -#[doc = "`write(|w| ..)` method takes [chenreg::W](chenreg::W) writer structure"] -impl crate::Writable for CHENREG {} +#[doc = "CHENREG register accessor: an alias for `Reg`"] +pub type CHENREG = crate::Reg; #[doc = "GPDMA Channel Enable Register"] pub mod chenreg; -#[doc = "GPDMA0 ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "GPDMA0 ID Register"] pub mod id; -#[doc = "GPDMA Component Type\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [type_](type_) module"] -pub type TYPE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TYPE; -#[doc = "`read()` method returns [type_::R](type_::R) reader structure"] -impl crate::Readable for TYPE {} +#[doc = "TYPE register accessor: an alias for `Reg`"] +pub type TYPE = crate::Reg; #[doc = "GPDMA Component Type"] pub mod type_; -#[doc = "DMA Component Version\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [version](version) module"] -pub type VERSION = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _VERSION; -#[doc = "`read()` method returns [version::R](version::R) reader structure"] -impl crate::Readable for VERSION {} +#[doc = "VERSION register accessor: an alias for `Reg`"] +pub type VERSION = crate::Reg; #[doc = "DMA Component Version"] pub mod version; diff --git a/src/gpdma0/chenreg.rs b/src/gpdma0/chenreg.rs index 08812aec..783d7b71 100644 --- a/src/gpdma0/chenreg.rs +++ b/src/gpdma0/chenreg.rs @@ -1,16 +1,40 @@ -#[doc = "Reader of register CHENREG"] -pub type R = crate::R; -#[doc = "Writer for register CHENREG"] -pub type W = crate::W; -#[doc = "Register CHENREG `reset()`'s with value 0"] -impl crate::ResetValue for super::CHENREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CHENREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHENREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Write proxy for field `WE_CH`"] +#[doc = "Field `WE_CH` writer - Channel enable write enable"] pub struct WE_CH_W<'a> { w: &'a mut W, } @@ -18,7 +42,7 @@ impl<'a> WE_CH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } @@ -37,31 +61,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CH`"] -pub type CH_R = crate::R; +#[doc = "Field `CH` reader - Enables/Disables the channel"] +pub struct CH_R(crate::FieldReader); impl CH_R { + pub(crate) fn new(bits: u8) -> Self { + CH_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CH_A::VALUE1), - 1 => Val(CH_A::VALUE2), - i => Res(i), + 0 => Some(CH_A::VALUE1), + 1 => Some(CH_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH_A::VALUE1 + **self == CH_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH_A::VALUE2 + **self == CH_A::VALUE2 + } +} +impl core::ops::Deref for CH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH`"] +#[doc = "Field `CH` writer - Enables/Disables the channel"] pub struct CH_W<'a> { w: &'a mut W, } @@ -84,7 +117,7 @@ impl<'a> CH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -106,4 +139,30 @@ impl W { pub fn ch(&mut self) -> CH_W { CH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "GPDMA Channel Enable Register\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 [chenreg](index.html) module"] +pub struct CHENREG_SPEC; +impl crate::RegisterSpec for CHENREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chenreg::R](R) reader structure"] +impl crate::Readable for CHENREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chenreg::W](W) writer structure"] +impl crate::Writable for CHENREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHENREG to value 0"] +impl crate::Resettable for CHENREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/clearblock.rs b/src/gpdma0/clearblock.rs index 968b1249..56e411cc 100644 --- a/src/gpdma0/clearblock.rs +++ b/src/gpdma0/clearblock.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLEARBLOCK"] -pub type W = crate::W; -#[doc = "Register CLEARBLOCK `reset()`'s with value 0"] -impl crate::ResetValue for super::CLEARBLOCK { - type Type = u32; +#[doc = "Register `CLEARBLOCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "IntBlock Status\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearblock](index.html) module"] +pub struct CLEARBLOCK_SPEC; +impl crate::RegisterSpec for CLEARBLOCK_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clearblock::W](W) writer structure"] +impl crate::Writable for CLEARBLOCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLEARBLOCK to value 0"] +impl crate::Resettable for CLEARBLOCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/cleardsttran.rs b/src/gpdma0/cleardsttran.rs index 74f5c3ad..563c526b 100644 --- a/src/gpdma0/cleardsttran.rs +++ b/src/gpdma0/cleardsttran.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLEARDSTTRAN"] -pub type W = crate::W; -#[doc = "Register CLEARDSTTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::CLEARDSTTRAN { - type Type = u32; +#[doc = "Register `CLEARDSTTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "IntBlock Status\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cleardsttran](index.html) module"] +pub struct CLEARDSTTRAN_SPEC; +impl crate::RegisterSpec for CLEARDSTTRAN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cleardsttran::W](W) writer structure"] +impl crate::Writable for CLEARDSTTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLEARDSTTRAN to value 0"] +impl crate::Resettable for CLEARDSTTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/clearerr.rs b/src/gpdma0/clearerr.rs index b225d6cc..5f6d0f1f 100644 --- a/src/gpdma0/clearerr.rs +++ b/src/gpdma0/clearerr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLEARERR"] -pub type W = crate::W; -#[doc = "Register CLEARERR `reset()`'s with value 0"] -impl crate::ResetValue for super::CLEARERR { - type Type = u32; +#[doc = "Register `CLEARERR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "IntErr Status\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearerr](index.html) module"] +pub struct CLEARERR_SPEC; +impl crate::RegisterSpec for CLEARERR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clearerr::W](W) writer structure"] +impl crate::Writable for CLEARERR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLEARERR to value 0"] +impl crate::Resettable for CLEARERR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/clearsrctran.rs b/src/gpdma0/clearsrctran.rs index 66438cad..c538e42f 100644 --- a/src/gpdma0/clearsrctran.rs +++ b/src/gpdma0/clearsrctran.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLEARSRCTRAN"] -pub type W = crate::W; -#[doc = "Register CLEARSRCTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::CLEARSRCTRAN { - type Type = u32; +#[doc = "Register `CLEARSRCTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "IntSrcTran Status\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clearsrctran](index.html) module"] +pub struct CLEARSRCTRAN_SPEC; +impl crate::RegisterSpec for CLEARSRCTRAN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clearsrctran::W](W) writer structure"] +impl crate::Writable for CLEARSRCTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLEARSRCTRAN to value 0"] +impl crate::Resettable for CLEARSRCTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/cleartfr.rs b/src/gpdma0/cleartfr.rs index 5b732ad7..01c3f100 100644 --- a/src/gpdma0/cleartfr.rs +++ b/src/gpdma0/cleartfr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLEARTFR"] -pub type W = crate::W; -#[doc = "Register CLEARTFR `reset()`'s with value 0"] -impl crate::ResetValue for super::CLEARTFR { - type Type = u32; +#[doc = "Register `CLEARTFR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "IntTfr Status\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cleartfr](index.html) module"] +pub struct CLEARTFR_SPEC; +impl crate::RegisterSpec for CLEARTFR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cleartfr::W](W) writer structure"] +impl crate::Writable for CLEARTFR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLEARTFR to value 0"] +impl crate::Resettable for CLEARTFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/dmacfgreg.rs b/src/gpdma0/dmacfgreg.rs index 0a600b54..3d30199f 100644 --- a/src/gpdma0/dmacfgreg.rs +++ b/src/gpdma0/dmacfgreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DMACFGREG"] -pub type R = crate::R; -#[doc = "Writer for register DMACFGREG"] -pub type W = crate::W; -#[doc = "Register DMACFGREG `reset()`'s with value 0"] -impl crate::ResetValue for super::DMACFGREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DMACFGREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DMACFGREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "GPDMA Enable bit.\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DMA_EN`"] -pub type DMA_EN_R = crate::R; +#[doc = "Field `DMA_EN` reader - GPDMA Enable bit."] +pub struct DMA_EN_R(crate::FieldReader); impl DMA_EN_R { + pub(crate) fn new(bits: bool) -> Self { + DMA_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DMA_EN_A { @@ -38,15 +65,22 @@ impl DMA_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DMA_EN_A::VALUE1 + **self == DMA_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DMA_EN_A::VALUE2 + **self == DMA_EN_A::VALUE2 + } +} +impl core::ops::Deref for DMA_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DMA_EN`"] +#[doc = "Field `DMA_EN` writer - GPDMA Enable bit."] pub struct DMA_EN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> DMA_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMA_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "GPDMA Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> DMA_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn dma_en(&mut self) -> DMA_EN_W { DMA_EN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "GPDMA Configuration Register\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 [dmacfgreg](index.html) module"] +pub struct DMACFGREG_SPEC; +impl crate::RegisterSpec for DMACFGREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dmacfgreg::R](R) reader structure"] +impl crate::Readable for DMACFGREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dmacfgreg::W](W) writer structure"] +impl crate::Writable for DMACFGREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DMACFGREG to value 0"] +impl crate::Resettable for DMACFGREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/id.rs b/src/gpdma0/id.rs index 42536a07..5f17d8e0 100644 --- a/src/gpdma0/id.rs +++ b/src/gpdma0/id.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `VALUE`"] -pub type VALUE_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `VALUE` reader - Hardcoded GPDMA Peripheral ID"] +pub struct VALUE_R(crate::FieldReader); +impl VALUE_R { + pub(crate) fn new(bits: u32) -> Self { + VALUE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VALUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Hardcoded GPDMA Peripheral ID"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { VALUE_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "GPDMA0 ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00af_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00af_c000 + } +} diff --git a/src/gpdma0/lstdstreg.rs b/src/gpdma0/lstdstreg.rs index 854c25fe..6856b16c 100644 --- a/src/gpdma0/lstdstreg.rs +++ b/src/gpdma0/lstdstreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register LSTDSTREG"] -pub type R = crate::R; -#[doc = "Writer for register LSTDSTREG"] -pub type W = crate::W; -#[doc = "Register LSTDSTREG `reset()`'s with value 0"] -impl crate::ResetValue for super::LSTDSTREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LSTDSTREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LSTDSTREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Destination last transaction request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Destination last transaction request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Destination last transaction request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Destination last transaction request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Destination last transaction request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Destination last transaction request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Destination last transaction request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Destination last transaction request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Destination last transaction request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Destination last request for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Destination last request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Destination last request for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Destination last request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Destination last request for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Destination last request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Destination last request for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Destination last request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Destination last request for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Destination last request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Destination last request for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Destination last request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Destination last request for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Destination last request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Destination last request for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Destination last request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Last Destination Transaction Request Register\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 [lstdstreg](index.html) module"] +pub struct LSTDSTREG_SPEC; +impl crate::RegisterSpec for LSTDSTREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lstdstreg::R](R) reader structure"] +impl crate::Readable for LSTDSTREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lstdstreg::W](W) writer structure"] +impl crate::Writable for LSTDSTREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LSTDSTREG to value 0"] +impl crate::Resettable for LSTDSTREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/lstsrcreg.rs b/src/gpdma0/lstsrcreg.rs index e2758ca6..037e29b1 100644 --- a/src/gpdma0/lstsrcreg.rs +++ b/src/gpdma0/lstsrcreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register LSTSRCREG"] -pub type R = crate::R; -#[doc = "Writer for register LSTSRCREG"] -pub type W = crate::W; -#[doc = "Register LSTSRCREG `reset()`'s with value 0"] -impl crate::ResetValue for super::LSTSRCREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LSTSRCREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LSTSRCREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source last transaction request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Source last transaction request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Source last transaction request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Source last transaction request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Source last transaction request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Source last transaction request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Source last transaction request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Source last transaction request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Source last transaction request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Source last request for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Source last request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Source last request for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Source last request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Source last request for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Source last request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Source last request for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Source last request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Source last request for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Source last request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Source last request for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Source last request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Source last request for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Source last request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Source last request for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Source last request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not last transaction in current block"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Last Source Transaction Request Register\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 [lstsrcreg](index.html) module"] +pub struct LSTSRCREG_SPEC; +impl crate::RegisterSpec for LSTSRCREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lstsrcreg::R](R) reader structure"] +impl crate::Readable for LSTSRCREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lstsrcreg::W](W) writer structure"] +impl crate::Writable for LSTSRCREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LSTSRCREG to value 0"] +impl crate::Resettable for LSTSRCREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/maskblock.rs b/src/gpdma0/maskblock.rs index ee163acd..41dfd51e 100644 --- a/src/gpdma0/maskblock.rs +++ b/src/gpdma0/maskblock.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MASKBLOCK"] -pub type R = crate::R; -#[doc = "Writer for register MASKBLOCK"] -pub type W = crate::W; -#[doc = "Register MASKBLOCK `reset()`'s with value 0"] -impl crate::ResetValue for super::MASKBLOCK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MASKBLOCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MASKBLOCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Mask bit for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Mask bit for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Mask bit for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Mask bit for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Mask bit for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Mask bit for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Mask bit for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Mask bit for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Mask bit for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Mask bit for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Mask bit for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Mask bit for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Mask bit for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Mask bit for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Mask bit for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Mask bit for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mask for Raw IntBlock Status\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 [maskblock](index.html) module"] +pub struct MASKBLOCK_SPEC; +impl crate::RegisterSpec for MASKBLOCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maskblock::R](R) reader structure"] +impl crate::Readable for MASKBLOCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maskblock::W](W) writer structure"] +impl crate::Writable for MASKBLOCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASKBLOCK to value 0"] +impl crate::Resettable for MASKBLOCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/maskdsttran.rs b/src/gpdma0/maskdsttran.rs index fb14676a..95c05dae 100644 --- a/src/gpdma0/maskdsttran.rs +++ b/src/gpdma0/maskdsttran.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MASKDSTTRAN"] -pub type R = crate::R; -#[doc = "Writer for register MASKDSTTRAN"] -pub type W = crate::W; -#[doc = "Register MASKDSTTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::MASKDSTTRAN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MASKDSTTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MASKDSTTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Mask bit for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Mask bit for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Mask bit for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Mask bit for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Mask bit for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Mask bit for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Mask bit for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Mask bit for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Mask bit for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Mask bit for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Mask bit for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Mask bit for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Mask bit for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Mask bit for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Mask bit for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Mask bit for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mask for Raw IntBlock Status\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 [maskdsttran](index.html) module"] +pub struct MASKDSTTRAN_SPEC; +impl crate::RegisterSpec for MASKDSTTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maskdsttran::R](R) reader structure"] +impl crate::Readable for MASKDSTTRAN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maskdsttran::W](W) writer structure"] +impl crate::Writable for MASKDSTTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASKDSTTRAN to value 0"] +impl crate::Resettable for MASKDSTTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/maskerr.rs b/src/gpdma0/maskerr.rs index 897a41fe..992b0ccd 100644 --- a/src/gpdma0/maskerr.rs +++ b/src/gpdma0/maskerr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MASKERR"] -pub type R = crate::R; -#[doc = "Writer for register MASKERR"] -pub type W = crate::W; -#[doc = "Register MASKERR `reset()`'s with value 0"] -impl crate::ResetValue for super::MASKERR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MASKERR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MASKERR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Mask bit for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Mask bit for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Mask bit for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Mask bit for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Mask bit for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Mask bit for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Mask bit for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Mask bit for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Mask bit for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Mask bit for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Mask bit for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Mask bit for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Mask bit for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Mask bit for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Mask bit for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Mask bit for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mask for Raw IntErr Status\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 [maskerr](index.html) module"] +pub struct MASKERR_SPEC; +impl crate::RegisterSpec for MASKERR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maskerr::R](R) reader structure"] +impl crate::Readable for MASKERR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maskerr::W](W) writer structure"] +impl crate::Writable for MASKERR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASKERR to value 0"] +impl crate::Resettable for MASKERR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/masksrctran.rs b/src/gpdma0/masksrctran.rs index 197e2bf8..f67b5909 100644 --- a/src/gpdma0/masksrctran.rs +++ b/src/gpdma0/masksrctran.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MASKSRCTRAN"] -pub type R = crate::R; -#[doc = "Writer for register MASKSRCTRAN"] -pub type W = crate::W; -#[doc = "Register MASKSRCTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::MASKSRCTRAN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MASKSRCTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MASKSRCTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Mask bit for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Mask bit for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Mask bit for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Mask bit for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Mask bit for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Mask bit for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Mask bit for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Mask bit for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Mask bit for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Mask bit for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Mask bit for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Mask bit for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Mask bit for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Mask bit for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Mask bit for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Mask bit for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mask for Raw IntSrcTran Status\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 [masksrctran](index.html) module"] +pub struct MASKSRCTRAN_SPEC; +impl crate::RegisterSpec for MASKSRCTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [masksrctran::R](R) reader structure"] +impl crate::Readable for MASKSRCTRAN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [masksrctran::W](W) writer structure"] +impl crate::Writable for MASKSRCTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASKSRCTRAN to value 0"] +impl crate::Resettable for MASKSRCTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/masktfr.rs b/src/gpdma0/masktfr.rs index 60edab15..11902eba 100644 --- a/src/gpdma0/masktfr.rs +++ b/src/gpdma0/masktfr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MASKTFR"] -pub type R = crate::R; -#[doc = "Writer for register MASKTFR"] -pub type W = crate::W; -#[doc = "Register MASKTFR `reset()`'s with value 0"] -impl crate::ResetValue for super::MASKTFR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MASKTFR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MASKTFR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,7 +438,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -448,9 +456,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; +#[doc = "Field `CH0` reader - Mask bit for channel 0"] +pub struct CH0_R(crate::FieldReader); impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH0_A { @@ -462,15 +473,22 @@ impl CH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH0_A::VALUE1 + **self == CH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH0_A::VALUE2 + **self == CH0_A::VALUE2 } } -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Mask bit for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -478,9 +496,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -505,7 +521,7 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -523,9 +539,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; +#[doc = "Field `CH1` reader - Mask bit for channel 1"] +pub struct CH1_R(crate::FieldReader); impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH1_A { @@ -537,15 +556,22 @@ impl CH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH1_A::VALUE1 + **self == CH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH1_A::VALUE2 + **self == CH1_A::VALUE2 } } -#[doc = "Write proxy for field `CH1`"] +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Mask bit for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -553,9 +579,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -580,7 +604,7 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -598,9 +622,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; +#[doc = "Field `CH2` reader - Mask bit for channel 2"] +pub struct CH2_R(crate::FieldReader); impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH2_A { @@ -612,15 +639,22 @@ impl CH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH2_A::VALUE1 + **self == CH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH2_A::VALUE2 + **self == CH2_A::VALUE2 + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` writer - Mask bit for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -628,9 +662,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -655,7 +687,7 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -673,9 +705,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; +#[doc = "Field `CH3` reader - Mask bit for channel 3"] +pub struct CH3_R(crate::FieldReader); impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH3_A { @@ -687,15 +722,22 @@ impl CH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH3_A::VALUE1 + **self == CH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH3_A::VALUE2 + **self == CH3_A::VALUE2 + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` writer - Mask bit for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -703,9 +745,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -730,7 +770,7 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -748,9 +788,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; +#[doc = "Field `CH4` reader - Mask bit for channel 4"] +pub struct CH4_R(crate::FieldReader); impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH4_A { @@ -762,15 +805,22 @@ impl CH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH4_A::VALUE1 + **self == CH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH4_A::VALUE2 + **self == CH4_A::VALUE2 + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` writer - Mask bit for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -778,9 +828,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -805,7 +853,7 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -823,9 +871,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; +#[doc = "Field `CH5` reader - Mask bit for channel 5"] +pub struct CH5_R(crate::FieldReader); impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH5_A { @@ -837,15 +888,22 @@ impl CH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH5_A::VALUE1 + **self == CH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH5_A::VALUE2 + **self == CH5_A::VALUE2 } } -#[doc = "Write proxy for field `CH5`"] +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Mask bit for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -853,9 +911,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -880,7 +936,7 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -898,9 +954,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; +#[doc = "Field `CH6` reader - Mask bit for channel 6"] +pub struct CH6_R(crate::FieldReader); impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH6_A { @@ -912,15 +971,22 @@ impl CH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH6_A::VALUE1 + **self == CH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH6_A::VALUE2 + **self == CH6_A::VALUE2 } } -#[doc = "Write proxy for field `CH6`"] +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Mask bit for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -928,9 +994,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -955,7 +1019,7 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -973,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Field `CH7` reader - Mask bit for channel 7"] +pub struct CH7_R(crate::FieldReader); impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH7_A { @@ -987,15 +1054,22 @@ impl CH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH7_A::VALUE1 + **self == CH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH7_A::VALUE2 + **self == CH7_A::VALUE2 } } -#[doc = "Write proxy for field `CH7`"] +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Mask bit for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -1003,9 +1077,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "masked"] #[inline(always)] @@ -1030,7 +1102,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -1157,4 +1229,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mask for Raw IntTfr Status\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 [masktfr](index.html) module"] +pub struct MASKTFR_SPEC; +impl crate::RegisterSpec for MASKTFR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [masktfr::R](R) reader structure"] +impl crate::Readable for MASKTFR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [masktfr::W](W) writer structure"] +impl crate::Writable for MASKTFR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASKTFR to value 0"] +impl crate::Resettable for MASKTFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/rawblock.rs b/src/gpdma0/rawblock.rs index 20334411..9a35b373 100644 --- a/src/gpdma0/rawblock.rs +++ b/src/gpdma0/rawblock.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RAWBLOCK"] -pub type R = crate::R; -#[doc = "Writer for register RAWBLOCK"] -pub type W = crate::W; -#[doc = "Register RAWBLOCK `reset()`'s with value 0"] -impl crate::ResetValue for super::RAWBLOCK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RAWBLOCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAWBLOCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -198,7 +318,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -285,4 +405,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Raw IntBlock Status\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 [rawblock](index.html) module"] +pub struct RAWBLOCK_SPEC; +impl crate::RegisterSpec for RAWBLOCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawblock::R](R) reader structure"] +impl crate::Readable for RAWBLOCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rawblock::W](W) writer structure"] +impl crate::Writable for RAWBLOCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAWBLOCK to value 0"] +impl crate::Resettable for RAWBLOCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/rawdsttran.rs b/src/gpdma0/rawdsttran.rs index 719f23e1..f8d85a53 100644 --- a/src/gpdma0/rawdsttran.rs +++ b/src/gpdma0/rawdsttran.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RAWDSTTRAN"] -pub type R = crate::R; -#[doc = "Writer for register RAWDSTTRAN"] -pub type W = crate::W; -#[doc = "Register RAWDSTTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::RAWDSTTRAN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RAWDSTTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAWDSTTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -198,7 +318,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -285,4 +405,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Raw IntBlock Status\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 [rawdsttran](index.html) module"] +pub struct RAWDSTTRAN_SPEC; +impl crate::RegisterSpec for RAWDSTTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawdsttran::R](R) reader structure"] +impl crate::Readable for RAWDSTTRAN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rawdsttran::W](W) writer structure"] +impl crate::Writable for RAWDSTTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAWDSTTRAN to value 0"] +impl crate::Resettable for RAWDSTTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/rawerr.rs b/src/gpdma0/rawerr.rs index 495d1a20..13d49469 100644 --- a/src/gpdma0/rawerr.rs +++ b/src/gpdma0/rawerr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RAWERR"] -pub type R = crate::R; -#[doc = "Writer for register RAWERR"] -pub type W = crate::W; -#[doc = "Register RAWERR `reset()`'s with value 0"] -impl crate::ResetValue for super::RAWERR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RAWERR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAWERR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -198,7 +318,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -285,4 +405,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Raw IntErr Status\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 [rawerr](index.html) module"] +pub struct RAWERR_SPEC; +impl crate::RegisterSpec for RAWERR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawerr::R](R) reader structure"] +impl crate::Readable for RAWERR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rawerr::W](W) writer structure"] +impl crate::Writable for RAWERR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAWERR to value 0"] +impl crate::Resettable for RAWERR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/rawsrctran.rs b/src/gpdma0/rawsrctran.rs index 8c57f851..0950d64b 100644 --- a/src/gpdma0/rawsrctran.rs +++ b/src/gpdma0/rawsrctran.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RAWSRCTRAN"] -pub type R = crate::R; -#[doc = "Writer for register RAWSRCTRAN"] -pub type W = crate::W; -#[doc = "Register RAWSRCTRAN `reset()`'s with value 0"] -impl crate::ResetValue for super::RAWSRCTRAN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RAWSRCTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAWSRCTRAN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -198,7 +318,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -285,4 +405,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Raw IntSrcTran Status\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 [rawsrctran](index.html) module"] +pub struct RAWSRCTRAN_SPEC; +impl crate::RegisterSpec for RAWSRCTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawsrctran::R](R) reader structure"] +impl crate::Readable for RAWSRCTRAN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rawsrctran::W](W) writer structure"] +impl crate::Writable for RAWSRCTRAN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAWSRCTRAN to value 0"] +impl crate::Resettable for RAWSRCTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/rawtfr.rs b/src/gpdma0/rawtfr.rs index 74cd1208..68e3511b 100644 --- a/src/gpdma0/rawtfr.rs +++ b/src/gpdma0/rawtfr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RAWTFR"] -pub type R = crate::R; -#[doc = "Writer for register RAWTFR"] -pub type W = crate::W; -#[doc = "Register RAWTFR `reset()`'s with value 0"] -impl crate::ResetValue for super::RAWTFR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RAWTFR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAWTFR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -198,7 +318,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -285,4 +405,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Raw IntTfr Status\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 [rawtfr](index.html) module"] +pub struct RAWTFR_SPEC; +impl crate::RegisterSpec for RAWTFR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawtfr::R](R) reader structure"] +impl crate::Readable for RAWTFR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rawtfr::W](W) writer structure"] +impl crate::Writable for RAWTFR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAWTFR to value 0"] +impl crate::Resettable for RAWTFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/reqdstreg.rs b/src/gpdma0/reqdstreg.rs index 602f2e57..62af4547 100644 --- a/src/gpdma0/reqdstreg.rs +++ b/src/gpdma0/reqdstreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register REQDSTREG"] -pub type R = crate::R; -#[doc = "Writer for register REQDSTREG"] -pub type W = crate::W; -#[doc = "Register REQDSTREG `reset()`'s with value 0"] -impl crate::ResetValue for super::REQDSTREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `REQDSTREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REQDSTREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,13 +438,25 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` reader - Source request for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Source request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -454,13 +474,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Source request for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Source request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -478,13 +510,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Source request for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Source request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -502,13 +546,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Source request for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Source request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -526,13 +582,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Source request for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Source request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -550,13 +618,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Source request for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Source request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -574,13 +654,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Source request for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Source request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -598,13 +690,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Source request for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Source request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -622,7 +726,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -749,4 +853,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Software Transaction Request Register\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 [reqdstreg](index.html) module"] +pub struct REQDSTREG_SPEC; +impl crate::RegisterSpec for REQDSTREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [reqdstreg::R](R) reader structure"] +impl crate::Readable for REQDSTREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [reqdstreg::W](W) writer structure"] +impl crate::Writable for REQDSTREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REQDSTREG to value 0"] +impl crate::Resettable for REQDSTREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/reqsrcreg.rs b/src/gpdma0/reqsrcreg.rs index 1720c624..aaf9ca16 100644 --- a/src/gpdma0/reqsrcreg.rs +++ b/src/gpdma0/reqsrcreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register REQSRCREG"] -pub type R = crate::R; -#[doc = "Writer for register REQSRCREG"] -pub type W = crate::W; -#[doc = "Register REQSRCREG `reset()`'s with value 0"] -impl crate::ResetValue for super::REQSRCREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `REQSRCREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REQSRCREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,13 +438,25 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` reader - Source request for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Source request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -454,13 +474,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Source request for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Source request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -478,13 +510,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Source request for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Source request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -502,13 +546,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Source request for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Source request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -526,13 +582,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Source request for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Source request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -550,13 +618,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Source request for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Source request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -574,13 +654,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Source request for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Source request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -598,13 +690,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Source request for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Source request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -622,7 +726,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -749,4 +853,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Software Transaction Request Register\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 [reqsrcreg](index.html) module"] +pub struct REQSRCREG_SPEC; +impl crate::RegisterSpec for REQSRCREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [reqsrcreg::R](R) reader structure"] +impl crate::Readable for REQSRCREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [reqsrcreg::W](W) writer structure"] +impl crate::Writable for REQSRCREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REQSRCREG to value 0"] +impl crate::Resettable for REQSRCREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/sglreqdstreg.rs b/src/gpdma0/sglreqdstreg.rs index e24c8c0c..1308f315 100644 --- a/src/gpdma0/sglreqdstreg.rs +++ b/src/gpdma0/sglreqdstreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SGLREQDSTREG"] -pub type R = crate::R; -#[doc = "Writer for register SGLREQDSTREG"] -pub type W = crate::W; -#[doc = "Register SGLREQDSTREG `reset()`'s with value 0"] -impl crate::ResetValue for super::SGLREQDSTREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SGLREQDSTREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SGLREQDSTREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,13 +438,25 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` reader - Source request for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Source request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -454,13 +474,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Source request for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Source request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -478,13 +510,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Source request for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Source request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -502,13 +546,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Source request for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Source request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -526,13 +582,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Source request for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Source request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -550,13 +618,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Source request for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Source request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -574,13 +654,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Source request for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Source request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -598,13 +690,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Source request for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Source request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -622,7 +726,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -749,4 +853,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Single Destination Transaction Request Register\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 [sglreqdstreg](index.html) module"] +pub struct SGLREQDSTREG_SPEC; +impl crate::RegisterSpec for SGLREQDSTREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sglreqdstreg::R](R) reader structure"] +impl crate::Readable for SGLREQDSTREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sglreqdstreg::W](W) writer structure"] +impl crate::Writable for SGLREQDSTREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SGLREQDSTREG to value 0"] +impl crate::Resettable for SGLREQDSTREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/sglreqsrcreg.rs b/src/gpdma0/sglreqsrcreg.rs index 11d4a2b7..a8a012a0 100644 --- a/src/gpdma0/sglreqsrcreg.rs +++ b/src/gpdma0/sglreqsrcreg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SGLREQSRCREG"] -pub type R = crate::R; -#[doc = "Writer for register SGLREQSRCREG"] -pub type W = crate::W; -#[doc = "Register SGLREQSRCREG `reset()`'s with value 0"] -impl crate::ResetValue for super::SGLREQSRCREG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SGLREQSRCREG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SGLREQSRCREG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] @@ -24,7 +48,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH0`"] +#[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] pub struct WE_CH0_W<'a> { w: &'a mut W, } @@ -32,9 +56,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -59,7 +81,7 @@ impl<'a> WE_CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -77,7 +99,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH1`"] +#[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] pub struct WE_CH1_W<'a> { w: &'a mut W, } @@ -85,9 +107,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -112,7 +132,7 @@ impl<'a> WE_CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -130,7 +150,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH2`"] +#[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] pub struct WE_CH2_W<'a> { w: &'a mut W, } @@ -138,9 +158,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -165,7 +183,7 @@ impl<'a> WE_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,7 +201,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH3`"] +#[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] pub struct WE_CH3_W<'a> { w: &'a mut W, } @@ -191,9 +209,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -218,7 +234,7 @@ impl<'a> WE_CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -236,7 +252,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH4`"] +#[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] pub struct WE_CH4_W<'a> { w: &'a mut W, } @@ -244,9 +260,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -271,7 +285,7 @@ impl<'a> WE_CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -289,7 +303,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH5`"] +#[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] pub struct WE_CH5_W<'a> { w: &'a mut W, } @@ -297,9 +311,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -324,7 +336,7 @@ impl<'a> WE_CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -342,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH6`"] +#[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] pub struct WE_CH6_W<'a> { w: &'a mut W, } @@ -350,9 +362,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -377,7 +387,7 @@ impl<'a> WE_CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -395,7 +405,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WE_CH7`"] +#[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] pub struct WE_CH7_W<'a> { w: &'a mut W, } @@ -403,9 +413,7 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WE_CH7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "write disabled"] #[inline(always)] @@ -430,13 +438,25 @@ impl<'a> WE_CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Write proxy for field `CH0`"] +#[doc = "Field `CH0` reader - Source request for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Source request for channel 0"] pub struct CH0_W<'a> { w: &'a mut W, } @@ -454,13 +474,25 @@ impl<'a> CH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Write proxy for field `CH1`"] +#[doc = "Field `CH1` reader - Source request for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Source request for channel 1"] pub struct CH1_W<'a> { w: &'a mut W, } @@ -478,13 +510,25 @@ impl<'a> CH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Write proxy for field `CH2`"] +#[doc = "Field `CH2` reader - Source request for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Source request for channel 2"] pub struct CH2_W<'a> { w: &'a mut W, } @@ -502,13 +546,25 @@ impl<'a> CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Write proxy for field `CH3`"] +#[doc = "Field `CH3` reader - Source request for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Source request for channel 3"] pub struct CH3_W<'a> { w: &'a mut W, } @@ -526,13 +582,25 @@ impl<'a> CH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Write proxy for field `CH4`"] +#[doc = "Field `CH4` reader - Source request for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Source request for channel 4"] pub struct CH4_W<'a> { w: &'a mut W, } @@ -550,13 +618,25 @@ impl<'a> CH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Write proxy for field `CH5`"] +#[doc = "Field `CH5` reader - Source request for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Source request for channel 5"] pub struct CH5_W<'a> { w: &'a mut W, } @@ -574,13 +654,25 @@ impl<'a> CH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Write proxy for field `CH6`"] +#[doc = "Field `CH6` reader - Source request for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Source request for channel 6"] pub struct CH6_W<'a> { w: &'a mut W, } @@ -598,13 +690,25 @@ impl<'a> CH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; -#[doc = "Write proxy for field `CH7`"] +#[doc = "Field `CH7` reader - Source request for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Source request for channel 7"] pub struct CH7_W<'a> { w: &'a mut W, } @@ -622,7 +726,7 @@ impl<'a> CH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -749,4 +853,30 @@ impl W { pub fn ch7(&mut self) -> CH7_W { CH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Single Source Transaction Request Register\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 [sglreqsrcreg](index.html) module"] +pub struct SGLREQSRCREG_SPEC; +impl crate::RegisterSpec for SGLREQSRCREG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sglreqsrcreg::R](R) reader structure"] +impl crate::Readable for SGLREQSRCREG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sglreqsrcreg::W](W) writer structure"] +impl crate::Writable for SGLREQSRCREG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SGLREQSRCREG to value 0"] +impl crate::Resettable for SGLREQSRCREG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0/statusblock.rs b/src/gpdma0/statusblock.rs index 4d22b789..fefdd23b 100644 --- a/src/gpdma0/statusblock.rs +++ b/src/gpdma0/statusblock.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register STATUSBLOCK"] -pub type R = crate::R; -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Register `STATUSBLOCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CH0` reader - Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` reader - Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` reader - Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` reader - Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` reader - Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` reader - Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` reader - Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` reader - Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { CH7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusblock](index.html) module"] +pub struct STATUSBLOCK_SPEC; +impl crate::RegisterSpec for STATUSBLOCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statusblock::R](R) reader structure"] +impl crate::Readable for STATUSBLOCK_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSBLOCK to value 0"] +impl crate::Resettable for STATUSBLOCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/statusdsttran.rs b/src/gpdma0/statusdsttran.rs index aeaca0f2..2c628b0f 100644 --- a/src/gpdma0/statusdsttran.rs +++ b/src/gpdma0/statusdsttran.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register STATUSDSTTRAN"] -pub type R = crate::R; -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Register `STATUSDSTTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CH0` reader - Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` reader - Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` reader - Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` reader - Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` reader - Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` reader - Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` reader - Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` reader - Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { CH7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "IntBlock Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusdsttran](index.html) module"] +pub struct STATUSDSTTRAN_SPEC; +impl crate::RegisterSpec for STATUSDSTTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statusdsttran::R](R) reader structure"] +impl crate::Readable for STATUSDSTTRAN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSDSTTRAN to value 0"] +impl crate::Resettable for STATUSDSTTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/statuserr.rs b/src/gpdma0/statuserr.rs index 429a74cb..7326acc1 100644 --- a/src/gpdma0/statuserr.rs +++ b/src/gpdma0/statuserr.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register STATUSERR"] -pub type R = crate::R; -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Register `STATUSERR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CH0` reader - Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` reader - Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` reader - Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` reader - Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` reader - Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` reader - Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` reader - Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` reader - Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { CH7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "IntErr Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statuserr](index.html) module"] +pub struct STATUSERR_SPEC; +impl crate::RegisterSpec for STATUSERR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statuserr::R](R) reader structure"] +impl crate::Readable for STATUSERR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSERR to value 0"] +impl crate::Resettable for STATUSERR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/statusint.rs b/src/gpdma0/statusint.rs index a133be74..49426779 100644 --- a/src/gpdma0/statusint.rs +++ b/src/gpdma0/statusint.rs @@ -1,15 +1,88 @@ -#[doc = "Reader of register STATUSINT"] -pub type R = crate::R; -#[doc = "Reader of field `ERR`"] -pub type ERR_R = crate::R; -#[doc = "Reader of field `DSTT`"] -pub type DSTT_R = crate::R; -#[doc = "Reader of field `SRCT`"] -pub type SRCT_R = crate::R; -#[doc = "Reader of field `BLOCK`"] -pub type BLOCK_R = crate::R; -#[doc = "Reader of field `TFR`"] -pub type TFR_R = crate::R; +#[doc = "Register `STATUSINT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ERR` reader - OR of the contents of STATUSERR register"] +pub struct ERR_R(crate::FieldReader); +impl ERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSTT` reader - OR of the contents of STATUSDSTTRAN register"] +pub struct DSTT_R(crate::FieldReader); +impl DSTT_R { + pub(crate) fn new(bits: bool) -> Self { + DSTT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSTT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRCT` reader - OR of the contents of STATUSSRCTRAN register"] +pub struct SRCT_R(crate::FieldReader); +impl SRCT_R { + pub(crate) fn new(bits: bool) -> Self { + SRCT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRCT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLOCK` reader - OR of the contents of STATUSBLOCK register"] +pub struct BLOCK_R(crate::FieldReader); +impl BLOCK_R { + pub(crate) fn new(bits: bool) -> Self { + BLOCK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLOCK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TFR` reader - OR of the contents of STATUSTFR register"] +pub struct TFR_R(crate::FieldReader); +impl TFR_R { + pub(crate) fn new(bits: bool) -> Self { + TFR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TFR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 4 - OR of the contents of STATUSERR register"] #[inline(always)] @@ -37,3 +110,19 @@ impl R { TFR_R::new((self.bits & 0x01) != 0) } } +#[doc = "Combined Interrupt Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statusint](index.html) module"] +pub struct STATUSINT_SPEC; +impl crate::RegisterSpec for STATUSINT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statusint::R](R) reader structure"] +impl crate::Readable for STATUSINT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSINT to value 0"] +impl crate::Resettable for STATUSINT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/statussrctran.rs b/src/gpdma0/statussrctran.rs index cdeb0f06..a893098e 100644 --- a/src/gpdma0/statussrctran.rs +++ b/src/gpdma0/statussrctran.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register STATUSSRCTRAN"] -pub type R = crate::R; -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Register `STATUSSRCTRAN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CH0` reader - Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` reader - Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` reader - Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` reader - Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` reader - Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` reader - Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` reader - Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` reader - Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { CH7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "IntSrcTran Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statussrctran](index.html) module"] +pub struct STATUSSRCTRAN_SPEC; +impl crate::RegisterSpec for STATUSSRCTRAN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statussrctran::R](R) reader structure"] +impl crate::Readable for STATUSSRCTRAN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSSRCTRAN to value 0"] +impl crate::Resettable for STATUSSRCTRAN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/statustfr.rs b/src/gpdma0/statustfr.rs index c021c6ae..571816d6 100644 --- a/src/gpdma0/statustfr.rs +++ b/src/gpdma0/statustfr.rs @@ -1,21 +1,130 @@ -#[doc = "Reader of register STATUSTFR"] -pub type R = crate::R; -#[doc = "Reader of field `CH0`"] -pub type CH0_R = crate::R; -#[doc = "Reader of field `CH1`"] -pub type CH1_R = crate::R; -#[doc = "Reader of field `CH2`"] -pub type CH2_R = crate::R; -#[doc = "Reader of field `CH3`"] -pub type CH3_R = crate::R; -#[doc = "Reader of field `CH4`"] -pub type CH4_R = crate::R; -#[doc = "Reader of field `CH5`"] -pub type CH5_R = crate::R; -#[doc = "Reader of field `CH6`"] -pub type CH6_R = crate::R; -#[doc = "Reader of field `CH7`"] -pub type CH7_R = crate::R; +#[doc = "Register `STATUSTFR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CH0` reader - Interrupt Status for channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` reader - Interrupt Status for channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` reader - Interrupt Status for channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` reader - Interrupt Status for channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` reader - Interrupt Status for channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` reader - Interrupt Status for channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` reader - Interrupt Status for channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` reader - Interrupt Status for channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -58,3 +167,19 @@ impl R { CH7_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "IntTfr Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [statustfr](index.html) module"] +pub struct STATUSTFR_SPEC; +impl crate::RegisterSpec for STATUSTFR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [statustfr::R](R) reader structure"] +impl crate::Readable for STATUSTFR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUSTFR to value 0"] +impl crate::Resettable for STATUSTFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpdma0/type_.rs b/src/gpdma0/type_.rs index c793cfac..b67b3421 100644 --- a/src/gpdma0/type_.rs +++ b/src/gpdma0/type_.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register TYPE"] -pub type R = crate::R; -#[doc = "Reader of field `VALUE`"] -pub type VALUE_R = crate::R; +#[doc = "Register `TYPE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `VALUE` reader - Component Type"] +pub struct VALUE_R(crate::FieldReader); +impl VALUE_R { + pub(crate) fn new(bits: u32) -> Self { + VALUE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VALUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Component Type"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { VALUE_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "GPDMA Component Type\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [type_](index.html) module"] +pub struct TYPE_SPEC; +impl crate::RegisterSpec for TYPE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [type_::R](R) reader structure"] +impl crate::Readable for TYPE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TYPE to value 0x4457_1110"] +impl crate::Resettable for TYPE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x4457_1110 + } +} diff --git a/src/gpdma0/version.rs b/src/gpdma0/version.rs index 94fbdfcc..df0ffac3 100644 --- a/src/gpdma0/version.rs +++ b/src/gpdma0/version.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register VERSION"] -pub type R = crate::R; -#[doc = "Reader of field `VALUE`"] -pub type VALUE_R = crate::R; +#[doc = "Register `VERSION` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `VALUE` reader - Version number of the component"] +pub struct VALUE_R(crate::FieldReader); +impl VALUE_R { + pub(crate) fn new(bits: u32) -> Self { + VALUE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VALUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Version number of the component"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { VALUE_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "DMA Component Version\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [version](index.html) module"] +pub struct VERSION_SPEC; +impl crate::RegisterSpec for VERSION_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [version::R](R) reader structure"] +impl crate::Readable for VERSION_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets VERSION to value 0x3231_342a"] +impl crate::Resettable for VERSION_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3231_342a + } +} diff --git a/src/gpdma0_ch0.rs b/src/gpdma0_ch0.rs index 5496a75b..a1c268e9 100644 --- a/src/gpdma0_ch0.rs +++ b/src/gpdma0_ch0.rs @@ -2,180 +2,89 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Source Address Register"] - pub sar: SAR, - _reserved1: [u8; 4usize], + pub sar: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Destination Address Register"] - pub dar: DAR, - _reserved2: [u8; 4usize], + pub dar: crate::Reg, + _reserved2: [u8; 0x04], #[doc = "0x10 - Linked List Pointer Register"] - pub llp: LLP, - _reserved3: [u8; 4usize], + pub llp: crate::Reg, + _reserved3: [u8; 0x04], #[doc = "0x18 - Control Register Low"] - pub ctll: CTLL, + pub ctll: crate::Reg, #[doc = "0x1c - Control Register High"] - pub ctlh: CTLH, + pub ctlh: crate::Reg, #[doc = "0x20 - Source Status Register"] - pub sstat: SSTAT, - _reserved6: [u8; 4usize], + pub sstat: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0x28 - Destination Status Register"] - pub dstat: DSTAT, - _reserved7: [u8; 4usize], + pub dstat: crate::Reg, + _reserved7: [u8; 0x04], #[doc = "0x30 - Source Status Address Register"] - pub sstatar: SSTATAR, - _reserved8: [u8; 4usize], + pub sstatar: crate::Reg, + _reserved8: [u8; 0x04], #[doc = "0x38 - Destination Status Address Register"] - pub dstatar: DSTATAR, - _reserved9: [u8; 4usize], + pub dstatar: crate::Reg, + _reserved9: [u8; 0x04], #[doc = "0x40 - Configuration Register Low"] - pub cfgl: CFGL, + pub cfgl: crate::Reg, #[doc = "0x44 - Configuration Register High"] - pub cfgh: CFGH, + pub cfgh: crate::Reg, #[doc = "0x48 - Source Gather Register"] - pub sgr: SGR, - _reserved12: [u8; 4usize], + pub sgr: crate::Reg, + _reserved12: [u8; 0x04], #[doc = "0x50 - Destination Scatter Register"] - pub dsr: DSR, + pub dsr: crate::Reg, } -#[doc = "Source Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sar](sar) module"] -pub type SAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SAR; -#[doc = "`read()` method returns [sar::R](sar::R) reader structure"] -impl crate::Readable for SAR {} -#[doc = "`write(|w| ..)` method takes [sar::W](sar::W) writer structure"] -impl crate::Writable for SAR {} +#[doc = "SAR register accessor: an alias for `Reg`"] +pub type SAR = crate::Reg; #[doc = "Source Address Register"] pub mod sar; -#[doc = "Destination Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dar](dar) module"] -pub type DAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAR; -#[doc = "`read()` method returns [dar::R](dar::R) reader structure"] -impl crate::Readable for DAR {} -#[doc = "`write(|w| ..)` method takes [dar::W](dar::W) writer structure"] -impl crate::Writable for DAR {} +#[doc = "DAR register accessor: an alias for `Reg`"] +pub type DAR = crate::Reg; #[doc = "Destination Address Register"] pub mod dar; -#[doc = "Linked List Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [llp](llp) module"] -pub type LLP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LLP; -#[doc = "`read()` method returns [llp::R](llp::R) reader structure"] -impl crate::Readable for LLP {} -#[doc = "`write(|w| ..)` method takes [llp::W](llp::W) writer structure"] -impl crate::Writable for LLP {} +#[doc = "LLP register accessor: an alias for `Reg`"] +pub type LLP = crate::Reg; #[doc = "Linked List Pointer Register"] pub mod llp; -#[doc = "Control Register Low\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctll](ctll) module"] -pub type CTLL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTLL; -#[doc = "`read()` method returns [ctll::R](ctll::R) reader structure"] -impl crate::Readable for CTLL {} -#[doc = "`write(|w| ..)` method takes [ctll::W](ctll::W) writer structure"] -impl crate::Writable for CTLL {} +#[doc = "CTLL register accessor: an alias for `Reg`"] +pub type CTLL = crate::Reg; #[doc = "Control Register Low"] pub mod ctll; -#[doc = "Control Register High\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctlh](ctlh) module"] -pub type CTLH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTLH; -#[doc = "`read()` method returns [ctlh::R](ctlh::R) reader structure"] -impl crate::Readable for CTLH {} -#[doc = "`write(|w| ..)` method takes [ctlh::W](ctlh::W) writer structure"] -impl crate::Writable for CTLH {} +#[doc = "CTLH register accessor: an alias for `Reg`"] +pub type CTLH = crate::Reg; #[doc = "Control Register High"] pub mod ctlh; -#[doc = "Source Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sstat](sstat) module"] -pub type SSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SSTAT; -#[doc = "`read()` method returns [sstat::R](sstat::R) reader structure"] -impl crate::Readable for SSTAT {} -#[doc = "`write(|w| ..)` method takes [sstat::W](sstat::W) writer structure"] -impl crate::Writable for SSTAT {} +#[doc = "SSTAT register accessor: an alias for `Reg`"] +pub type SSTAT = crate::Reg; #[doc = "Source Status Register"] pub mod sstat; -#[doc = "Destination Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dstat](dstat) module"] -pub type DSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSTAT; -#[doc = "`read()` method returns [dstat::R](dstat::R) reader structure"] -impl crate::Readable for DSTAT {} -#[doc = "`write(|w| ..)` method takes [dstat::W](dstat::W) writer structure"] -impl crate::Writable for DSTAT {} +#[doc = "DSTAT register accessor: an alias for `Reg`"] +pub type DSTAT = crate::Reg; #[doc = "Destination Status Register"] pub mod dstat; -#[doc = "Source Status Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sstatar](sstatar) module"] -pub type SSTATAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SSTATAR; -#[doc = "`read()` method returns [sstatar::R](sstatar::R) reader structure"] -impl crate::Readable for SSTATAR {} -#[doc = "`write(|w| ..)` method takes [sstatar::W](sstatar::W) writer structure"] -impl crate::Writable for SSTATAR {} +#[doc = "SSTATAR register accessor: an alias for `Reg`"] +pub type SSTATAR = crate::Reg; #[doc = "Source Status Address Register"] pub mod sstatar; -#[doc = "Destination Status Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dstatar](dstatar) module"] -pub type DSTATAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSTATAR; -#[doc = "`read()` method returns [dstatar::R](dstatar::R) reader structure"] -impl crate::Readable for DSTATAR {} -#[doc = "`write(|w| ..)` method takes [dstatar::W](dstatar::W) writer structure"] -impl crate::Writable for DSTATAR {} +#[doc = "DSTATAR register accessor: an alias for `Reg`"] +pub type DSTATAR = crate::Reg; #[doc = "Destination Status Address Register"] pub mod dstatar; -#[doc = "Configuration Register Low\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cfgl](cfgl) module"] -pub type CFGL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFGL; -#[doc = "`read()` method returns [cfgl::R](cfgl::R) reader structure"] -impl crate::Readable for CFGL {} -#[doc = "`write(|w| ..)` method takes [cfgl::W](cfgl::W) writer structure"] -impl crate::Writable for CFGL {} +#[doc = "CFGL register accessor: an alias for `Reg`"] +pub type CFGL = crate::Reg; #[doc = "Configuration Register Low"] pub mod cfgl; -#[doc = "Configuration Register High\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cfgh](cfgh) module"] -pub type CFGH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFGH; -#[doc = "`read()` method returns [cfgh::R](cfgh::R) reader structure"] -impl crate::Readable for CFGH {} -#[doc = "`write(|w| ..)` method takes [cfgh::W](cfgh::W) writer structure"] -impl crate::Writable for CFGH {} +#[doc = "CFGH register accessor: an alias for `Reg`"] +pub type CFGH = crate::Reg; #[doc = "Configuration Register High"] pub mod cfgh; -#[doc = "Source Gather Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sgr](sgr) module"] -pub type SGR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SGR; -#[doc = "`read()` method returns [sgr::R](sgr::R) reader structure"] -impl crate::Readable for SGR {} -#[doc = "`write(|w| ..)` method takes [sgr::W](sgr::W) writer structure"] -impl crate::Writable for SGR {} +#[doc = "SGR register accessor: an alias for `Reg`"] +pub type SGR = crate::Reg; #[doc = "Source Gather Register"] pub mod sgr; -#[doc = "Destination Scatter Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsr](dsr) module"] -pub type DSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSR; -#[doc = "`read()` method returns [dsr::R](dsr::R) reader structure"] -impl crate::Readable for DSR {} -#[doc = "`write(|w| ..)` method takes [dsr::W](dsr::W) writer structure"] -impl crate::Writable for DSR {} +#[doc = "DSR register accessor: an alias for `Reg`"] +pub type DSR = crate::Reg; #[doc = "Destination Scatter Register"] pub mod dsr; diff --git a/src/gpdma0_ch0/cfgh.rs b/src/gpdma0_ch0/cfgh.rs index 469120d2..29329603 100644 --- a/src/gpdma0_ch0/cfgh.rs +++ b/src/gpdma0_ch0/cfgh.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CFGH"] -pub type R = crate::R; -#[doc = "Writer for register CFGH"] -pub type W = crate::W; -#[doc = "Register CFGH `reset()`'s with value 0x04"] -impl crate::ResetValue for super::CFGH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x04 +#[doc = "Register `CFGH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFGH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DEST_PER`"] -pub type DEST_PER_R = crate::R; -#[doc = "Write proxy for field `DEST_PER`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DEST_PER` reader - Destination Peripheral"] +pub struct DEST_PER_R(crate::FieldReader); +impl DEST_PER_R { + pub(crate) fn new(bits: u8) -> Self { + DEST_PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEST_PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DEST_PER` writer - Destination Peripheral"] pub struct DEST_PER_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DEST_PER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 11)) | (((value as u32) & 0x0f) << 11); + self.w.bits = (self.w.bits & !(0x0f << 11)) | ((value as u32 & 0x0f) << 11); self.w } } -#[doc = "Reader of field `SRC_PER`"] -pub type SRC_PER_R = crate::R; -#[doc = "Write proxy for field `SRC_PER`"] +#[doc = "Field `SRC_PER` reader - Source Peripheral"] +pub struct SRC_PER_R(crate::FieldReader); +impl SRC_PER_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_PER` writer - Source Peripheral"] pub struct SRC_PER_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> SRC_PER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 7)) | (((value as u32) & 0x0f) << 7); + self.w.bits = (self.w.bits & !(0x0f << 7)) | ((value as u32 & 0x0f) << 7); self.w } } -#[doc = "Reader of field `SS_UPD_EN`"] -pub type SS_UPD_EN_R = crate::R; -#[doc = "Write proxy for field `SS_UPD_EN`"] +#[doc = "Field `SS_UPD_EN` reader - Source Status Update Enable"] +pub struct SS_UPD_EN_R(crate::FieldReader); +impl SS_UPD_EN_R { + pub(crate) fn new(bits: bool) -> Self { + SS_UPD_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SS_UPD_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SS_UPD_EN` writer - Source Status Update Enable"] pub struct SS_UPD_EN_W<'a> { w: &'a mut W, } @@ -58,13 +118,25 @@ impl<'a> SS_UPD_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `DS_UPD_EN`"] -pub type DS_UPD_EN_R = crate::R; -#[doc = "Write proxy for field `DS_UPD_EN`"] +#[doc = "Field `DS_UPD_EN` reader - Destination Status Update Enable"] +pub struct DS_UPD_EN_R(crate::FieldReader); +impl DS_UPD_EN_R { + pub(crate) fn new(bits: bool) -> Self { + DS_UPD_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DS_UPD_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DS_UPD_EN` writer - Destination Status Update Enable"] pub struct DS_UPD_EN_W<'a> { w: &'a mut W, } @@ -82,13 +154,25 @@ impl<'a> DS_UPD_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `PROTCTL`"] -pub type PROTCTL_R = crate::R; -#[doc = "Write proxy for field `PROTCTL`"] +#[doc = "Field `PROTCTL` reader - Protection Control"] +pub struct PROTCTL_R(crate::FieldReader); +impl PROTCTL_R { + pub(crate) fn new(bits: u8) -> Self { + PROTCTL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PROTCTL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PROTCTL` writer - Protection Control"] pub struct PROTCTL_W<'a> { w: &'a mut W, } @@ -96,7 +180,7 @@ impl<'a> PROTCTL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 2)) | (((value as u32) & 0x07) << 2); + self.w.bits = (self.w.bits & !(0x07 << 2)) | ((value as u32 & 0x07) << 2); self.w } } @@ -114,9 +198,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFO_MODE`"] -pub type FIFO_MODE_R = crate::R; +#[doc = "Field `FIFO_MODE` reader - FIFO Mode Select"] +pub struct FIFO_MODE_R(crate::FieldReader); impl FIFO_MODE_R { + pub(crate) fn new(bits: bool) -> Self { + FIFO_MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFO_MODE_A { @@ -128,15 +215,22 @@ impl FIFO_MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFO_MODE_A::VALUE1 + **self == FIFO_MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFO_MODE_A::VALUE2 + **self == FIFO_MODE_A::VALUE2 } } -#[doc = "Write proxy for field `FIFO_MODE`"] +impl core::ops::Deref for FIFO_MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIFO_MODE` writer - FIFO Mode Select"] pub struct FIFO_MODE_W<'a> { w: &'a mut W, } @@ -144,9 +238,7 @@ impl<'a> FIFO_MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FIFO_MODE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] @@ -171,7 +263,7 @@ impl<'a> FIFO_MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -189,9 +281,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCMODE`"] -pub type FCMODE_R = crate::R; +#[doc = "Field `FCMODE` reader - Flow Control Mode"] +pub struct FCMODE_R(crate::FieldReader); impl FCMODE_R { + pub(crate) fn new(bits: bool) -> Self { + FCMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCMODE_A { @@ -203,15 +298,22 @@ impl FCMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCMODE_A::VALUE1 + **self == FCMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCMODE_A::VALUE2 + **self == FCMODE_A::VALUE2 + } +} +impl core::ops::Deref for FCMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FCMODE`"] +#[doc = "Field `FCMODE` writer - Flow Control Mode"] pub struct FCMODE_W<'a> { w: &'a mut W, } @@ -219,9 +321,7 @@ impl<'a> FCMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCMODE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] @@ -246,7 +346,7 @@ impl<'a> FCMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -323,4 +423,30 @@ impl W { pub fn fcmode(&mut self) -> FCMODE_W { FCMODE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration Register High\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 [cfgh](index.html) module"] +pub struct CFGH_SPEC; +impl crate::RegisterSpec for CFGH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfgh::R](R) reader structure"] +impl crate::Readable for CFGH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfgh::W](W) writer structure"] +impl crate::Writable for CFGH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFGH to value 0x04"] +impl crate::Resettable for CFGH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } } diff --git a/src/gpdma0_ch0/cfgl.rs b/src/gpdma0_ch0/cfgl.rs index 9aa466db..97e648ee 100644 --- a/src/gpdma0_ch0/cfgl.rs +++ b/src/gpdma0_ch0/cfgl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CFGL"] -pub type R = crate::R; -#[doc = "Writer for register CFGL"] -pub type W = crate::W; -#[doc = "Register CFGL `reset()`'s with value 0x0e00"] -impl crate::ResetValue for super::CFGL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0e00 +#[doc = "Register `CFGL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFGL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `RELOAD_DST`"] -pub type RELOAD_DST_R = crate::R; -#[doc = "Write proxy for field `RELOAD_DST`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RELOAD_DST` reader - Automatic Destination Reload"] +pub struct RELOAD_DST_R(crate::FieldReader); +impl RELOAD_DST_R { + pub(crate) fn new(bits: bool) -> Self { + RELOAD_DST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RELOAD_DST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RELOAD_DST` writer - Automatic Destination Reload"] pub struct RELOAD_DST_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> RELOAD_DST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } -#[doc = "Reader of field `RELOAD_SRC`"] -pub type RELOAD_SRC_R = crate::R; -#[doc = "Write proxy for field `RELOAD_SRC`"] +#[doc = "Field `RELOAD_SRC` reader - Automatic Source Reload"] +pub struct RELOAD_SRC_R(crate::FieldReader); +impl RELOAD_SRC_R { + pub(crate) fn new(bits: bool) -> Self { + RELOAD_SRC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RELOAD_SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RELOAD_SRC` writer - Automatic Source Reload"] pub struct RELOAD_SRC_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> RELOAD_SRC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `MAX_ABRST`"] -pub type MAX_ABRST_R = crate::R; -#[doc = "Write proxy for field `MAX_ABRST`"] +#[doc = "Field `MAX_ABRST` reader - Maximum AMBA Burst Length"] +pub struct MAX_ABRST_R(crate::FieldReader); +impl MAX_ABRST_R { + pub(crate) fn new(bits: u16) -> Self { + MAX_ABRST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAX_ABRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAX_ABRST` writer - Maximum AMBA Burst Length"] pub struct MAX_ABRST_W<'a> { w: &'a mut W, } @@ -68,7 +128,7 @@ impl<'a> MAX_ABRST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 20)) | (((value as u32) & 0x03ff) << 20); + self.w.bits = (self.w.bits & !(0x03ff << 20)) | ((value as u32 & 0x03ff) << 20); self.w } } @@ -86,9 +146,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRC_HS_POL`"] -pub type SRC_HS_POL_R = crate::R; +#[doc = "Field `SRC_HS_POL` reader - Source Handshaking Interface Polarity"] +pub struct SRC_HS_POL_R(crate::FieldReader); impl SRC_HS_POL_R { + pub(crate) fn new(bits: bool) -> Self { + SRC_HS_POL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRC_HS_POL_A { @@ -100,15 +163,22 @@ impl SRC_HS_POL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRC_HS_POL_A::VALUE1 + **self == SRC_HS_POL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRC_HS_POL_A::VALUE2 + **self == SRC_HS_POL_A::VALUE2 } } -#[doc = "Write proxy for field `SRC_HS_POL`"] +impl core::ops::Deref for SRC_HS_POL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_HS_POL` writer - Source Handshaking Interface Polarity"] pub struct SRC_HS_POL_W<'a> { w: &'a mut W, } @@ -116,9 +186,7 @@ impl<'a> SRC_HS_POL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRC_HS_POL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active high"] #[inline(always)] @@ -143,7 +211,7 @@ impl<'a> SRC_HS_POL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -161,9 +229,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DST_HS_POL`"] -pub type DST_HS_POL_R = crate::R; +#[doc = "Field `DST_HS_POL` reader - Destination Handshaking Interface Polarity"] +pub struct DST_HS_POL_R(crate::FieldReader); impl DST_HS_POL_R { + pub(crate) fn new(bits: bool) -> Self { + DST_HS_POL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DST_HS_POL_A { @@ -175,15 +246,22 @@ impl DST_HS_POL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DST_HS_POL_A::VALUE1 + **self == DST_HS_POL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DST_HS_POL_A::VALUE2 + **self == DST_HS_POL_A::VALUE2 + } +} +impl core::ops::Deref for DST_HS_POL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DST_HS_POL`"] +#[doc = "Field `DST_HS_POL` writer - Destination Handshaking Interface Polarity"] pub struct DST_HS_POL_W<'a> { w: &'a mut W, } @@ -191,9 +269,7 @@ impl<'a> DST_HS_POL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DST_HS_POL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active high"] #[inline(always)] @@ -218,13 +294,25 @@ impl<'a> DST_HS_POL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `LOCK_B`"] -pub type LOCK_B_R = crate::R; -#[doc = "Write proxy for field `LOCK_B`"] +#[doc = "Field `LOCK_B` reader - Bus Lock Bit"] +pub struct LOCK_B_R(crate::FieldReader); +impl LOCK_B_R { + pub(crate) fn new(bits: bool) -> Self { + LOCK_B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOCK_B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCK_B` writer - Bus Lock Bit"] pub struct LOCK_B_W<'a> { w: &'a mut W, } @@ -242,13 +330,25 @@ impl<'a> LOCK_B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `LOCK_CH`"] -pub type LOCK_CH_R = crate::R; -#[doc = "Write proxy for field `LOCK_CH`"] +#[doc = "Field `LOCK_CH` reader - Channel Lock Bit"] +pub struct LOCK_CH_R(crate::FieldReader); +impl LOCK_CH_R { + pub(crate) fn new(bits: bool) -> Self { + LOCK_CH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOCK_CH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCK_CH` writer - Channel Lock Bit"] pub struct LOCK_CH_W<'a> { w: &'a mut W, } @@ -266,7 +366,7 @@ impl<'a> LOCK_CH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -287,37 +387,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LOCK_B_L`"] -pub type LOCK_B_L_R = crate::R; +#[doc = "Field `LOCK_B_L` reader - Bus Lock Level"] +pub struct LOCK_B_L_R(crate::FieldReader); impl LOCK_B_L_R { + pub(crate) fn new(bits: u8) -> Self { + LOCK_B_L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(LOCK_B_L_A::VALUE1), - 1 => Val(LOCK_B_L_A::VALUE2), - 2 => Val(LOCK_B_L_A::VALUE3), - i => Res(i), + 0 => Some(LOCK_B_L_A::VALUE1), + 1 => Some(LOCK_B_L_A::VALUE2), + 2 => Some(LOCK_B_L_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOCK_B_L_A::VALUE1 + **self == LOCK_B_L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOCK_B_L_A::VALUE2 + **self == LOCK_B_L_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LOCK_B_L_A::VALUE3 + **self == LOCK_B_L_A::VALUE3 + } +} +impl core::ops::Deref for LOCK_B_L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOCK_B_L`"] +#[doc = "Field `LOCK_B_L` writer - Bus Lock Level"] pub struct LOCK_B_L_W<'a> { w: &'a mut W, } @@ -345,7 +454,7 @@ impl<'a> LOCK_B_L_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -366,37 +475,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LOCK_CH_L`"] -pub type LOCK_CH_L_R = crate::R; +#[doc = "Field `LOCK_CH_L` reader - Channel Lock Level"] +pub struct LOCK_CH_L_R(crate::FieldReader); impl LOCK_CH_L_R { + pub(crate) fn new(bits: u8) -> Self { + LOCK_CH_L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(LOCK_CH_L_A::VALUE1), - 1 => Val(LOCK_CH_L_A::VALUE2), - 2 => Val(LOCK_CH_L_A::VALUE3), - i => Res(i), + 0 => Some(LOCK_CH_L_A::VALUE1), + 1 => Some(LOCK_CH_L_A::VALUE2), + 2 => Some(LOCK_CH_L_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOCK_CH_L_A::VALUE1 + **self == LOCK_CH_L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOCK_CH_L_A::VALUE2 + **self == LOCK_CH_L_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LOCK_CH_L_A::VALUE3 + **self == LOCK_CH_L_A::VALUE3 + } +} +impl core::ops::Deref for LOCK_CH_L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOCK_CH_L`"] +#[doc = "Field `LOCK_CH_L` writer - Channel Lock Level"] pub struct LOCK_CH_L_W<'a> { w: &'a mut W, } @@ -424,7 +542,7 @@ impl<'a> LOCK_CH_L_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -442,9 +560,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HS_SEL_SRC`"] -pub type HS_SEL_SRC_R = crate::R; +#[doc = "Field `HS_SEL_SRC` reader - Source Software or Hardware Handshaking Select"] +pub struct HS_SEL_SRC_R(crate::FieldReader); impl HS_SEL_SRC_R { + pub(crate) fn new(bits: bool) -> Self { + HS_SEL_SRC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HS_SEL_SRC_A { @@ -456,15 +577,22 @@ impl HS_SEL_SRC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HS_SEL_SRC_A::VALUE1 + **self == HS_SEL_SRC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HS_SEL_SRC_A::VALUE2 + **self == HS_SEL_SRC_A::VALUE2 + } +} +impl core::ops::Deref for HS_SEL_SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HS_SEL_SRC`"] +#[doc = "Field `HS_SEL_SRC` writer - Source Software or Hardware Handshaking Select"] pub struct HS_SEL_SRC_W<'a> { w: &'a mut W, } @@ -472,9 +600,7 @@ impl<'a> HS_SEL_SRC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HS_SEL_SRC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] @@ -499,7 +625,7 @@ impl<'a> HS_SEL_SRC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -517,9 +643,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HS_SEL_DST`"] -pub type HS_SEL_DST_R = crate::R; +#[doc = "Field `HS_SEL_DST` reader - Destination Software or Hardware Handshaking Select"] +pub struct HS_SEL_DST_R(crate::FieldReader); impl HS_SEL_DST_R { + pub(crate) fn new(bits: bool) -> Self { + HS_SEL_DST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HS_SEL_DST_A { @@ -531,15 +660,22 @@ impl HS_SEL_DST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HS_SEL_DST_A::VALUE1 + **self == HS_SEL_DST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HS_SEL_DST_A::VALUE2 + **self == HS_SEL_DST_A::VALUE2 } } -#[doc = "Write proxy for field `HS_SEL_DST`"] +impl core::ops::Deref for HS_SEL_DST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HS_SEL_DST` writer - Destination Software or Hardware Handshaking Select"] pub struct HS_SEL_DST_W<'a> { w: &'a mut W, } @@ -547,9 +683,7 @@ impl<'a> HS_SEL_DST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HS_SEL_DST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] @@ -574,7 +708,7 @@ impl<'a> HS_SEL_DST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -592,9 +726,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFO_EMPTY`"] -pub type FIFO_EMPTY_R = crate::R; +#[doc = "Field `FIFO_EMPTY` reader - Indicates if there is data left in the channel FIFO"] +pub struct FIFO_EMPTY_R(crate::FieldReader); impl FIFO_EMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + FIFO_EMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFO_EMPTY_A { @@ -606,12 +743,19 @@ impl FIFO_EMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFO_EMPTY_A::VALUE1 + **self == FIFO_EMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFO_EMPTY_A::VALUE2 + **self == FIFO_EMPTY_A::VALUE2 + } +} +impl core::ops::Deref for FIFO_EMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel Suspend\n\nValue on reset: 0"] @@ -628,9 +772,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH_SUSP`"] -pub type CH_SUSP_R = crate::R; +#[doc = "Field `CH_SUSP` reader - Channel Suspend"] +pub struct CH_SUSP_R(crate::FieldReader); impl CH_SUSP_R { + pub(crate) fn new(bits: bool) -> Self { + CH_SUSP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH_SUSP_A { @@ -642,15 +789,22 @@ impl CH_SUSP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH_SUSP_A::VALUE1 + **self == CH_SUSP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH_SUSP_A::VALUE2 + **self == CH_SUSP_A::VALUE2 } } -#[doc = "Write proxy for field `CH_SUSP`"] +impl core::ops::Deref for CH_SUSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH_SUSP` writer - Channel Suspend"] pub struct CH_SUSP_W<'a> { w: &'a mut W, } @@ -658,9 +812,7 @@ impl<'a> CH_SUSP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH_SUSP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not suspended."] #[inline(always)] @@ -685,13 +837,25 @@ impl<'a> CH_SUSP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `CH_PRIOR`"] -pub type CH_PRIOR_R = crate::R; -#[doc = "Write proxy for field `CH_PRIOR`"] +#[doc = "Field `CH_PRIOR` reader - Channel priority"] +pub struct CH_PRIOR_R(crate::FieldReader); +impl CH_PRIOR_R { + pub(crate) fn new(bits: u8) -> Self { + CH_PRIOR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH_PRIOR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH_PRIOR` writer - Channel priority"] pub struct CH_PRIOR_W<'a> { w: &'a mut W, } @@ -699,7 +863,7 @@ impl<'a> CH_PRIOR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 5)) | (((value as u32) & 0x07) << 5); + self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u32 & 0x07) << 5); self.w } } @@ -841,4 +1005,30 @@ impl W { pub fn ch_prior(&mut self) -> CH_PRIOR_W { CH_PRIOR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration Register Low\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 [cfgl](index.html) module"] +pub struct CFGL_SPEC; +impl crate::RegisterSpec for CFGL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfgl::R](R) reader structure"] +impl crate::Readable for CFGL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfgl::W](W) writer structure"] +impl crate::Writable for CFGL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFGL to value 0x0e00"] +impl crate::Resettable for CFGL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0e00 + } } diff --git a/src/gpdma0_ch0/ctlh.rs b/src/gpdma0_ch0/ctlh.rs index 2a88927e..4215e3db 100644 --- a/src/gpdma0_ch0/ctlh.rs +++ b/src/gpdma0_ch0/ctlh.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTLH"] -pub type R = crate::R; -#[doc = "Writer for register CTLH"] -pub type W = crate::W; -#[doc = "Register CTLH `reset()`'s with value 0x02"] -impl crate::ResetValue for super::CTLH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x02 +#[doc = "Register `CTLH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `DONE`"] -pub type DONE_R = crate::R; -#[doc = "Write proxy for field `DONE`"] +#[doc = "Register `CTLH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DONE` reader - Done bit"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DONE` writer - Done bit"] pub struct DONE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> DONE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `BLOCK_TS`"] -pub type BLOCK_TS_R = crate::R; -#[doc = "Write proxy for field `BLOCK_TS`"] +#[doc = "Field `BLOCK_TS` reader - Block Transfer Size"] +pub struct BLOCK_TS_R(crate::FieldReader); +impl BLOCK_TS_R { + pub(crate) fn new(bits: u16) -> Self { + BLOCK_TS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLOCK_TS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLOCK_TS` writer - Block Transfer Size"] pub struct BLOCK_TS_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> BLOCK_TS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } @@ -71,4 +119,30 @@ impl W { pub fn block_ts(&mut self) -> BLOCK_TS_W { BLOCK_TS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control Register High\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 [ctlh](index.html) module"] +pub struct CTLH_SPEC; +impl crate::RegisterSpec for CTLH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctlh::R](R) reader structure"] +impl crate::Readable for CTLH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctlh::W](W) writer structure"] +impl crate::Writable for CTLH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTLH to value 0x02"] +impl crate::Resettable for CTLH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } } diff --git a/src/gpdma0_ch0/ctll.rs b/src/gpdma0_ch0/ctll.rs index 68a7dc53..dbd9bfa3 100644 --- a/src/gpdma0_ch0/ctll.rs +++ b/src/gpdma0_ch0/ctll.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTLL"] -pub type R = crate::R; -#[doc = "Writer for register CTLL"] -pub type W = crate::W; -#[doc = "Register CTLL `reset()`'s with value 0x0030_4801"] -impl crate::ResetValue for super::CTLL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0030_4801 +#[doc = "Register `CTLL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTLL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `LLP_SRC_EN`"] -pub type LLP_SRC_EN_R = crate::R; -#[doc = "Write proxy for field `LLP_SRC_EN`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LLP_SRC_EN` reader - Linked List Pointer for Source Enable"] +pub struct LLP_SRC_EN_R(crate::FieldReader); +impl LLP_SRC_EN_R { + pub(crate) fn new(bits: bool) -> Self { + LLP_SRC_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LLP_SRC_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LLP_SRC_EN` writer - Linked List Pointer for Source Enable"] pub struct LLP_SRC_EN_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> LLP_SRC_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Reader of field `LLP_DST_EN`"] -pub type LLP_DST_EN_R = crate::R; -#[doc = "Write proxy for field `LLP_DST_EN`"] +#[doc = "Field `LLP_DST_EN` reader - Linked List Pointer for Destination Enable"] +pub struct LLP_DST_EN_R(crate::FieldReader); +impl LLP_DST_EN_R { + pub(crate) fn new(bits: bool) -> Self { + LLP_DST_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LLP_DST_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LLP_DST_EN` writer - Linked List Pointer for Destination Enable"] pub struct LLP_DST_EN_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> LLP_DST_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Reader of field `TT_FC`"] -pub type TT_FC_R = crate::R; -#[doc = "Write proxy for field `TT_FC`"] +#[doc = "Field `TT_FC` reader - Transfer Type and Flow Control"] +pub struct TT_FC_R(crate::FieldReader); +impl TT_FC_R { + pub(crate) fn new(bits: u8) -> Self { + TT_FC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TT_FC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TT_FC` writer - Transfer Type and Flow Control"] pub struct TT_FC_W<'a> { w: &'a mut W, } @@ -68,7 +128,7 @@ impl<'a> TT_FC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } @@ -86,9 +146,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DST_SCATTER_EN`"] -pub type DST_SCATTER_EN_R = crate::R; +#[doc = "Field `DST_SCATTER_EN` reader - Destination scatter enable"] +pub struct DST_SCATTER_EN_R(crate::FieldReader); impl DST_SCATTER_EN_R { + pub(crate) fn new(bits: bool) -> Self { + DST_SCATTER_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DST_SCATTER_EN_A { @@ -100,15 +163,22 @@ impl DST_SCATTER_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DST_SCATTER_EN_A::VALUE1 + **self == DST_SCATTER_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DST_SCATTER_EN_A::VALUE2 + **self == DST_SCATTER_EN_A::VALUE2 + } +} +impl core::ops::Deref for DST_SCATTER_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DST_SCATTER_EN`"] +#[doc = "Field `DST_SCATTER_EN` writer - Destination scatter enable"] pub struct DST_SCATTER_EN_W<'a> { w: &'a mut W, } @@ -116,9 +186,7 @@ impl<'a> DST_SCATTER_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DST_SCATTER_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Scatter disabled"] #[inline(always)] @@ -143,7 +211,7 @@ impl<'a> DST_SCATTER_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -161,9 +229,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRC_GATHER_EN`"] -pub type SRC_GATHER_EN_R = crate::R; +#[doc = "Field `SRC_GATHER_EN` reader - Source gather enable"] +pub struct SRC_GATHER_EN_R(crate::FieldReader); impl SRC_GATHER_EN_R { + pub(crate) fn new(bits: bool) -> Self { + SRC_GATHER_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRC_GATHER_EN_A { @@ -175,15 +246,22 @@ impl SRC_GATHER_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRC_GATHER_EN_A::VALUE1 + **self == SRC_GATHER_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRC_GATHER_EN_A::VALUE2 + **self == SRC_GATHER_EN_A::VALUE2 + } +} +impl core::ops::Deref for SRC_GATHER_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRC_GATHER_EN`"] +#[doc = "Field `SRC_GATHER_EN` writer - Source gather enable"] pub struct SRC_GATHER_EN_W<'a> { w: &'a mut W, } @@ -191,9 +269,7 @@ impl<'a> SRC_GATHER_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRC_GATHER_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Gather disabled"] #[inline(always)] @@ -218,13 +294,25 @@ impl<'a> SRC_GATHER_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `SRC_MSIZE`"] -pub type SRC_MSIZE_R = crate::R; -#[doc = "Write proxy for field `SRC_MSIZE`"] +#[doc = "Field `SRC_MSIZE` reader - Source Burst Transaction Length"] +pub struct SRC_MSIZE_R(crate::FieldReader); +impl SRC_MSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_MSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_MSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_MSIZE` writer - Source Burst Transaction Length"] pub struct SRC_MSIZE_W<'a> { w: &'a mut W, } @@ -232,13 +320,25 @@ impl<'a> SRC_MSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 14)) | (((value as u32) & 0x07) << 14); + self.w.bits = (self.w.bits & !(0x07 << 14)) | ((value as u32 & 0x07) << 14); self.w } } -#[doc = "Reader of field `DEST_MSIZE`"] -pub type DEST_MSIZE_R = crate::R; -#[doc = "Write proxy for field `DEST_MSIZE`"] +#[doc = "Field `DEST_MSIZE` reader - Destination Burst Transaction Length"] +pub struct DEST_MSIZE_R(crate::FieldReader); +impl DEST_MSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + DEST_MSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEST_MSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DEST_MSIZE` writer - Destination Burst Transaction Length"] pub struct DEST_MSIZE_W<'a> { w: &'a mut W, } @@ -246,7 +346,7 @@ impl<'a> DEST_MSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 11)) | (((value as u32) & 0x07) << 11); + self.w.bits = (self.w.bits & !(0x07 << 11)) | ((value as u32 & 0x07) << 11); self.w } } @@ -267,37 +367,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SINC`"] -pub type SINC_R = crate::R; +#[doc = "Field `SINC` reader - Source Address Increment"] +pub struct SINC_R(crate::FieldReader); impl SINC_R { + pub(crate) fn new(bits: u8) -> Self { + SINC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SINC_A::VALUE1), - 1 => Val(SINC_A::VALUE2), - 2 => Val(SINC_A::VALUE3), - i => Res(i), + 0 => Some(SINC_A::VALUE1), + 1 => Some(SINC_A::VALUE2), + 2 => Some(SINC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SINC_A::VALUE1 + **self == SINC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SINC_A::VALUE2 + **self == SINC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SINC_A::VALUE3 + **self == SINC_A::VALUE3 + } +} +impl core::ops::Deref for SINC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SINC`"] +#[doc = "Field `SINC` writer - Source Address Increment"] pub struct SINC_W<'a> { w: &'a mut W, } @@ -325,7 +434,7 @@ impl<'a> SINC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 9)) | (((value as u32) & 0x03) << 9); + self.w.bits = (self.w.bits & !(0x03 << 9)) | ((value as u32 & 0x03) << 9); self.w } } @@ -346,37 +455,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DINC`"] -pub type DINC_R = crate::R; +#[doc = "Field `DINC` reader - Destination Address Increment"] +pub struct DINC_R(crate::FieldReader); impl DINC_R { + pub(crate) fn new(bits: u8) -> Self { + DINC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DINC_A::VALUE1), - 1 => Val(DINC_A::VALUE2), - 2 => Val(DINC_A::VALUE3), - i => Res(i), + 0 => Some(DINC_A::VALUE1), + 1 => Some(DINC_A::VALUE2), + 2 => Some(DINC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DINC_A::VALUE1 + **self == DINC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DINC_A::VALUE2 + **self == DINC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DINC_A::VALUE3 + **self == DINC_A::VALUE3 + } +} +impl core::ops::Deref for DINC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DINC`"] +#[doc = "Field `DINC` writer - Destination Address Increment"] pub struct DINC_W<'a> { w: &'a mut W, } @@ -404,13 +522,25 @@ impl<'a> DINC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 7)) | (((value as u32) & 0x03) << 7); + self.w.bits = (self.w.bits & !(0x03 << 7)) | ((value as u32 & 0x03) << 7); self.w } } -#[doc = "Reader of field `SRC_TR_WIDTH`"] -pub type SRC_TR_WIDTH_R = crate::R; -#[doc = "Write proxy for field `SRC_TR_WIDTH`"] +#[doc = "Field `SRC_TR_WIDTH` reader - Source Transfer Width"] +pub struct SRC_TR_WIDTH_R(crate::FieldReader); +impl SRC_TR_WIDTH_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_TR_WIDTH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_TR_WIDTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_TR_WIDTH` writer - Source Transfer Width"] pub struct SRC_TR_WIDTH_W<'a> { w: &'a mut W, } @@ -418,13 +548,25 @@ impl<'a> SRC_TR_WIDTH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `DST_TR_WIDTH`"] -pub type DST_TR_WIDTH_R = crate::R; -#[doc = "Write proxy for field `DST_TR_WIDTH`"] +#[doc = "Field `DST_TR_WIDTH` reader - Destination Transfer Width"] +pub struct DST_TR_WIDTH_R(crate::FieldReader); +impl DST_TR_WIDTH_R { + pub(crate) fn new(bits: u8) -> Self { + DST_TR_WIDTH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DST_TR_WIDTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DST_TR_WIDTH` writer - Destination Transfer Width"] pub struct DST_TR_WIDTH_W<'a> { w: &'a mut W, } @@ -432,13 +574,25 @@ impl<'a> DST_TR_WIDTH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 1)) | (((value as u32) & 0x07) << 1); + self.w.bits = (self.w.bits & !(0x07 << 1)) | ((value as u32 & 0x07) << 1); self.w } } -#[doc = "Reader of field `INT_EN`"] -pub type INT_EN_R = crate::R; -#[doc = "Write proxy for field `INT_EN`"] +#[doc = "Field `INT_EN` reader - Interrupt Enable Bit"] +pub struct INT_EN_R(crate::FieldReader); +impl INT_EN_R { + pub(crate) fn new(bits: bool) -> Self { + INT_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INT_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INT_EN` writer - Interrupt Enable Bit"] pub struct INT_EN_W<'a> { w: &'a mut W, } @@ -456,7 +610,7 @@ impl<'a> INT_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -583,4 +737,30 @@ impl W { pub fn int_en(&mut self) -> INT_EN_W { INT_EN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control Register Low\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 [ctll](index.html) module"] +pub struct CTLL_SPEC; +impl crate::RegisterSpec for CTLL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctll::R](R) reader structure"] +impl crate::Readable for CTLL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctll::W](W) writer structure"] +impl crate::Writable for CTLL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTLL to value 0x0030_4801"] +impl crate::Resettable for CTLL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0030_4801 + } } diff --git a/src/gpdma0_ch0/dar.rs b/src/gpdma0_ch0/dar.rs index 0b70269c..e9da057f 100644 --- a/src/gpdma0_ch0/dar.rs +++ b/src/gpdma0_ch0/dar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAR"] -pub type R = crate::R; -#[doc = "Writer for register DAR"] -pub type W = crate::W; -#[doc = "Register DAR `reset()`'s with value 0"] -impl crate::ResetValue for super::DAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DAR`"] -pub type DAR_R = crate::R; -#[doc = "Write proxy for field `DAR`"] +#[doc = "Field `DAR` reader - Current Destination address of DMA transfer"] +pub struct DAR_R(crate::FieldReader); +impl DAR_R { + pub(crate) fn new(bits: u32) -> Self { + DAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAR` writer - Current Destination address of DMA transfer"] pub struct DAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dar(&mut self) -> DAR_W { DAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Address Register\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 [dar](index.html) module"] +pub struct DAR_SPEC; +impl crate::RegisterSpec for DAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dar::R](R) reader structure"] +impl crate::Readable for DAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dar::W](W) writer structure"] +impl crate::Writable for DAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAR to value 0"] +impl crate::Resettable for DAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/dsr.rs b/src/gpdma0_ch0/dsr.rs index 1c291679..484fb6e4 100644 --- a/src/gpdma0_ch0/dsr.rs +++ b/src/gpdma0_ch0/dsr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DSR"] -pub type R = crate::R; -#[doc = "Writer for register DSR"] -pub type W = crate::W; -#[doc = "Register DSR `reset()`'s with value 0"] -impl crate::ResetValue for super::DSR { - type Type = u32; +#[doc = "Register `DSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DSC` reader - Destination scatter count"] +pub struct DSC_R(crate::FieldReader); +impl DSC_R { + pub(crate) fn new(bits: u16) -> Self { + DSC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DSC`"] -pub type DSC_R = crate::R; -#[doc = "Write proxy for field `DSC`"] +#[doc = "Field `DSC` writer - Destination scatter count"] pub struct DSC_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 20)) | (((value as u32) & 0x0fff) << 20); + self.w.bits = (self.w.bits & !(0x0fff << 20)) | ((value as u32 & 0x0fff) << 20); self.w } } -#[doc = "Reader of field `DSI`"] -pub type DSI_R = crate::R; -#[doc = "Write proxy for field `DSI`"] +#[doc = "Field `DSI` reader - Destination scatter interval"] +pub struct DSI_R(crate::FieldReader); +impl DSI_R { + pub(crate) fn new(bits: u32) -> Self { + DSI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSI` writer - Destination scatter interval"] pub struct DSI_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> DSI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x000f_ffff) | ((value as u32) & 0x000f_ffff); + self.w.bits = (self.w.bits & !0x000f_ffff) | (value as u32 & 0x000f_ffff); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn dsi(&mut self) -> DSI_W { DSI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Scatter Register\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 [dsr](index.html) module"] +pub struct DSR_SPEC; +impl crate::RegisterSpec for DSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dsr::R](R) reader structure"] +impl crate::Readable for DSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dsr::W](W) writer structure"] +impl crate::Writable for DSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DSR to value 0"] +impl crate::Resettable for DSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/dstat.rs b/src/gpdma0_ch0/dstat.rs index 235b35f7..307f72a7 100644 --- a/src/gpdma0_ch0/dstat.rs +++ b/src/gpdma0_ch0/dstat.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DSTAT"] -pub type R = crate::R; -#[doc = "Writer for register DSTAT"] -pub type W = crate::W; -#[doc = "Register DSTAT `reset()`'s with value 0"] -impl crate::ResetValue for super::DSTAT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DSTAT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DSTAT`"] -pub type DSTAT_R = crate::R; -#[doc = "Write proxy for field `DSTAT`"] +#[doc = "Field `DSTAT` reader - Destination Status"] +pub struct DSTAT_R(crate::FieldReader); +impl DSTAT_R { + pub(crate) fn new(bits: u32) -> Self { + DSTAT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSTAT` writer - Destination Status"] pub struct DSTAT_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DSTAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dstat(&mut self) -> DSTAT_W { DSTAT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Status Register\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 [dstat](index.html) module"] +pub struct DSTAT_SPEC; +impl crate::RegisterSpec for DSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dstat::R](R) reader structure"] +impl crate::Readable for DSTAT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dstat::W](W) writer structure"] +impl crate::Writable for DSTAT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DSTAT to value 0"] +impl crate::Resettable for DSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/dstatar.rs b/src/gpdma0_ch0/dstatar.rs index fabbdd1e..e0218f8f 100644 --- a/src/gpdma0_ch0/dstatar.rs +++ b/src/gpdma0_ch0/dstatar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DSTATAR"] -pub type R = crate::R; -#[doc = "Writer for register DSTATAR"] -pub type W = crate::W; -#[doc = "Register DSTATAR `reset()`'s with value 0"] -impl crate::ResetValue for super::DSTATAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DSTATAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DSTATAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DSTATAR`"] -pub type DSTATAR_R = crate::R; -#[doc = "Write proxy for field `DSTATAR`"] +#[doc = "Field `DSTATAR` reader - Destination Status Address"] +pub struct DSTATAR_R(crate::FieldReader); +impl DSTATAR_R { + pub(crate) fn new(bits: u32) -> Self { + DSTATAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSTATAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSTATAR` writer - Destination Status Address"] pub struct DSTATAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DSTATAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dstatar(&mut self) -> DSTATAR_W { DSTATAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Status Address Register\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 [dstatar](index.html) module"] +pub struct DSTATAR_SPEC; +impl crate::RegisterSpec for DSTATAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dstatar::R](R) reader structure"] +impl crate::Readable for DSTATAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dstatar::W](W) writer structure"] +impl crate::Writable for DSTATAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DSTATAR to value 0"] +impl crate::Resettable for DSTATAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/llp.rs b/src/gpdma0_ch0/llp.rs index 4bacf06f..777e12ae 100644 --- a/src/gpdma0_ch0/llp.rs +++ b/src/gpdma0_ch0/llp.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LLP"] -pub type R = crate::R; -#[doc = "Writer for register LLP"] -pub type W = crate::W; -#[doc = "Register LLP `reset()`'s with value 0"] -impl crate::ResetValue for super::LLP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LLP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LLP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `LOC`"] -pub type LOC_R = crate::R; -#[doc = "Write proxy for field `LOC`"] +#[doc = "Field `LOC` reader - Starting Address In Memory"] +pub struct LOC_R(crate::FieldReader); +impl LOC_R { + pub(crate) fn new(bits: u32) -> Self { + LOC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOC` writer - Starting Address In Memory"] pub struct LOC_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> LOC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3fff_ffff << 2)) | (((value as u32) & 0x3fff_ffff) << 2); + self.w.bits = (self.w.bits & !(0x3fff_ffff << 2)) | ((value as u32 & 0x3fff_ffff) << 2); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn loc(&mut self) -> LOC_W { LOC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Linked List Pointer Register\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 [llp](index.html) module"] +pub struct LLP_SPEC; +impl crate::RegisterSpec for LLP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [llp::R](R) reader structure"] +impl crate::Readable for LLP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [llp::W](W) writer structure"] +impl crate::Writable for LLP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LLP to value 0"] +impl crate::Resettable for LLP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/sar.rs b/src/gpdma0_ch0/sar.rs index 4674107c..7b86cf01 100644 --- a/src/gpdma0_ch0/sar.rs +++ b/src/gpdma0_ch0/sar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SAR"] -pub type R = crate::R; -#[doc = "Writer for register SAR"] -pub type W = crate::W; -#[doc = "Register SAR `reset()`'s with value 0"] -impl crate::ResetValue for super::SAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SAR`"] -pub type SAR_R = crate::R; -#[doc = "Write proxy for field `SAR`"] +#[doc = "Field `SAR` reader - Current Source Address of DMA transfer"] +pub struct SAR_R(crate::FieldReader); +impl SAR_R { + pub(crate) fn new(bits: u32) -> Self { + SAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAR` writer - Current Source Address of DMA transfer"] pub struct SAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sar(&mut self) -> SAR_W { SAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Address Register\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 [sar](index.html) module"] +pub struct SAR_SPEC; +impl crate::RegisterSpec for SAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sar::R](R) reader structure"] +impl crate::Readable for SAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sar::W](W) writer structure"] +impl crate::Writable for SAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SAR to value 0"] +impl crate::Resettable for SAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/sgr.rs b/src/gpdma0_ch0/sgr.rs index 64daf63f..605f317b 100644 --- a/src/gpdma0_ch0/sgr.rs +++ b/src/gpdma0_ch0/sgr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SGR"] -pub type R = crate::R; -#[doc = "Writer for register SGR"] -pub type W = crate::W; -#[doc = "Register SGR `reset()`'s with value 0"] -impl crate::ResetValue for super::SGR { - type Type = u32; +#[doc = "Register `SGR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SGR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SGC` reader - Source gather count"] +pub struct SGC_R(crate::FieldReader); +impl SGC_R { + pub(crate) fn new(bits: u16) -> Self { + SGC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SGC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `SGC`"] -pub type SGC_R = crate::R; -#[doc = "Write proxy for field `SGC`"] +#[doc = "Field `SGC` writer - Source gather count"] pub struct SGC_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> SGC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 20)) | (((value as u32) & 0x0fff) << 20); + self.w.bits = (self.w.bits & !(0x0fff << 20)) | ((value as u32 & 0x0fff) << 20); self.w } } -#[doc = "Reader of field `SGI`"] -pub type SGI_R = crate::R; -#[doc = "Write proxy for field `SGI`"] +#[doc = "Field `SGI` reader - Source gather interval"] +pub struct SGI_R(crate::FieldReader); +impl SGI_R { + pub(crate) fn new(bits: u32) -> Self { + SGI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SGI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SGI` writer - Source gather interval"] pub struct SGI_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> SGI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x000f_ffff) | ((value as u32) & 0x000f_ffff); + self.w.bits = (self.w.bits & !0x000f_ffff) | (value as u32 & 0x000f_ffff); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn sgi(&mut self) -> SGI_W { SGI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Gather Register\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 [sgr](index.html) module"] +pub struct SGR_SPEC; +impl crate::RegisterSpec for SGR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sgr::R](R) reader structure"] +impl crate::Readable for SGR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sgr::W](W) writer structure"] +impl crate::Writable for SGR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SGR to value 0"] +impl crate::Resettable for SGR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/sstat.rs b/src/gpdma0_ch0/sstat.rs index 2ee2ea02..2d5cadbc 100644 --- a/src/gpdma0_ch0/sstat.rs +++ b/src/gpdma0_ch0/sstat.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SSTAT"] -pub type R = crate::R; -#[doc = "Writer for register SSTAT"] -pub type W = crate::W; -#[doc = "Register SSTAT `reset()`'s with value 0"] -impl crate::ResetValue for super::SSTAT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SSTAT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SSTAT`"] -pub type SSTAT_R = crate::R; -#[doc = "Write proxy for field `SSTAT`"] +#[doc = "Field `SSTAT` reader - Source Status"] +pub struct SSTAT_R(crate::FieldReader); +impl SSTAT_R { + pub(crate) fn new(bits: u32) -> Self { + SSTAT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SSTAT` writer - Source Status"] pub struct SSTAT_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SSTAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sstat(&mut self) -> SSTAT_W { SSTAT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Status Register\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 [sstat](index.html) module"] +pub struct SSTAT_SPEC; +impl crate::RegisterSpec for SSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sstat::R](R) reader structure"] +impl crate::Readable for SSTAT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sstat::W](W) writer structure"] +impl crate::Writable for SSTAT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SSTAT to value 0"] +impl crate::Resettable for SSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch0/sstatar.rs b/src/gpdma0_ch0/sstatar.rs index a138e9cd..8233a681 100644 --- a/src/gpdma0_ch0/sstatar.rs +++ b/src/gpdma0_ch0/sstatar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SSTATAR"] -pub type R = crate::R; -#[doc = "Writer for register SSTATAR"] -pub type W = crate::W; -#[doc = "Register SSTATAR `reset()`'s with value 0"] -impl crate::ResetValue for super::SSTATAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SSTATAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SSTATAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SSTATAR`"] -pub type SSTATAR_R = crate::R; -#[doc = "Write proxy for field `SSTATAR`"] +#[doc = "Field `SSTATAR` reader - Source Status Address"] +pub struct SSTATAR_R(crate::FieldReader); +impl SSTATAR_R { + pub(crate) fn new(bits: u32) -> Self { + SSTATAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SSTATAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SSTATAR` writer - Source Status Address"] pub struct SSTATAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SSTATAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sstatar(&mut self) -> SSTATAR_W { SSTATAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Status Address Register\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 [sstatar](index.html) module"] +pub struct SSTATAR_SPEC; +impl crate::RegisterSpec for SSTATAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sstatar::R](R) reader structure"] +impl crate::Readable for SSTATAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sstatar::W](W) writer structure"] +impl crate::Writable for SSTATAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SSTATAR to value 0"] +impl crate::Resettable for SSTATAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch2.rs b/src/gpdma0_ch2.rs index 93015cf0..196b4d40 100644 --- a/src/gpdma0_ch2.rs +++ b/src/gpdma0_ch2.rs @@ -2,84 +2,42 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Source Address Register"] - pub sar: SAR, - _reserved1: [u8; 4usize], + pub sar: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Destination Address Register"] - pub dar: DAR, - _reserved2: [u8; 12usize], + pub dar: crate::Reg, + _reserved2: [u8; 0x0c], #[doc = "0x18 - Control Register Low"] - pub ctll: CTLL, + pub ctll: crate::Reg, #[doc = "0x1c - Control Register High"] - pub ctlh: CTLH, - _reserved4: [u8; 32usize], + pub ctlh: crate::Reg, + _reserved4: [u8; 0x20], #[doc = "0x40 - Configuration Register Low"] - pub cfgl: CFGL, + pub cfgl: crate::Reg, #[doc = "0x44 - Configuration Register High"] - pub cfgh: CFGH, + pub cfgh: crate::Reg, } -#[doc = "Source Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sar](sar) module"] -pub type SAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SAR; -#[doc = "`read()` method returns [sar::R](sar::R) reader structure"] -impl crate::Readable for SAR {} -#[doc = "`write(|w| ..)` method takes [sar::W](sar::W) writer structure"] -impl crate::Writable for SAR {} +#[doc = "SAR register accessor: an alias for `Reg`"] +pub type SAR = crate::Reg; #[doc = "Source Address Register"] pub mod sar; -#[doc = "Destination Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dar](dar) module"] -pub type DAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAR; -#[doc = "`read()` method returns [dar::R](dar::R) reader structure"] -impl crate::Readable for DAR {} -#[doc = "`write(|w| ..)` method takes [dar::W](dar::W) writer structure"] -impl crate::Writable for DAR {} +#[doc = "DAR register accessor: an alias for `Reg`"] +pub type DAR = crate::Reg; #[doc = "Destination Address Register"] pub mod dar; -#[doc = "Control Register Low\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctll](ctll) module"] -pub type CTLL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTLL; -#[doc = "`read()` method returns [ctll::R](ctll::R) reader structure"] -impl crate::Readable for CTLL {} -#[doc = "`write(|w| ..)` method takes [ctll::W](ctll::W) writer structure"] -impl crate::Writable for CTLL {} +#[doc = "CTLL register accessor: an alias for `Reg`"] +pub type CTLL = crate::Reg; #[doc = "Control Register Low"] pub mod ctll; -#[doc = "Control Register High\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctlh](ctlh) module"] -pub type CTLH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTLH; -#[doc = "`read()` method returns [ctlh::R](ctlh::R) reader structure"] -impl crate::Readable for CTLH {} -#[doc = "`write(|w| ..)` method takes [ctlh::W](ctlh::W) writer structure"] -impl crate::Writable for CTLH {} +#[doc = "CTLH register accessor: an alias for `Reg`"] +pub type CTLH = crate::Reg; #[doc = "Control Register High"] pub mod ctlh; -#[doc = "Configuration Register Low\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cfgl](cfgl) module"] -pub type CFGL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFGL; -#[doc = "`read()` method returns [cfgl::R](cfgl::R) reader structure"] -impl crate::Readable for CFGL {} -#[doc = "`write(|w| ..)` method takes [cfgl::W](cfgl::W) writer structure"] -impl crate::Writable for CFGL {} +#[doc = "CFGL register accessor: an alias for `Reg`"] +pub type CFGL = crate::Reg; #[doc = "Configuration Register Low"] pub mod cfgl; -#[doc = "Configuration Register High\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cfgh](cfgh) module"] -pub type CFGH = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFGH; -#[doc = "`read()` method returns [cfgh::R](cfgh::R) reader structure"] -impl crate::Readable for CFGH {} -#[doc = "`write(|w| ..)` method takes [cfgh::W](cfgh::W) writer structure"] -impl crate::Writable for CFGH {} +#[doc = "CFGH register accessor: an alias for `Reg`"] +pub type CFGH = crate::Reg; #[doc = "Configuration Register High"] pub mod cfgh; diff --git a/src/gpdma0_ch2/cfgh.rs b/src/gpdma0_ch2/cfgh.rs index 34679bfd..00474384 100644 --- a/src/gpdma0_ch2/cfgh.rs +++ b/src/gpdma0_ch2/cfgh.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CFGH"] -pub type R = crate::R; -#[doc = "Writer for register CFGH"] -pub type W = crate::W; -#[doc = "Register CFGH `reset()`'s with value 0x04"] -impl crate::ResetValue for super::CFGH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x04 +#[doc = "Register `CFGH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFGH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DEST_PER` reader - Destination Peripheral"] +pub struct DEST_PER_R(crate::FieldReader); +impl DEST_PER_R { + pub(crate) fn new(bits: u8) -> Self { + DEST_PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEST_PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DEST_PER`"] -pub type DEST_PER_R = crate::R; -#[doc = "Write proxy for field `DEST_PER`"] +#[doc = "Field `DEST_PER` writer - Destination Peripheral"] pub struct DEST_PER_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DEST_PER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 11)) | (((value as u32) & 0x0f) << 11); + self.w.bits = (self.w.bits & !(0x0f << 11)) | ((value as u32 & 0x0f) << 11); self.w } } -#[doc = "Reader of field `SRC_PER`"] -pub type SRC_PER_R = crate::R; -#[doc = "Write proxy for field `SRC_PER`"] +#[doc = "Field `SRC_PER` reader - Source Peripheral"] +pub struct SRC_PER_R(crate::FieldReader); +impl SRC_PER_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_PER` writer - Source Peripheral"] pub struct SRC_PER_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> SRC_PER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 7)) | (((value as u32) & 0x0f) << 7); + self.w.bits = (self.w.bits & !(0x0f << 7)) | ((value as u32 & 0x0f) << 7); self.w } } -#[doc = "Reader of field `PROTCTL`"] -pub type PROTCTL_R = crate::R; -#[doc = "Write proxy for field `PROTCTL`"] +#[doc = "Field `PROTCTL` reader - Protection Control"] +pub struct PROTCTL_R(crate::FieldReader); +impl PROTCTL_R { + pub(crate) fn new(bits: u8) -> Self { + PROTCTL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PROTCTL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PROTCTL` writer - Protection Control"] pub struct PROTCTL_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> PROTCTL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 2)) | (((value as u32) & 0x07) << 2); + self.w.bits = (self.w.bits & !(0x07 << 2)) | ((value as u32 & 0x07) << 2); self.w } } @@ -66,9 +126,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFO_MODE`"] -pub type FIFO_MODE_R = crate::R; +#[doc = "Field `FIFO_MODE` reader - FIFO Mode Select"] +pub struct FIFO_MODE_R(crate::FieldReader); impl FIFO_MODE_R { + pub(crate) fn new(bits: bool) -> Self { + FIFO_MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFO_MODE_A { @@ -80,15 +143,22 @@ impl FIFO_MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFO_MODE_A::VALUE1 + **self == FIFO_MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFO_MODE_A::VALUE2 + **self == FIFO_MODE_A::VALUE2 } } -#[doc = "Write proxy for field `FIFO_MODE`"] +impl core::ops::Deref for FIFO_MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIFO_MODE` writer - FIFO Mode Select"] pub struct FIFO_MODE_W<'a> { w: &'a mut W, } @@ -96,9 +166,7 @@ impl<'a> FIFO_MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FIFO_MODE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] @@ -123,7 +191,7 @@ impl<'a> FIFO_MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -141,9 +209,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCMODE`"] -pub type FCMODE_R = crate::R; +#[doc = "Field `FCMODE` reader - Flow Control Mode"] +pub struct FCMODE_R(crate::FieldReader); impl FCMODE_R { + pub(crate) fn new(bits: bool) -> Self { + FCMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCMODE_A { @@ -155,15 +226,22 @@ impl FCMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCMODE_A::VALUE1 + **self == FCMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCMODE_A::VALUE2 + **self == FCMODE_A::VALUE2 + } +} +impl core::ops::Deref for FCMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FCMODE`"] +#[doc = "Field `FCMODE` writer - Flow Control Mode"] pub struct FCMODE_W<'a> { w: &'a mut W, } @@ -171,9 +249,7 @@ impl<'a> FCMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCMODE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] @@ -198,7 +274,7 @@ impl<'a> FCMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -255,4 +331,30 @@ impl W { pub fn fcmode(&mut self) -> FCMODE_W { FCMODE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration Register High\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 [cfgh](index.html) module"] +pub struct CFGH_SPEC; +impl crate::RegisterSpec for CFGH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfgh::R](R) reader structure"] +impl crate::Readable for CFGH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfgh::W](W) writer structure"] +impl crate::Writable for CFGH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFGH to value 0x04"] +impl crate::Resettable for CFGH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } } diff --git a/src/gpdma0_ch2/cfgl.rs b/src/gpdma0_ch2/cfgl.rs index 12e0800c..12bf7569 100644 --- a/src/gpdma0_ch2/cfgl.rs +++ b/src/gpdma0_ch2/cfgl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CFGL"] -pub type R = crate::R; -#[doc = "Writer for register CFGL"] -pub type W = crate::W; -#[doc = "Register CFGL `reset()`'s with value 0x0e00"] -impl crate::ResetValue for super::CFGL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0e00 +#[doc = "Register `CFGL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFGL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAX_ABRST` reader - Maximum AMBA Burst Length"] +pub struct MAX_ABRST_R(crate::FieldReader); +impl MAX_ABRST_R { + pub(crate) fn new(bits: u16) -> Self { + MAX_ABRST_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `MAX_ABRST`"] -pub type MAX_ABRST_R = crate::R; -#[doc = "Write proxy for field `MAX_ABRST`"] +impl core::ops::Deref for MAX_ABRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAX_ABRST` writer - Maximum AMBA Burst Length"] pub struct MAX_ABRST_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> MAX_ABRST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 20)) | (((value as u32) & 0x03ff) << 20); + self.w.bits = (self.w.bits & !(0x03ff << 20)) | ((value as u32 & 0x03ff) << 20); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRC_HS_POL`"] -pub type SRC_HS_POL_R = crate::R; +#[doc = "Field `SRC_HS_POL` reader - Source Handshaking Interface Polarity"] +pub struct SRC_HS_POL_R(crate::FieldReader); impl SRC_HS_POL_R { + pub(crate) fn new(bits: bool) -> Self { + SRC_HS_POL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRC_HS_POL_A { @@ -52,15 +91,22 @@ impl SRC_HS_POL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRC_HS_POL_A::VALUE1 + **self == SRC_HS_POL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRC_HS_POL_A::VALUE2 + **self == SRC_HS_POL_A::VALUE2 } } -#[doc = "Write proxy for field `SRC_HS_POL`"] +impl core::ops::Deref for SRC_HS_POL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_HS_POL` writer - Source Handshaking Interface Polarity"] pub struct SRC_HS_POL_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> SRC_HS_POL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRC_HS_POL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active high"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> SRC_HS_POL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -113,9 +157,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DST_HS_POL`"] -pub type DST_HS_POL_R = crate::R; +#[doc = "Field `DST_HS_POL` reader - Destination Handshaking Interface Polarity"] +pub struct DST_HS_POL_R(crate::FieldReader); impl DST_HS_POL_R { + pub(crate) fn new(bits: bool) -> Self { + DST_HS_POL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DST_HS_POL_A { @@ -127,15 +174,22 @@ impl DST_HS_POL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DST_HS_POL_A::VALUE1 + **self == DST_HS_POL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DST_HS_POL_A::VALUE2 + **self == DST_HS_POL_A::VALUE2 } } -#[doc = "Write proxy for field `DST_HS_POL`"] +impl core::ops::Deref for DST_HS_POL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DST_HS_POL` writer - Destination Handshaking Interface Polarity"] pub struct DST_HS_POL_W<'a> { w: &'a mut W, } @@ -143,9 +197,7 @@ impl<'a> DST_HS_POL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DST_HS_POL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active high"] #[inline(always)] @@ -170,13 +222,25 @@ impl<'a> DST_HS_POL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `LOCK_B`"] -pub type LOCK_B_R = crate::R; -#[doc = "Write proxy for field `LOCK_B`"] +#[doc = "Field `LOCK_B` reader - Bus Lock Bit"] +pub struct LOCK_B_R(crate::FieldReader); +impl LOCK_B_R { + pub(crate) fn new(bits: bool) -> Self { + LOCK_B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOCK_B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCK_B` writer - Bus Lock Bit"] pub struct LOCK_B_W<'a> { w: &'a mut W, } @@ -194,13 +258,25 @@ impl<'a> LOCK_B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `LOCK_CH`"] -pub type LOCK_CH_R = crate::R; -#[doc = "Write proxy for field `LOCK_CH`"] +#[doc = "Field `LOCK_CH` reader - Channel Lock Bit"] +pub struct LOCK_CH_R(crate::FieldReader); +impl LOCK_CH_R { + pub(crate) fn new(bits: bool) -> Self { + LOCK_CH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOCK_CH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCK_CH` writer - Channel Lock Bit"] pub struct LOCK_CH_W<'a> { w: &'a mut W, } @@ -218,7 +294,7 @@ impl<'a> LOCK_CH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -239,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LOCK_B_L`"] -pub type LOCK_B_L_R = crate::R; +#[doc = "Field `LOCK_B_L` reader - Bus Lock Level"] +pub struct LOCK_B_L_R(crate::FieldReader); impl LOCK_B_L_R { + pub(crate) fn new(bits: u8) -> Self { + LOCK_B_L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(LOCK_B_L_A::VALUE1), - 1 => Val(LOCK_B_L_A::VALUE2), - 2 => Val(LOCK_B_L_A::VALUE3), - i => Res(i), + 0 => Some(LOCK_B_L_A::VALUE1), + 1 => Some(LOCK_B_L_A::VALUE2), + 2 => Some(LOCK_B_L_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOCK_B_L_A::VALUE1 + **self == LOCK_B_L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOCK_B_L_A::VALUE2 + **self == LOCK_B_L_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LOCK_B_L_A::VALUE3 + **self == LOCK_B_L_A::VALUE3 } } -#[doc = "Write proxy for field `LOCK_B_L`"] +impl core::ops::Deref for LOCK_B_L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCK_B_L` writer - Bus Lock Level"] pub struct LOCK_B_L_W<'a> { w: &'a mut W, } @@ -297,7 +382,7 @@ impl<'a> LOCK_B_L_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -318,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LOCK_CH_L`"] -pub type LOCK_CH_L_R = crate::R; +#[doc = "Field `LOCK_CH_L` reader - Channel Lock Level"] +pub struct LOCK_CH_L_R(crate::FieldReader); impl LOCK_CH_L_R { + pub(crate) fn new(bits: u8) -> Self { + LOCK_CH_L_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(LOCK_CH_L_A::VALUE1), - 1 => Val(LOCK_CH_L_A::VALUE2), - 2 => Val(LOCK_CH_L_A::VALUE3), - i => Res(i), + 0 => Some(LOCK_CH_L_A::VALUE1), + 1 => Some(LOCK_CH_L_A::VALUE2), + 2 => Some(LOCK_CH_L_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOCK_CH_L_A::VALUE1 + **self == LOCK_CH_L_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOCK_CH_L_A::VALUE2 + **self == LOCK_CH_L_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LOCK_CH_L_A::VALUE3 + **self == LOCK_CH_L_A::VALUE3 + } +} +impl core::ops::Deref for LOCK_CH_L_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOCK_CH_L`"] +#[doc = "Field `LOCK_CH_L` writer - Channel Lock Level"] pub struct LOCK_CH_L_W<'a> { w: &'a mut W, } @@ -376,7 +470,7 @@ impl<'a> LOCK_CH_L_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -394,9 +488,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HS_SEL_SRC`"] -pub type HS_SEL_SRC_R = crate::R; +#[doc = "Field `HS_SEL_SRC` reader - Source Software or Hardware Handshaking Select"] +pub struct HS_SEL_SRC_R(crate::FieldReader); impl HS_SEL_SRC_R { + pub(crate) fn new(bits: bool) -> Self { + HS_SEL_SRC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HS_SEL_SRC_A { @@ -408,15 +505,22 @@ impl HS_SEL_SRC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HS_SEL_SRC_A::VALUE1 + **self == HS_SEL_SRC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HS_SEL_SRC_A::VALUE2 + **self == HS_SEL_SRC_A::VALUE2 + } +} +impl core::ops::Deref for HS_SEL_SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HS_SEL_SRC`"] +#[doc = "Field `HS_SEL_SRC` writer - Source Software or Hardware Handshaking Select"] pub struct HS_SEL_SRC_W<'a> { w: &'a mut W, } @@ -424,9 +528,7 @@ impl<'a> HS_SEL_SRC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HS_SEL_SRC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] @@ -451,7 +553,7 @@ impl<'a> HS_SEL_SRC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -469,9 +571,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HS_SEL_DST`"] -pub type HS_SEL_DST_R = crate::R; +#[doc = "Field `HS_SEL_DST` reader - Destination Software or Hardware Handshaking Select"] +pub struct HS_SEL_DST_R(crate::FieldReader); impl HS_SEL_DST_R { + pub(crate) fn new(bits: bool) -> Self { + HS_SEL_DST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HS_SEL_DST_A { @@ -483,15 +588,22 @@ impl HS_SEL_DST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HS_SEL_DST_A::VALUE1 + **self == HS_SEL_DST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HS_SEL_DST_A::VALUE2 + **self == HS_SEL_DST_A::VALUE2 + } +} +impl core::ops::Deref for HS_SEL_DST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HS_SEL_DST`"] +#[doc = "Field `HS_SEL_DST` writer - Destination Software or Hardware Handshaking Select"] pub struct HS_SEL_DST_W<'a> { w: &'a mut W, } @@ -499,9 +611,7 @@ impl<'a> HS_SEL_DST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HS_SEL_DST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] @@ -526,7 +636,7 @@ impl<'a> HS_SEL_DST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -544,9 +654,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FIFO_EMPTY`"] -pub type FIFO_EMPTY_R = crate::R; +#[doc = "Field `FIFO_EMPTY` reader - Indicates if there is data left in the channel FIFO"] +pub struct FIFO_EMPTY_R(crate::FieldReader); impl FIFO_EMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + FIFO_EMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FIFO_EMPTY_A { @@ -558,12 +671,19 @@ impl FIFO_EMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FIFO_EMPTY_A::VALUE1 + **self == FIFO_EMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FIFO_EMPTY_A::VALUE2 + **self == FIFO_EMPTY_A::VALUE2 + } +} +impl core::ops::Deref for FIFO_EMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Channel Suspend\n\nValue on reset: 0"] @@ -580,9 +700,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CH_SUSP`"] -pub type CH_SUSP_R = crate::R; +#[doc = "Field `CH_SUSP` reader - Channel Suspend"] +pub struct CH_SUSP_R(crate::FieldReader); impl CH_SUSP_R { + pub(crate) fn new(bits: bool) -> Self { + CH_SUSP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CH_SUSP_A { @@ -594,15 +717,22 @@ impl CH_SUSP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CH_SUSP_A::VALUE1 + **self == CH_SUSP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CH_SUSP_A::VALUE2 + **self == CH_SUSP_A::VALUE2 + } +} +impl core::ops::Deref for CH_SUSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CH_SUSP`"] +#[doc = "Field `CH_SUSP` writer - Channel Suspend"] pub struct CH_SUSP_W<'a> { w: &'a mut W, } @@ -610,9 +740,7 @@ impl<'a> CH_SUSP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CH_SUSP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not suspended."] #[inline(always)] @@ -637,13 +765,25 @@ impl<'a> CH_SUSP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `CH_PRIOR`"] -pub type CH_PRIOR_R = crate::R; -#[doc = "Write proxy for field `CH_PRIOR`"] +#[doc = "Field `CH_PRIOR` reader - Channel priority"] +pub struct CH_PRIOR_R(crate::FieldReader); +impl CH_PRIOR_R { + pub(crate) fn new(bits: u8) -> Self { + CH_PRIOR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CH_PRIOR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH_PRIOR` writer - Channel priority"] pub struct CH_PRIOR_W<'a> { w: &'a mut W, } @@ -651,7 +791,7 @@ impl<'a> CH_PRIOR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 5)) | (((value as u32) & 0x07) << 5); + self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u32 & 0x07) << 5); self.w } } @@ -773,4 +913,30 @@ impl W { pub fn ch_prior(&mut self) -> CH_PRIOR_W { CH_PRIOR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration Register Low\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 [cfgl](index.html) module"] +pub struct CFGL_SPEC; +impl crate::RegisterSpec for CFGL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfgl::R](R) reader structure"] +impl crate::Readable for CFGL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfgl::W](W) writer structure"] +impl crate::Writable for CFGL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFGL to value 0x0e00"] +impl crate::Resettable for CFGL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0e00 + } } diff --git a/src/gpdma0_ch2/ctlh.rs b/src/gpdma0_ch2/ctlh.rs index 2a88927e..4215e3db 100644 --- a/src/gpdma0_ch2/ctlh.rs +++ b/src/gpdma0_ch2/ctlh.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTLH"] -pub type R = crate::R; -#[doc = "Writer for register CTLH"] -pub type W = crate::W; -#[doc = "Register CTLH `reset()`'s with value 0x02"] -impl crate::ResetValue for super::CTLH { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x02 +#[doc = "Register `CTLH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `DONE`"] -pub type DONE_R = crate::R; -#[doc = "Write proxy for field `DONE`"] +#[doc = "Register `CTLH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DONE` reader - Done bit"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DONE` writer - Done bit"] pub struct DONE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> DONE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `BLOCK_TS`"] -pub type BLOCK_TS_R = crate::R; -#[doc = "Write proxy for field `BLOCK_TS`"] +#[doc = "Field `BLOCK_TS` reader - Block Transfer Size"] +pub struct BLOCK_TS_R(crate::FieldReader); +impl BLOCK_TS_R { + pub(crate) fn new(bits: u16) -> Self { + BLOCK_TS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLOCK_TS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLOCK_TS` writer - Block Transfer Size"] pub struct BLOCK_TS_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> BLOCK_TS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } @@ -71,4 +119,30 @@ impl W { pub fn block_ts(&mut self) -> BLOCK_TS_W { BLOCK_TS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control Register High\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 [ctlh](index.html) module"] +pub struct CTLH_SPEC; +impl crate::RegisterSpec for CTLH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctlh::R](R) reader structure"] +impl crate::Readable for CTLH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctlh::W](W) writer structure"] +impl crate::Writable for CTLH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTLH to value 0x02"] +impl crate::Resettable for CTLH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } } diff --git a/src/gpdma0_ch2/ctll.rs b/src/gpdma0_ch2/ctll.rs index 88b80f7f..601dedef 100644 --- a/src/gpdma0_ch2/ctll.rs +++ b/src/gpdma0_ch2/ctll.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTLL"] -pub type R = crate::R; -#[doc = "Writer for register CTLL"] -pub type W = crate::W; -#[doc = "Register CTLL `reset()`'s with value 0x0030_4801"] -impl crate::ResetValue for super::CTLL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0030_4801 +#[doc = "Register `CTLL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTLL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TT_FC` reader - Transfer Type and Flow Control"] +pub struct TT_FC_R(crate::FieldReader); +impl TT_FC_R { + pub(crate) fn new(bits: u8) -> Self { + TT_FC_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `TT_FC`"] -pub type TT_FC_R = crate::R; -#[doc = "Write proxy for field `TT_FC`"] +impl core::ops::Deref for TT_FC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TT_FC` writer - Transfer Type and Flow Control"] pub struct TT_FC_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> TT_FC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `SRC_MSIZE`"] -pub type SRC_MSIZE_R = crate::R; -#[doc = "Write proxy for field `SRC_MSIZE`"] +#[doc = "Field `SRC_MSIZE` reader - Source Burst Transaction Length"] +pub struct SRC_MSIZE_R(crate::FieldReader); +impl SRC_MSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_MSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_MSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_MSIZE` writer - Source Burst Transaction Length"] pub struct SRC_MSIZE_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> SRC_MSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 14)) | (((value as u32) & 0x07) << 14); + self.w.bits = (self.w.bits & !(0x07 << 14)) | ((value as u32 & 0x07) << 14); self.w } } -#[doc = "Reader of field `DEST_MSIZE`"] -pub type DEST_MSIZE_R = crate::R; -#[doc = "Write proxy for field `DEST_MSIZE`"] +#[doc = "Field `DEST_MSIZE` reader - Destination Burst Transaction Length"] +pub struct DEST_MSIZE_R(crate::FieldReader); +impl DEST_MSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + DEST_MSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEST_MSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DEST_MSIZE` writer - Destination Burst Transaction Length"] pub struct DEST_MSIZE_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> DEST_MSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 11)) | (((value as u32) & 0x07) << 11); + self.w.bits = (self.w.bits & !(0x07 << 11)) | ((value as u32 & 0x07) << 11); self.w } } @@ -69,37 +129,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SINC`"] -pub type SINC_R = crate::R; +#[doc = "Field `SINC` reader - Source Address Increment"] +pub struct SINC_R(crate::FieldReader); impl SINC_R { + pub(crate) fn new(bits: u8) -> Self { + SINC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SINC_A::VALUE1), - 1 => Val(SINC_A::VALUE2), - 2 => Val(SINC_A::VALUE3), - i => Res(i), + 0 => Some(SINC_A::VALUE1), + 1 => Some(SINC_A::VALUE2), + 2 => Some(SINC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SINC_A::VALUE1 + **self == SINC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SINC_A::VALUE2 + **self == SINC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SINC_A::VALUE3 + **self == SINC_A::VALUE3 } } -#[doc = "Write proxy for field `SINC`"] +impl core::ops::Deref for SINC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SINC` writer - Source Address Increment"] pub struct SINC_W<'a> { w: &'a mut W, } @@ -127,7 +196,7 @@ impl<'a> SINC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 9)) | (((value as u32) & 0x03) << 9); + self.w.bits = (self.w.bits & !(0x03 << 9)) | ((value as u32 & 0x03) << 9); self.w } } @@ -148,37 +217,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DINC`"] -pub type DINC_R = crate::R; +#[doc = "Field `DINC` reader - Destination Address Increment"] +pub struct DINC_R(crate::FieldReader); impl DINC_R { + pub(crate) fn new(bits: u8) -> Self { + DINC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DINC_A::VALUE1), - 1 => Val(DINC_A::VALUE2), - 2 => Val(DINC_A::VALUE3), - i => Res(i), + 0 => Some(DINC_A::VALUE1), + 1 => Some(DINC_A::VALUE2), + 2 => Some(DINC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DINC_A::VALUE1 + **self == DINC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DINC_A::VALUE2 + **self == DINC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DINC_A::VALUE3 + **self == DINC_A::VALUE3 + } +} +impl core::ops::Deref for DINC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DINC`"] +#[doc = "Field `DINC` writer - Destination Address Increment"] pub struct DINC_W<'a> { w: &'a mut W, } @@ -206,13 +284,25 @@ impl<'a> DINC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 7)) | (((value as u32) & 0x03) << 7); + self.w.bits = (self.w.bits & !(0x03 << 7)) | ((value as u32 & 0x03) << 7); self.w } } -#[doc = "Reader of field `SRC_TR_WIDTH`"] -pub type SRC_TR_WIDTH_R = crate::R; -#[doc = "Write proxy for field `SRC_TR_WIDTH`"] +#[doc = "Field `SRC_TR_WIDTH` reader - Source Transfer Width"] +pub struct SRC_TR_WIDTH_R(crate::FieldReader); +impl SRC_TR_WIDTH_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_TR_WIDTH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SRC_TR_WIDTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC_TR_WIDTH` writer - Source Transfer Width"] pub struct SRC_TR_WIDTH_W<'a> { w: &'a mut W, } @@ -220,13 +310,25 @@ impl<'a> SRC_TR_WIDTH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `DST_TR_WIDTH`"] -pub type DST_TR_WIDTH_R = crate::R; -#[doc = "Write proxy for field `DST_TR_WIDTH`"] +#[doc = "Field `DST_TR_WIDTH` reader - Destination Transfer Width"] +pub struct DST_TR_WIDTH_R(crate::FieldReader); +impl DST_TR_WIDTH_R { + pub(crate) fn new(bits: u8) -> Self { + DST_TR_WIDTH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DST_TR_WIDTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DST_TR_WIDTH` writer - Destination Transfer Width"] pub struct DST_TR_WIDTH_W<'a> { w: &'a mut W, } @@ -234,13 +336,25 @@ impl<'a> DST_TR_WIDTH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 1)) | (((value as u32) & 0x07) << 1); + self.w.bits = (self.w.bits & !(0x07 << 1)) | ((value as u32 & 0x07) << 1); self.w } } -#[doc = "Reader of field `INT_EN`"] -pub type INT_EN_R = crate::R; -#[doc = "Write proxy for field `INT_EN`"] +#[doc = "Field `INT_EN` reader - Interrupt Enable Bit"] +pub struct INT_EN_R(crate::FieldReader); +impl INT_EN_R { + pub(crate) fn new(bits: bool) -> Self { + INT_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INT_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INT_EN` writer - Interrupt Enable Bit"] pub struct INT_EN_W<'a> { w: &'a mut W, } @@ -258,7 +372,7 @@ impl<'a> INT_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -345,4 +459,30 @@ impl W { pub fn int_en(&mut self) -> INT_EN_W { INT_EN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control Register Low\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 [ctll](index.html) module"] +pub struct CTLL_SPEC; +impl crate::RegisterSpec for CTLL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctll::R](R) reader structure"] +impl crate::Readable for CTLL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctll::W](W) writer structure"] +impl crate::Writable for CTLL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTLL to value 0x0030_4801"] +impl crate::Resettable for CTLL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0030_4801 + } } diff --git a/src/gpdma0_ch2/dar.rs b/src/gpdma0_ch2/dar.rs index 0b70269c..e9da057f 100644 --- a/src/gpdma0_ch2/dar.rs +++ b/src/gpdma0_ch2/dar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAR"] -pub type R = crate::R; -#[doc = "Writer for register DAR"] -pub type W = crate::W; -#[doc = "Register DAR `reset()`'s with value 0"] -impl crate::ResetValue for super::DAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DAR`"] -pub type DAR_R = crate::R; -#[doc = "Write proxy for field `DAR`"] +#[doc = "Field `DAR` reader - Current Destination address of DMA transfer"] +pub struct DAR_R(crate::FieldReader); +impl DAR_R { + pub(crate) fn new(bits: u32) -> Self { + DAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAR` writer - Current Destination address of DMA transfer"] pub struct DAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dar(&mut self) -> DAR_W { DAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Destination Address Register\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 [dar](index.html) module"] +pub struct DAR_SPEC; +impl crate::RegisterSpec for DAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dar::R](R) reader structure"] +impl crate::Readable for DAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dar::W](W) writer structure"] +impl crate::Writable for DAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAR to value 0"] +impl crate::Resettable for DAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/gpdma0_ch2/sar.rs b/src/gpdma0_ch2/sar.rs index 4674107c..7b86cf01 100644 --- a/src/gpdma0_ch2/sar.rs +++ b/src/gpdma0_ch2/sar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SAR"] -pub type R = crate::R; -#[doc = "Writer for register SAR"] -pub type W = crate::W; -#[doc = "Register SAR `reset()`'s with value 0"] -impl crate::ResetValue for super::SAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SAR`"] -pub type SAR_R = crate::R; -#[doc = "Write proxy for field `SAR`"] +#[doc = "Field `SAR` reader - Current Source Address of DMA transfer"] +pub struct SAR_R(crate::FieldReader); +impl SAR_R { + pub(crate) fn new(bits: u32) -> Self { + SAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAR` writer - Current Source Address of DMA transfer"] pub struct SAR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SAR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sar(&mut self) -> SAR_W { SAR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Address Register\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 [sar](index.html) module"] +pub struct SAR_SPEC; +impl crate::RegisterSpec for SAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sar::R](R) reader structure"] +impl crate::Readable for SAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sar::W](W) writer structure"] +impl crate::Writable for SAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SAR to value 0"] +impl crate::Resettable for SAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0.rs b/src/hrpwm0.rs index 3ca62923..6d79a6ed 100644 --- a/src/hrpwm0.rs +++ b/src/hrpwm0.rs @@ -2,202 +2,109 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Bias and suspend configuration"] - pub hrbsc: HRBSC, - _reserved1: [u8; 4usize], + pub hrbsc: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Module identification register"] - pub midr: MIDR, - _reserved2: [u8; 8usize], + pub midr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x14 - Global Analog Configuration"] - pub glbana: GLBANA, - _reserved3: [u8; 8usize], + pub glbana: crate::Reg, + _reserved3: [u8; 0x08], #[doc = "0x20 - Global CSG configuration"] - pub csgcfg: CSGCFG, + pub csgcfg: crate::Reg, #[doc = "0x24 - Global CSG run bit set"] - pub csgsetg: CSGSETG, + pub csgsetg: crate::Reg, #[doc = "0x28 - Global CSG run bit clear"] - pub csgclrg: CSGCLRG, + pub csgclrg: crate::Reg, #[doc = "0x2c - Global CSG run bit status"] - pub csgstatg: CSGSTATG, + pub csgstatg: crate::Reg, #[doc = "0x30 - Global CSG slope/prescaler control"] - pub csgfcg: CSGFCG, + pub csgfcg: crate::Reg, #[doc = "0x34 - Global CSG slope/prescaler status"] - pub csgfsg: CSGFSG, + pub csgfsg: crate::Reg, #[doc = "0x38 - Global CSG shadow/switch trigger"] - pub csgtrg: CSGTRG, + pub csgtrg: crate::Reg, #[doc = "0x3c - Global CSG shadow trigger clear"] - pub csgtrc: CSGTRC, + pub csgtrc: crate::Reg, #[doc = "0x40 - Global CSG shadow/switch status"] - pub csgtrsg: CSGTRSG, - _reserved12: [u8; 28usize], + pub csgtrsg: crate::Reg, + _reserved12: [u8; 0x1c], #[doc = "0x60 - Global HRC configuration"] - pub hrccfg: HRCCFG, + pub hrccfg: crate::Reg, #[doc = "0x64 - Global HRC shadow trigger set"] - pub hrcstrg: HRCSTRG, + pub hrcstrg: crate::Reg, #[doc = "0x68 - Global HRC shadow trigger clear"] - pub hrcctrg: HRCCTRG, + pub hrcctrg: crate::Reg, #[doc = "0x6c - Global HRC shadow transfer status"] - pub hrcstsg: HRCSTSG, + pub hrcstsg: crate::Reg, #[doc = "0x70 - High Resolution Generation Status"] - pub hrghrs: HRGHRS, + pub hrghrs: crate::Reg, } -#[doc = "Bias and suspend configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrbsc](hrbsc) module"] -pub type HRBSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRBSC; -#[doc = "`read()` method returns [hrbsc::R](hrbsc::R) reader structure"] -impl crate::Readable for HRBSC {} -#[doc = "`write(|w| ..)` method takes [hrbsc::W](hrbsc::W) writer structure"] -impl crate::Writable for HRBSC {} +#[doc = "HRBSC register accessor: an alias for `Reg`"] +pub type HRBSC = crate::Reg; #[doc = "Bias and suspend configuration"] pub mod hrbsc; -#[doc = "Module identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](midr) module"] -pub type MIDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIDR; -#[doc = "`read()` method returns [midr::R](midr::R) reader structure"] -impl crate::Readable for MIDR {} +#[doc = "MIDR register accessor: an alias for `Reg`"] +pub type MIDR = crate::Reg; #[doc = "Module identification register"] pub mod midr; -#[doc = "Global Analog Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [glbana](glbana) module"] -pub type GLBANA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLBANA; -#[doc = "`read()` method returns [glbana::R](glbana::R) reader structure"] -impl crate::Readable for GLBANA {} -#[doc = "`write(|w| ..)` method takes [glbana::W](glbana::W) writer structure"] -impl crate::Writable for GLBANA {} +#[doc = "GLBANA register accessor: an alias for `Reg`"] +pub type GLBANA = crate::Reg; #[doc = "Global Analog Configuration"] pub mod glbana; -#[doc = "Global CSG configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgcfg](csgcfg) module"] -pub type CSGCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGCFG; -#[doc = "`read()` method returns [csgcfg::R](csgcfg::R) reader structure"] -impl crate::Readable for CSGCFG {} -#[doc = "`write(|w| ..)` method takes [csgcfg::W](csgcfg::W) writer structure"] -impl crate::Writable for CSGCFG {} +#[doc = "CSGCFG register accessor: an alias for `Reg`"] +pub type CSGCFG = crate::Reg; #[doc = "Global CSG configuration"] pub mod csgcfg; -#[doc = "Global CSG run bit set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgsetg](csgsetg) module"] -pub type CSGSETG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGSETG; -#[doc = "`write(|w| ..)` method takes [csgsetg::W](csgsetg::W) writer structure"] -impl crate::Writable for CSGSETG {} +#[doc = "CSGSETG register accessor: an alias for `Reg`"] +pub type CSGSETG = crate::Reg; #[doc = "Global CSG run bit set"] pub mod csgsetg; -#[doc = "Global CSG run bit clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgclrg](csgclrg) module"] -pub type CSGCLRG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGCLRG; -#[doc = "`write(|w| ..)` method takes [csgclrg::W](csgclrg::W) writer structure"] -impl crate::Writable for CSGCLRG {} +#[doc = "CSGCLRG register accessor: an alias for `Reg`"] +pub type CSGCLRG = crate::Reg; #[doc = "Global CSG run bit clear"] pub mod csgclrg; -#[doc = "Global CSG run bit status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgstatg](csgstatg) module"] -pub type CSGSTATG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGSTATG; -#[doc = "`read()` method returns [csgstatg::R](csgstatg::R) reader structure"] -impl crate::Readable for CSGSTATG {} +#[doc = "CSGSTATG register accessor: an alias for `Reg`"] +pub type CSGSTATG = crate::Reg; #[doc = "Global CSG run bit status"] pub mod csgstatg; -#[doc = "Global CSG slope/prescaler control\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgfcg](csgfcg) module"] -pub type CSGFCG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGFCG; -#[doc = "`write(|w| ..)` method takes [csgfcg::W](csgfcg::W) writer structure"] -impl crate::Writable for CSGFCG {} +#[doc = "CSGFCG register accessor: an alias for `Reg`"] +pub type CSGFCG = crate::Reg; #[doc = "Global CSG slope/prescaler control"] pub mod csgfcg; -#[doc = "Global CSG slope/prescaler status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgfsg](csgfsg) module"] -pub type CSGFSG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGFSG; -#[doc = "`read()` method returns [csgfsg::R](csgfsg::R) reader structure"] -impl crate::Readable for CSGFSG {} +#[doc = "CSGFSG register accessor: an alias for `Reg`"] +pub type CSGFSG = crate::Reg; #[doc = "Global CSG slope/prescaler status"] pub mod csgfsg; -#[doc = "Global CSG shadow/switch trigger\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrg](csgtrg) module"] -pub type CSGTRG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGTRG; -#[doc = "`write(|w| ..)` method takes [csgtrg::W](csgtrg::W) writer structure"] -impl crate::Writable for CSGTRG {} +#[doc = "CSGTRG register accessor: an alias for `Reg`"] +pub type CSGTRG = crate::Reg; #[doc = "Global CSG shadow/switch trigger"] pub mod csgtrg; -#[doc = "Global CSG shadow trigger clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrc](csgtrc) module"] -pub type CSGTRC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGTRC; -#[doc = "`write(|w| ..)` method takes [csgtrc::W](csgtrc::W) writer structure"] -impl crate::Writable for CSGTRC {} +#[doc = "CSGTRC register accessor: an alias for `Reg`"] +pub type CSGTRC = crate::Reg; #[doc = "Global CSG shadow trigger clear"] pub mod csgtrc; -#[doc = "Global CSG shadow/switch status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrsg](csgtrsg) module"] -pub type CSGTRSG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CSGTRSG; -#[doc = "`read()` method returns [csgtrsg::R](csgtrsg::R) reader structure"] -impl crate::Readable for CSGTRSG {} +#[doc = "CSGTRSG register accessor: an alias for `Reg`"] +pub type CSGTRSG = crate::Reg; #[doc = "Global CSG shadow/switch status"] pub mod csgtrsg; -#[doc = "Global HRC configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrccfg](hrccfg) module"] -pub type HRCCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRCCFG; -#[doc = "`read()` method returns [hrccfg::R](hrccfg::R) reader structure"] -impl crate::Readable for HRCCFG {} -#[doc = "`write(|w| ..)` method takes [hrccfg::W](hrccfg::W) writer structure"] -impl crate::Writable for HRCCFG {} +#[doc = "HRCCFG register accessor: an alias for `Reg`"] +pub type HRCCFG = crate::Reg; #[doc = "Global HRC configuration"] pub mod hrccfg; -#[doc = "Global HRC shadow trigger set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcstrg](hrcstrg) module"] -pub type HRCSTRG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRCSTRG; -#[doc = "`write(|w| ..)` method takes [hrcstrg::W](hrcstrg::W) writer structure"] -impl crate::Writable for HRCSTRG {} +#[doc = "HRCSTRG register accessor: an alias for `Reg`"] +pub type HRCSTRG = crate::Reg; #[doc = "Global HRC shadow trigger set"] pub mod hrcstrg; -#[doc = "Global HRC shadow trigger clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcctrg](hrcctrg) module"] -pub type HRCCTRG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRCCTRG; -#[doc = "`write(|w| ..)` method takes [hrcctrg::W](hrcctrg::W) writer structure"] -impl crate::Writable for HRCCTRG {} +#[doc = "HRCCTRG register accessor: an alias for `Reg`"] +pub type HRCCTRG = crate::Reg; #[doc = "Global HRC shadow trigger clear"] pub mod hrcctrg; -#[doc = "Global HRC shadow transfer status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcstsg](hrcstsg) module"] -pub type HRCSTSG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRCSTSG; -#[doc = "`read()` method returns [hrcstsg::R](hrcstsg::R) reader structure"] -impl crate::Readable for HRCSTSG {} +#[doc = "HRCSTSG register accessor: an alias for `Reg`"] +pub type HRCSTSG = crate::Reg; #[doc = "Global HRC shadow transfer status"] pub mod hrcstsg; -#[doc = "High Resolution Generation Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrghrs](hrghrs) module"] -pub type HRGHRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HRGHRS; -#[doc = "`read()` method returns [hrghrs::R](hrghrs::R) reader structure"] -impl crate::Readable for HRGHRS {} +#[doc = "HRGHRS register accessor: an alias for `Reg`"] +pub type HRGHRS = crate::Reg; #[doc = "High Resolution Generation Status"] pub mod hrghrs; diff --git a/src/hrpwm0/csgcfg.rs b/src/hrpwm0/csgcfg.rs index 58cf07bd..ec13eab9 100644 --- a/src/hrpwm0/csgcfg.rs +++ b/src/hrpwm0/csgcfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CSGCFG"] -pub type R = crate::R; -#[doc = "Writer for register CSGCFG"] -pub type W = crate::W; -#[doc = "Register CSGCFG `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CSGCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CSGCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "CSG0 Power Mode\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C0PM`"] -pub type C0PM_R = crate::R; +#[doc = "Field `C0PM` reader - CSG0 Power Mode"] +pub struct C0PM_R(crate::FieldReader); impl C0PM_R { + pub(crate) fn new(bits: u8) -> Self { + C0PM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C0PM_A::VALUE1), - 1 => Val(C0PM_A::VALUE2), - 3 => Val(C0PM_A::VALUE4), - i => Res(i), + 0 => Some(C0PM_A::VALUE1), + 1 => Some(C0PM_A::VALUE2), + 3 => Some(C0PM_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0PM_A::VALUE1 + **self == C0PM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0PM_A::VALUE2 + **self == C0PM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == C0PM_A::VALUE4 + **self == C0PM_A::VALUE4 + } +} +impl core::ops::Deref for C0PM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `C0PM`"] +#[doc = "Field `C0PM` writer - CSG0 Power Mode"] pub struct C0PM_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> C0PM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C1PM`"] -pub type C1PM_R = crate::R; +#[doc = "Field `C1PM` reader - CSG1 Power Mode"] +pub struct C1PM_R(crate::FieldReader); impl C1PM_R { + pub(crate) fn new(bits: u8) -> Self { + C1PM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C1PM_A::VALUE1), - 1 => Val(C1PM_A::VALUE2), - 3 => Val(C1PM_A::VALUE4), - i => Res(i), + 0 => Some(C1PM_A::VALUE1), + 1 => Some(C1PM_A::VALUE2), + 3 => Some(C1PM_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1PM_A::VALUE1 + **self == C1PM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1PM_A::VALUE2 + **self == C1PM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == C1PM_A::VALUE4 + **self == C1PM_A::VALUE4 } } -#[doc = "Write proxy for field `C1PM`"] +impl core::ops::Deref for C1PM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C1PM` writer - CSG1 Power Mode"] pub struct C1PM_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> C1PM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C2PM`"] -pub type C2PM_R = crate::R; +#[doc = "Field `C2PM` reader - CSG2 Power Mode"] +pub struct C2PM_R(crate::FieldReader); impl C2PM_R { + pub(crate) fn new(bits: u8) -> Self { + C2PM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C2PM_A::VALUE1), - 1 => Val(C2PM_A::VALUE2), - 3 => Val(C2PM_A::VALUE4), - i => Res(i), + 0 => Some(C2PM_A::VALUE1), + 1 => Some(C2PM_A::VALUE2), + 3 => Some(C2PM_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C2PM_A::VALUE1 + **self == C2PM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C2PM_A::VALUE2 + **self == C2PM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == C2PM_A::VALUE4 + **self == C2PM_A::VALUE4 + } +} +impl core::ops::Deref for C2PM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `C2PM`"] +#[doc = "Field `C2PM` writer - CSG2 Power Mode"] pub struct C2PM_W<'a> { w: &'a mut W, } @@ -243,13 +294,25 @@ impl<'a> C2PM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } -#[doc = "Reader of field `C0CD`"] -pub type C0CD_R = crate::R; -#[doc = "Write proxy for field `C0CD`"] +#[doc = "Field `C0CD` reader - CSG0 Clock disable"] +pub struct C0CD_R(crate::FieldReader); +impl C0CD_R { + pub(crate) fn new(bits: bool) -> Self { + C0CD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C0CD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C0CD` writer - CSG0 Clock disable"] pub struct C0CD_W<'a> { w: &'a mut W, } @@ -267,13 +330,25 @@ impl<'a> C0CD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `C1CD`"] -pub type C1CD_R = crate::R; -#[doc = "Write proxy for field `C1CD`"] +#[doc = "Field `C1CD` reader - CSG1 Clock disable"] +pub struct C1CD_R(crate::FieldReader); +impl C1CD_R { + pub(crate) fn new(bits: bool) -> Self { + C1CD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C1CD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C1CD` writer - CSG1 Clock disable"] pub struct C1CD_W<'a> { w: &'a mut W, } @@ -291,13 +366,25 @@ impl<'a> C1CD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `C2CD`"] -pub type C2CD_R = crate::R; -#[doc = "Write proxy for field `C2CD`"] +#[doc = "Field `C2CD` reader - CSG2 Clock disable"] +pub struct C2CD_R(crate::FieldReader); +impl C2CD_R { + pub(crate) fn new(bits: bool) -> Self { + C2CD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C2CD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C2CD` writer - CSG2 Clock disable"] pub struct C2CD_W<'a> { w: &'a mut W, } @@ -315,7 +402,7 @@ impl<'a> C2CD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -382,4 +469,30 @@ impl W { pub fn c2cd(&mut self) -> C2CD_W { C2CD_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG configuration\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 [csgcfg](index.html) module"] +pub struct CSGCFG_SPEC; +impl crate::RegisterSpec for CSGCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [csgcfg::R](R) reader structure"] +impl crate::Readable for CSGCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [csgcfg::W](W) writer structure"] +impl crate::Writable for CSGCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGCFG to value 0"] +impl crate::Resettable for CSGCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgclrg.rs b/src/hrpwm0/csgclrg.rs index 2e5653ee..035608dc 100644 --- a/src/hrpwm0/csgclrg.rs +++ b/src/hrpwm0/csgclrg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CSGCLRG"] -pub type W = crate::W; -#[doc = "Register CSGCLRG `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGCLRG { - type Type = u32; +#[doc = "Register `CSGCLRG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `CD0R`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CD0R` writer - DAC0 run bit clear"] pub struct CD0R_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> CD0R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `CC0R`"] +#[doc = "Field `CC0R` writer - CMP0 run bit clear"] pub struct CC0R_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> CC0R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `CC0P`"] +#[doc = "Field `CC0P` writer - CMP0 passive level clear"] pub struct CC0P_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> CC0P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `CD1R`"] +#[doc = "Field `CD1R` writer - DAC1 run bit clear"] pub struct CD1R_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> CD1R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `CC1R`"] +#[doc = "Field `CC1R` writer - CMP1 run bit clear"] pub struct CC1R_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> CC1R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `CC1P`"] +#[doc = "Field `CC1P` writer - CMP1 passive level clear"] pub struct CC1P_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> CC1P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `CD2R`"] +#[doc = "Field `CD2R` writer - DAC2 run bit clear"] pub struct CD2R_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> CD2R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `CC2R`"] +#[doc = "Field `CC2R` writer - CMP2 run bit clear"] pub struct CC2R_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> CC2R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `CC2P`"] +#[doc = "Field `CC2P` writer - CMP2 passive level clear"] pub struct CC2P_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> CC2P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn cc2p(&mut self) -> CC2P_W { CC2P_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG run bit clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgclrg](index.html) module"] +pub struct CSGCLRG_SPEC; +impl crate::RegisterSpec for CSGCLRG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [csgclrg::W](W) writer structure"] +impl crate::Writable for CSGCLRG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGCLRG to value 0"] +impl crate::Resettable for CSGCLRG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgfcg.rs b/src/hrpwm0/csgfcg.rs index 68842311..7c854d9b 100644 --- a/src/hrpwm0/csgfcg.rs +++ b/src/hrpwm0/csgfcg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CSGFCG"] -pub type W = crate::W; -#[doc = "Register CSGFCG `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGFCG { - type Type = u32; +#[doc = "Register `CSGFCG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `S0STR`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `S0STR` writer - Slope 0 start"] pub struct S0STR_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> S0STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `S0STP`"] +#[doc = "Field `S0STP` writer - Slope 0 stop"] pub struct S0STP_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> S0STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS0STR`"] +#[doc = "Field `PS0STR` writer - Prescaler 0 start"] pub struct PS0STR_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS0STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS0STP`"] +#[doc = "Field `PS0STP` writer - Prescaler 0 stop"] pub struct PS0STP_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS0STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS0CLR`"] +#[doc = "Field `PS0CLR` writer - Prescaler 0 clear"] pub struct PS0CLR_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS0CLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `S1STR`"] +#[doc = "Field `S1STR` writer - Slope 1 start"] pub struct S1STR_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> S1STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `S1STP`"] +#[doc = "Field `S1STP` writer - Slope 1 stop"] pub struct S1STP_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> S1STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS1STR`"] +#[doc = "Field `PS1STR` writer - Prescaler 1 start"] pub struct PS1STR_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS1STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS1STP`"] +#[doc = "Field `PS1STP` writer - Prescaler 1 stop"] pub struct PS1STP_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS1STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS1CLR`"] +#[doc = "Field `PS1CLR` writer - Prescaler 1 clear"] pub struct PS1CLR_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS1CLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `S2STR`"] +#[doc = "Field `S2STR` writer - Slope 2 start"] pub struct S2STR_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> S2STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `S2STP`"] +#[doc = "Field `S2STP` writer - Slope 2 stop"] pub struct S2STP_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> S2STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PS2STR`"] +#[doc = "Field `PS2STR` writer - Prescaler 2 start"] pub struct PS2STR_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS2STR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PS2STP`"] +#[doc = "Field `PS2STP` writer - Prescaler 2 stop"] pub struct PS2STP_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS2STP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PS2CLR`"] +#[doc = "Field `PS2CLR` writer - Prescaler 2 clear"] pub struct PS2CLR_W<'a> { w: &'a mut W, } @@ -334,7 +345,7 @@ impl<'a> PS2CLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -414,4 +425,26 @@ impl W { pub fn ps2clr(&mut self) -> PS2CLR_W { PS2CLR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG slope/prescaler control\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgfcg](index.html) module"] +pub struct CSGFCG_SPEC; +impl crate::RegisterSpec for CSGFCG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [csgfcg::W](W) writer structure"] +impl crate::Writable for CSGFCG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGFCG to value 0"] +impl crate::Resettable for CSGFCG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgfsg.rs b/src/hrpwm0/csgfsg.rs index 8ec83893..32a60393 100644 --- a/src/hrpwm0/csgfsg.rs +++ b/src/hrpwm0/csgfsg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CSGFSG"] -pub type R = crate::R; +#[doc = "Register `CSGFSG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "DAC0 slope generation status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum S0RB_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S0RB`"] -pub type S0RB_R = crate::R; +#[doc = "Field `S0RB` reader - DAC0 slope generation status"] +pub struct S0RB_R(crate::FieldReader); impl S0RB_R { + pub(crate) fn new(bits: bool) -> Self { + S0RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0RB_A { @@ -28,12 +44,19 @@ impl S0RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0RB_A::VALUE1 + **self == S0RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0RB_A::VALUE2 + **self == S0RB_A::VALUE2 + } +} +impl core::ops::Deref for S0RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CSG0 prescaler status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0RB`"] -pub type P0RB_R = crate::R; +#[doc = "Field `P0RB` reader - CSG0 prescaler status"] +pub struct P0RB_R(crate::FieldReader); impl P0RB_R { + pub(crate) fn new(bits: bool) -> Self { + P0RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0RB_A { @@ -64,12 +90,19 @@ impl P0RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0RB_A::VALUE1 + **self == P0RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0RB_A::VALUE2 + **self == P0RB_A::VALUE2 + } +} +impl core::ops::Deref for P0RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC1 slope generation status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S1RB`"] -pub type S1RB_R = crate::R; +#[doc = "Field `S1RB` reader - DAC1 slope generation status"] +pub struct S1RB_R(crate::FieldReader); impl S1RB_R { + pub(crate) fn new(bits: bool) -> Self { + S1RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1RB_A { @@ -100,12 +136,19 @@ impl S1RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1RB_A::VALUE1 + **self == S1RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1RB_A::VALUE2 + **self == S1RB_A::VALUE2 + } +} +impl core::ops::Deref for S1RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CSG1 prescaler status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1RB`"] -pub type P1RB_R = crate::R; +#[doc = "Field `P1RB` reader - CSG1 prescaler status"] +pub struct P1RB_R(crate::FieldReader); impl P1RB_R { + pub(crate) fn new(bits: bool) -> Self { + P1RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1RB_A { @@ -136,12 +182,19 @@ impl P1RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1RB_A::VALUE1 + **self == P1RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1RB_A::VALUE2 + **self == P1RB_A::VALUE2 + } +} +impl core::ops::Deref for P1RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC2 slope generation status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `S2RB`"] -pub type S2RB_R = crate::R; +#[doc = "Field `S2RB` reader - DAC2 slope generation status"] +pub struct S2RB_R(crate::FieldReader); impl S2RB_R { + pub(crate) fn new(bits: bool) -> Self { + S2RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S2RB_A { @@ -172,12 +228,19 @@ impl S2RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S2RB_A::VALUE1 + **self == S2RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S2RB_A::VALUE2 + **self == S2RB_A::VALUE2 + } +} +impl core::ops::Deref for S2RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CSG2 prescaler status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2RB`"] -pub type P2RB_R = crate::R; +#[doc = "Field `P2RB` reader - CSG2 prescaler status"] +pub struct P2RB_R(crate::FieldReader); impl P2RB_R { + pub(crate) fn new(bits: bool) -> Self { + P2RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2RB_A { @@ -208,12 +274,19 @@ impl P2RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2RB_A::VALUE1 + **self == P2RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2RB_A::VALUE2 + **self == P2RB_A::VALUE2 + } +} +impl core::ops::Deref for P2RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -248,3 +321,19 @@ impl R { P2RB_R::new(((self.bits >> 17) & 0x01) != 0) } } +#[doc = "Global CSG slope/prescaler status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgfsg](index.html) module"] +pub struct CSGFSG_SPEC; +impl crate::RegisterSpec for CSGFSG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [csgfsg::R](R) reader structure"] +impl crate::Readable for CSGFSG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CSGFSG to value 0"] +impl crate::Resettable for CSGFSG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0/csgsetg.rs b/src/hrpwm0/csgsetg.rs index 37eeb5a9..0b2e88cd 100644 --- a/src/hrpwm0/csgsetg.rs +++ b/src/hrpwm0/csgsetg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CSGSETG"] -pub type W = crate::W; -#[doc = "Register CSGSETG `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGSETG { - type Type = u32; +#[doc = "Register `CSGSETG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SD0R`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SD0R` writer - DAC0 run bit set"] pub struct SD0R_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SD0R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SC0R`"] +#[doc = "Field `SC0R` writer - CMP0 run bit set"] pub struct SC0R_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SC0R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SC0P`"] +#[doc = "Field `SC0P` writer - CMP0 passive level set"] pub struct SC0P_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SC0P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SD1R`"] +#[doc = "Field `SD1R` writer - DAC1 run bit set"] pub struct SD1R_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SD1R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `SC1R`"] +#[doc = "Field `SC1R` writer - CMP1 run bit set"] pub struct SC1R_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SC1R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `SC1P`"] +#[doc = "Field `SC1P` writer - CMP1 passive level set"] pub struct SC1P_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SC1P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `SD2R`"] +#[doc = "Field `SD2R` writer - DAC2 run bit set"] pub struct SD2R_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> SD2R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SC2R`"] +#[doc = "Field `SC2R` writer - CMP2 run bit set"] pub struct SC2R_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> SC2R_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `SC2P`"] +#[doc = "Field `SC2P` writer - CMP2 passive level set"] pub struct SC2P_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> SC2P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn sc2p(&mut self) -> SC2P_W { SC2P_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG run bit set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgsetg](index.html) module"] +pub struct CSGSETG_SPEC; +impl crate::RegisterSpec for CSGSETG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [csgsetg::W](W) writer structure"] +impl crate::Writable for CSGSETG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGSETG to value 0"] +impl crate::Resettable for CSGSETG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgstatg.rs b/src/hrpwm0/csgstatg.rs index 0e98ef84..45d17139 100644 --- a/src/hrpwm0/csgstatg.rs +++ b/src/hrpwm0/csgstatg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CSGSTATG"] -pub type R = crate::R; +#[doc = "Register `CSGSTATG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "DAC0 run bit status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum D0RB_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D0RB`"] -pub type D0RB_R = crate::R; +#[doc = "Field `D0RB` reader - DAC0 run bit status"] +pub struct D0RB_R(crate::FieldReader); impl D0RB_R { + pub(crate) fn new(bits: bool) -> Self { + D0RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D0RB_A { @@ -28,12 +44,19 @@ impl D0RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D0RB_A::VALUE1 + **self == D0RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D0RB_A::VALUE2 + **self == D0RB_A::VALUE2 + } +} +impl core::ops::Deref for D0RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP0 run bit status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `C0RB`"] -pub type C0RB_R = crate::R; +#[doc = "Field `C0RB` reader - CMP0 run bit status"] +pub struct C0RB_R(crate::FieldReader); impl C0RB_R { + pub(crate) fn new(bits: bool) -> Self { + C0RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> C0RB_A { @@ -64,12 +90,19 @@ impl C0RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0RB_A::VALUE1 + **self == C0RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0RB_A::VALUE2 + **self == C0RB_A::VALUE2 + } +} +impl core::ops::Deref for C0RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP0 output passive status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSLS0`"] -pub type PSLS0_R = crate::R; +#[doc = "Field `PSLS0` reader - CMP0 output passive status"] +pub struct PSLS0_R(crate::FieldReader); impl PSLS0_R { + pub(crate) fn new(bits: bool) -> Self { + PSLS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSLS0_A { @@ -100,12 +136,19 @@ impl PSLS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSLS0_A::VALUE1 + **self == PSLS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSLS0_A::VALUE2 + **self == PSLS0_A::VALUE2 + } +} +impl core::ops::Deref for PSLS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC1 run bit status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D1RB`"] -pub type D1RB_R = crate::R; +#[doc = "Field `D1RB` reader - DAC1 run bit status"] +pub struct D1RB_R(crate::FieldReader); impl D1RB_R { + pub(crate) fn new(bits: bool) -> Self { + D1RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D1RB_A { @@ -136,12 +182,19 @@ impl D1RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D1RB_A::VALUE1 + **self == D1RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D1RB_A::VALUE2 + **self == D1RB_A::VALUE2 + } +} +impl core::ops::Deref for D1RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP1 run bit status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `C1RB`"] -pub type C1RB_R = crate::R; +#[doc = "Field `C1RB` reader - CMP1 run bit status"] +pub struct C1RB_R(crate::FieldReader); impl C1RB_R { + pub(crate) fn new(bits: bool) -> Self { + C1RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> C1RB_A { @@ -172,12 +228,19 @@ impl C1RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1RB_A::VALUE1 + **self == C1RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1RB_A::VALUE2 + **self == C1RB_A::VALUE2 + } +} +impl core::ops::Deref for C1RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP1 output passive status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSLS1`"] -pub type PSLS1_R = crate::R; +#[doc = "Field `PSLS1` reader - CMP1 output passive status"] +pub struct PSLS1_R(crate::FieldReader); impl PSLS1_R { + pub(crate) fn new(bits: bool) -> Self { + PSLS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSLS1_A { @@ -208,12 +274,19 @@ impl PSLS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSLS1_A::VALUE1 + **self == PSLS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSLS1_A::VALUE2 + **self == PSLS1_A::VALUE2 + } +} +impl core::ops::Deref for PSLS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC2 run bit status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D2RB`"] -pub type D2RB_R = crate::R; +#[doc = "Field `D2RB` reader - DAC2 run bit status"] +pub struct D2RB_R(crate::FieldReader); impl D2RB_R { + pub(crate) fn new(bits: bool) -> Self { + D2RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D2RB_A { @@ -244,12 +320,19 @@ impl D2RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D2RB_A::VALUE1 + **self == D2RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D2RB_A::VALUE2 + **self == D2RB_A::VALUE2 + } +} +impl core::ops::Deref for D2RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP2 run bit status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `C2RB`"] -pub type C2RB_R = crate::R; +#[doc = "Field `C2RB` reader - CMP2 run bit status"] +pub struct C2RB_R(crate::FieldReader); impl C2RB_R { + pub(crate) fn new(bits: bool) -> Self { + C2RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> C2RB_A { @@ -280,12 +366,19 @@ impl C2RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C2RB_A::VALUE1 + **self == C2RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C2RB_A::VALUE2 + **self == C2RB_A::VALUE2 + } +} +impl core::ops::Deref for C2RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP2 output passive status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSLS2`"] -pub type PSLS2_R = crate::R; +#[doc = "Field `PSLS2` reader - CMP2 output passive status"] +pub struct PSLS2_R(crate::FieldReader); impl PSLS2_R { + pub(crate) fn new(bits: bool) -> Self { + PSLS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSLS2_A { @@ -316,12 +412,19 @@ impl PSLS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSLS2_A::VALUE1 + **self == PSLS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSLS2_A::VALUE2 + **self == PSLS2_A::VALUE2 + } +} +impl core::ops::Deref for PSLS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { PSLS2_R::new(((self.bits >> 10) & 0x01) != 0) } } +#[doc = "Global CSG run bit status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgstatg](index.html) module"] +pub struct CSGSTATG_SPEC; +impl crate::RegisterSpec for CSGSTATG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [csgstatg::R](R) reader structure"] +impl crate::Readable for CSGSTATG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CSGSTATG to value 0"] +impl crate::Resettable for CSGSTATG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0/csgtrc.rs b/src/hrpwm0/csgtrc.rs index 80a83c97..df383af8 100644 --- a/src/hrpwm0/csgtrc.rs +++ b/src/hrpwm0/csgtrc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CSGTRC"] -pub type W = crate::W; -#[doc = "Register CSGTRC `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGTRC { - type Type = u32; +#[doc = "Register `CSGTRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `D0SEC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `D0SEC` writer - DAC0 shadow transfer enable clear"] pub struct D0SEC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> D0SEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `D1SEC`"] +#[doc = "Field `D1SEC` writer - DAC1 shadow transfer enable clear"] pub struct D1SEC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> D1SEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `D2SEC`"] +#[doc = "Field `D2SEC` writer - DAC2 shadow transfer enable clear"] pub struct D2SEC_W<'a> { w: &'a mut W, } @@ -70,7 +81,7 @@ impl<'a> D2SEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -90,4 +101,26 @@ impl W { pub fn d2sec(&mut self) -> D2SEC_W { D2SEC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG shadow trigger clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrc](index.html) module"] +pub struct CSGTRC_SPEC; +impl crate::RegisterSpec for CSGTRC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [csgtrc::W](W) writer structure"] +impl crate::Writable for CSGTRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGTRC to value 0"] +impl crate::Resettable for CSGTRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgtrg.rs b/src/hrpwm0/csgtrg.rs index dbff4c47..473dad63 100644 --- a/src/hrpwm0/csgtrg.rs +++ b/src/hrpwm0/csgtrg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CSGTRG"] -pub type W = crate::W; -#[doc = "Register CSGTRG `reset()`'s with value 0"] -impl crate::ResetValue for super::CSGTRG { - type Type = u32; +#[doc = "Register `CSGTRG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `D0SES`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `D0SES` writer - DAC0 shadow transfer enable set"] pub struct D0SES_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> D0SES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `D0SVS`"] +#[doc = "Field `D0SVS` writer - CMP0 inverting input switch request"] pub struct D0SVS_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> D0SVS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `D1SES`"] +#[doc = "Field `D1SES` writer - DAC1 shadow transfer enable set"] pub struct D1SES_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> D1SES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `D1SVS`"] +#[doc = "Field `D1SVS` writer - CMP1 inverting input switch request"] pub struct D1SVS_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> D1SVS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `D2SES`"] +#[doc = "Field `D2SES` writer - DAC2 shadow transfer enable set"] pub struct D2SES_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> D2SES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `D2SVS`"] +#[doc = "Field `D2SVS` writer - CMP2 inverting input switch request"] pub struct D2SVS_W<'a> { w: &'a mut W, } @@ -136,7 +147,7 @@ impl<'a> D2SVS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -171,4 +182,26 @@ impl W { pub fn d2svs(&mut self) -> D2SVS_W { D2SVS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global CSG shadow/switch trigger\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrg](index.html) module"] +pub struct CSGTRG_SPEC; +impl crate::RegisterSpec for CSGTRG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [csgtrg::W](W) writer structure"] +impl crate::Writable for CSGTRG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSGTRG to value 0"] +impl crate::Resettable for CSGTRG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/csgtrsg.rs b/src/hrpwm0/csgtrsg.rs index fd9ca47e..da5b2450 100644 --- a/src/hrpwm0/csgtrsg.rs +++ b/src/hrpwm0/csgtrsg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CSGTRSG"] -pub type R = crate::R; +#[doc = "Register `CSGTRSG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "DAC0 shadow transfer enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum D0STE_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D0STE`"] -pub type D0STE_R = crate::R; +#[doc = "Field `D0STE` reader - DAC0 shadow transfer enable"] +pub struct D0STE_R(crate::FieldReader); impl D0STE_R { + pub(crate) fn new(bits: bool) -> Self { + D0STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D0STE_A { @@ -28,12 +44,19 @@ impl D0STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D0STE_A::VALUE1 + **self == D0STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D0STE_A::VALUE2 + **self == D0STE_A::VALUE2 + } +} +impl core::ops::Deref for D0STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP0 inverting input connection status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SW0ST`"] -pub type SW0ST_R = crate::R; +#[doc = "Field `SW0ST` reader - CMP0 inverting input connection status"] +pub struct SW0ST_R(crate::FieldReader); impl SW0ST_R { + pub(crate) fn new(bits: bool) -> Self { + SW0ST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SW0ST_A { @@ -64,12 +90,19 @@ impl SW0ST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SW0ST_A::VALUE1 + **self == SW0ST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SW0ST_A::VALUE2 + **self == SW0ST_A::VALUE2 + } +} +impl core::ops::Deref for SW0ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC1 shadow transfer enable\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D1STE`"] -pub type D1STE_R = crate::R; +#[doc = "Field `D1STE` reader - DAC1 shadow transfer enable"] +pub struct D1STE_R(crate::FieldReader); impl D1STE_R { + pub(crate) fn new(bits: bool) -> Self { + D1STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D1STE_A { @@ -100,12 +136,19 @@ impl D1STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D1STE_A::VALUE1 + **self == D1STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D1STE_A::VALUE2 + **self == D1STE_A::VALUE2 + } +} +impl core::ops::Deref for D1STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP1 inverting input connection status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SW1ST`"] -pub type SW1ST_R = crate::R; +#[doc = "Field `SW1ST` reader - CMP1 inverting input connection status"] +pub struct SW1ST_R(crate::FieldReader); impl SW1ST_R { + pub(crate) fn new(bits: bool) -> Self { + SW1ST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SW1ST_A { @@ -136,12 +182,19 @@ impl SW1ST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SW1ST_A::VALUE1 + **self == SW1ST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SW1ST_A::VALUE2 + **self == SW1ST_A::VALUE2 + } +} +impl core::ops::Deref for SW1ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC2 shadow transfer enable\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `D2STE`"] -pub type D2STE_R = crate::R; +#[doc = "Field `D2STE` reader - DAC2 shadow transfer enable"] +pub struct D2STE_R(crate::FieldReader); impl D2STE_R { + pub(crate) fn new(bits: bool) -> Self { + D2STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> D2STE_A { @@ -172,12 +228,19 @@ impl D2STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == D2STE_A::VALUE1 + **self == D2STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == D2STE_A::VALUE2 + **self == D2STE_A::VALUE2 + } +} +impl core::ops::Deref for D2STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CMP2 inverting input connection status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SW2ST`"] -pub type SW2ST_R = crate::R; +#[doc = "Field `SW2ST` reader - CMP2 inverting input connection status"] +pub struct SW2ST_R(crate::FieldReader); impl SW2ST_R { + pub(crate) fn new(bits: bool) -> Self { + SW2ST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SW2ST_A { @@ -208,12 +274,19 @@ impl SW2ST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SW2ST_A::VALUE1 + **self == SW2ST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SW2ST_A::VALUE2 + **self == SW2ST_A::VALUE2 + } +} +impl core::ops::Deref for SW2ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -248,3 +321,19 @@ impl R { SW2ST_R::new(((self.bits >> 9) & 0x01) != 0) } } +#[doc = "Global CSG shadow/switch status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csgtrsg](index.html) module"] +pub struct CSGTRSG_SPEC; +impl crate::RegisterSpec for CSGTRSG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [csgtrsg::R](R) reader structure"] +impl crate::Readable for CSGTRSG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CSGTRSG to value 0"] +impl crate::Resettable for CSGTRSG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0/glbana.rs b/src/hrpwm0/glbana.rs index b7016fa6..17d1ec9e 100644 --- a/src/hrpwm0/glbana.rs +++ b/src/hrpwm0/glbana.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLBANA"] -pub type R = crate::R; -#[doc = "Writer for register GLBANA"] -pub type W = crate::W; -#[doc = "Register GLBANA `reset()`'s with value 0x4b8c"] -impl crate::ResetValue for super::GLBANA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x4b8c +#[doc = "Register `GLBANA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLBANA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SLDLY` reader - Delay of lock detection"] +pub struct SLDLY_R(crate::FieldReader); +impl SLDLY_R { + pub(crate) fn new(bits: u8) -> Self { + SLDLY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLDLY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `SLDLY`"] -pub type SLDLY_R = crate::R; -#[doc = "Write proxy for field `SLDLY`"] +#[doc = "Field `SLDLY` writer - Delay of lock detection"] pub struct SLDLY_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> SLDLY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } -#[doc = "Reader of field `FUP`"] -pub type FUP_R = crate::R; -#[doc = "Write proxy for field `FUP`"] +#[doc = "Field `FUP` reader - Force chargepump up"] +pub struct FUP_R(crate::FieldReader); +impl FUP_R { + pub(crate) fn new(bits: bool) -> Self { + FUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FUP` writer - Force chargepump up"] pub struct FUP_W<'a> { w: &'a mut W, } @@ -44,13 +92,25 @@ impl<'a> FUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `FDN`"] -pub type FDN_R = crate::R; -#[doc = "Write proxy for field `FDN`"] +#[doc = "Field `FDN` reader - Force chargepump down"] +pub struct FDN_R(crate::FieldReader); +impl FDN_R { + pub(crate) fn new(bits: bool) -> Self { + FDN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FDN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FDN` writer - Force chargepump down"] pub struct FDN_W<'a> { w: &'a mut W, } @@ -68,13 +128,25 @@ impl<'a> FDN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `SLCP`"] -pub type SLCP_R = crate::R; -#[doc = "Write proxy for field `SLCP`"] +#[doc = "Field `SLCP` reader - HRCs chargepump current selection"] +pub struct SLCP_R(crate::FieldReader); +impl SLCP_R { + pub(crate) fn new(bits: u8) -> Self { + SLCP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLCP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLCP` writer - HRCs chargepump current selection"] pub struct SLCP_W<'a> { w: &'a mut W, } @@ -82,13 +154,25 @@ impl<'a> SLCP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 6)) | (((value as u32) & 0x07) << 6); + self.w.bits = (self.w.bits & !(0x07 << 6)) | ((value as u32 & 0x07) << 6); self.w } } -#[doc = "Reader of field `SLIBLDO`"] -pub type SLIBLDO_R = crate::R; -#[doc = "Write proxy for field `SLIBLDO`"] +#[doc = "Field `SLIBLDO` reader - HRCs LDO bias current"] +pub struct SLIBLDO_R(crate::FieldReader); +impl SLIBLDO_R { + pub(crate) fn new(bits: u8) -> Self { + SLIBLDO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLIBLDO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLIBLDO` writer - HRCs LDO bias current"] pub struct SLIBLDO_W<'a> { w: &'a mut W, } @@ -96,13 +180,25 @@ impl<'a> SLIBLDO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 9)) | (((value as u32) & 0x03) << 9); + self.w.bits = (self.w.bits & !(0x03 << 9)) | ((value as u32 & 0x03) << 9); self.w } } -#[doc = "Reader of field `SLIBLF`"] -pub type SLIBLF_R = crate::R; -#[doc = "Write proxy for field `SLIBLF`"] +#[doc = "Field `SLIBLF` reader - HRCs loop filter bias current"] +pub struct SLIBLF_R(crate::FieldReader); +impl SLIBLF_R { + pub(crate) fn new(bits: u8) -> Self { + SLIBLF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLIBLF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLIBLF` writer - HRCs loop filter bias current"] pub struct SLIBLF_W<'a> { w: &'a mut W, } @@ -110,13 +206,25 @@ impl<'a> SLIBLF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 11)) | (((value as u32) & 0x03) << 11); + self.w.bits = (self.w.bits & !(0x03 << 11)) | ((value as u32 & 0x03) << 11); self.w } } -#[doc = "Reader of field `SLVREF`"] -pub type SLVREF_R = crate::R; -#[doc = "Write proxy for field `SLVREF`"] +#[doc = "Field `SLVREF` reader - Reference voltage for chargepump and loop filter"] +pub struct SLVREF_R(crate::FieldReader); +impl SLVREF_R { + pub(crate) fn new(bits: u8) -> Self { + SLVREF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLVREF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLVREF` writer - Reference voltage for chargepump and loop filter"] pub struct SLVREF_W<'a> { w: &'a mut W, } @@ -124,13 +232,25 @@ impl<'a> SLVREF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 13)) | (((value as u32) & 0x07) << 13); + self.w.bits = (self.w.bits & !(0x07 << 13)) | ((value as u32 & 0x07) << 13); self.w } } -#[doc = "Reader of field `TRIBIAS`"] -pub type TRIBIAS_R = crate::R; -#[doc = "Write proxy for field `TRIBIAS`"] +#[doc = "Field `TRIBIAS` reader - Bias trimming"] +pub struct TRIBIAS_R(crate::FieldReader); +impl TRIBIAS_R { + pub(crate) fn new(bits: u8) -> Self { + TRIBIAS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRIBIAS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIBIAS` writer - Bias trimming"] pub struct TRIBIAS_W<'a> { w: &'a mut W, } @@ -138,7 +258,7 @@ impl<'a> TRIBIAS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -156,9 +276,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GHREN`"] -pub type GHREN_R = crate::R; +#[doc = "Field `GHREN` reader - Force chargepump down"] +pub struct GHREN_R(crate::FieldReader); impl GHREN_R { + pub(crate) fn new(bits: bool) -> Self { + GHREN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GHREN_A { @@ -170,15 +293,22 @@ impl GHREN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GHREN_A::VALUE1 + **self == GHREN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GHREN_A::VALUE2 + **self == GHREN_A::VALUE2 } } -#[doc = "Write proxy for field `GHREN`"] +impl core::ops::Deref for GHREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GHREN` writer - Force chargepump down"] pub struct GHREN_W<'a> { w: &'a mut W, } @@ -186,9 +316,7 @@ impl<'a> GHREN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GHREN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Global high resolution generation is enabled"] #[inline(always)] @@ -213,7 +341,7 @@ impl<'a> GHREN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -310,4 +438,30 @@ impl W { pub fn ghren(&mut self) -> GHREN_W { GHREN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Analog Configuration\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 [glbana](index.html) module"] +pub struct GLBANA_SPEC; +impl crate::RegisterSpec for GLBANA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [glbana::R](R) reader structure"] +impl crate::Readable for GLBANA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [glbana::W](W) writer structure"] +impl crate::Writable for GLBANA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLBANA to value 0x4b8c"] +impl crate::Resettable for GLBANA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x4b8c + } } diff --git a/src/hrpwm0/hrbsc.rs b/src/hrpwm0/hrbsc.rs index 61d7a041..49d2bcd2 100644 --- a/src/hrpwm0/hrbsc.rs +++ b/src/hrpwm0/hrbsc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HRBSC"] -pub type R = crate::R; -#[doc = "Writer for register HRBSC"] -pub type W = crate::W; -#[doc = "Register HRBSC `reset()`'s with value 0"] -impl crate::ResetValue for super::HRBSC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HRBSC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HRBSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Suspend configuration\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUSCFG`"] -pub type SUSCFG_R = crate::R; +#[doc = "Field `SUSCFG` reader - Suspend configuration"] +pub struct SUSCFG_R(crate::FieldReader); impl SUSCFG_R { + pub(crate) fn new(bits: u8) -> Self { + SUSCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SUSCFG_A::VALUE1), - 1 => Val(SUSCFG_A::VALUE2), - 2 => Val(SUSCFG_A::VALUE3), - 3 => Val(SUSCFG_A::VALUE4), - i => Res(i), + 0 => Some(SUSCFG_A::VALUE1), + 1 => Some(SUSCFG_A::VALUE2), + 2 => Some(SUSCFG_A::VALUE3), + 3 => Some(SUSCFG_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSCFG_A::VALUE1 + **self == SUSCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSCFG_A::VALUE2 + **self == SUSCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUSCFG_A::VALUE3 + **self == SUSCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SUSCFG_A::VALUE4 + **self == SUSCFG_A::VALUE4 + } +} +impl core::ops::Deref for SUSCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SUSCFG`"] +#[doc = "Field `SUSCFG` writer - Suspend configuration"] pub struct SUSCFG_W<'a> { w: &'a mut W, } @@ -98,13 +131,25 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `HRBE`"] -pub type HRBE_R = crate::R; -#[doc = "Write proxy for field `HRBE`"] +#[doc = "Field `HRBE` reader - HRPWM bias enable"] +pub struct HRBE_R(crate::FieldReader); +impl HRBE_R { + pub(crate) fn new(bits: bool) -> Self { + HRBE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HRBE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HRBE` writer - HRPWM bias enable"] pub struct HRBE_W<'a> { w: &'a mut W, } @@ -122,7 +167,7 @@ impl<'a> HRBE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -149,4 +194,30 @@ impl W { pub fn hrbe(&mut self) -> HRBE_W { HRBE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Bias and suspend configuration\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 [hrbsc](index.html) module"] +pub struct HRBSC_SPEC; +impl crate::RegisterSpec for HRBSC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hrbsc::R](R) reader structure"] +impl crate::Readable for HRBSC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hrbsc::W](W) writer structure"] +impl crate::Writable for HRBSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HRBSC to value 0"] +impl crate::Resettable for HRBSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/hrccfg.rs b/src/hrpwm0/hrccfg.rs index 141c0ad3..f16c1198 100644 --- a/src/hrpwm0/hrccfg.rs +++ b/src/hrpwm0/hrccfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HRCCFG"] -pub type R = crate::R; -#[doc = "Writer for register HRCCFG"] -pub type W = crate::W; -#[doc = "Register HRCCFG `reset()`'s with value 0"] -impl crate::ResetValue for super::HRCCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HRCCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HRCCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "High resolution channels power mode\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRCPM`"] -pub type HRCPM_R = crate::R; +#[doc = "Field `HRCPM` reader - High resolution channels power mode"] +pub struct HRCPM_R(crate::FieldReader); impl HRCPM_R { + pub(crate) fn new(bits: bool) -> Self { + HRCPM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRCPM_A { @@ -38,15 +65,22 @@ impl HRCPM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRCPM_A::VALUE1 + **self == HRCPM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRCPM_A::VALUE2 + **self == HRCPM_A::VALUE2 + } +} +impl core::ops::Deref for HRCPM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HRCPM`"] +#[doc = "Field `HRCPM` writer - High resolution channels power mode"] pub struct HRCPM_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> HRCPM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRCPM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "High resolution generation logic is OFF. It is not possible to generate high resolution signals throughout any of the high resolution channels, HRCy."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> HRCPM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRC0E`"] -pub type HRC0E_R = crate::R; +#[doc = "Field `HRC0E` reader - HRC0 high resolution enable"] +pub struct HRC0E_R(crate::FieldReader); impl HRC0E_R { + pub(crate) fn new(bits: bool) -> Self { + HRC0E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRC0E_A { @@ -113,15 +148,22 @@ impl HRC0E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRC0E_A::VALUE1 + **self == HRC0E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRC0E_A::VALUE2 + **self == HRC0E_A::VALUE2 + } +} +impl core::ops::Deref for HRC0E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HRC0E`"] +#[doc = "Field `HRC0E` writer - HRC0 high resolution enable"] pub struct HRC0E_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> HRC0E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRC0E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC0 High Resolution Path is disabled. In this mode, is not possible to use the High Resolution Path inside of HRC0 to generate an output PWM signal."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> HRC0E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRC1E`"] -pub type HRC1E_R = crate::R; +#[doc = "Field `HRC1E` reader - HRC1 high resolution channel enable"] +pub struct HRC1E_R(crate::FieldReader); impl HRC1E_R { + pub(crate) fn new(bits: bool) -> Self { + HRC1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRC1E_A { @@ -188,15 +231,22 @@ impl HRC1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRC1E_A::VALUE1 + **self == HRC1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRC1E_A::VALUE2 + **self == HRC1E_A::VALUE2 + } +} +impl core::ops::Deref for HRC1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HRC1E`"] +#[doc = "Field `HRC1E` writer - HRC1 high resolution channel enable"] pub struct HRC1E_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> HRC1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRC1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC1 High Resolution Path is disabled. In this mode, is not possible to use the High Resolution Path inside of HRC1 to generate an output PWM signal."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> HRC1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRC2E`"] -pub type HRC2E_R = crate::R; +#[doc = "Field `HRC2E` reader - HRC2 high resolution channel enable"] +pub struct HRC2E_R(crate::FieldReader); impl HRC2E_R { + pub(crate) fn new(bits: bool) -> Self { + HRC2E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRC2E_A { @@ -263,15 +314,22 @@ impl HRC2E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRC2E_A::VALUE1 + **self == HRC2E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRC2E_A::VALUE2 + **self == HRC2E_A::VALUE2 } } -#[doc = "Write proxy for field `HRC2E`"] +impl core::ops::Deref for HRC2E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HRC2E` writer - HRC2 high resolution channel enable"] pub struct HRC2E_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> HRC2E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRC2E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC2 High Resolution Path is disabled. In this mode, is not possible to use the High Resolution Path inside of HRC2 to generate an output PWM signal."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> HRC2E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRC3E`"] -pub type HRC3E_R = crate::R; +#[doc = "Field `HRC3E` reader - HRC3 high resolution channel enable"] +pub struct HRC3E_R(crate::FieldReader); impl HRC3E_R { + pub(crate) fn new(bits: bool) -> Self { + HRC3E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRC3E_A { @@ -338,15 +397,22 @@ impl HRC3E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRC3E_A::VALUE1 + **self == HRC3E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRC3E_A::VALUE2 + **self == HRC3E_A::VALUE2 + } +} +impl core::ops::Deref for HRC3E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HRC3E`"] +#[doc = "Field `HRC3E` writer - HRC3 high resolution channel enable"] pub struct HRC3E_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> HRC3E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRC3E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC3 High Resolution Path is disabled. In this mode, is not possible to use the High Resolution Path inside of HRC3 to generate an output PWM signal."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> HRC3E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -404,43 +468,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CLKC`"] -pub type CLKC_R = crate::R; +#[doc = "Field `CLKC` reader - Clock information control"] +pub struct CLKC_R(crate::FieldReader); impl CLKC_R { + pub(crate) fn new(bits: u8) -> Self { + CLKC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLKC_A::VALUE1), - 1 => Val(CLKC_A::VALUE2), - 2 => Val(CLKC_A::VALUE3), - 3 => Val(CLKC_A::VALUE4), - i => Res(i), + 0 => Some(CLKC_A::VALUE1), + 1 => Some(CLKC_A::VALUE2), + 2 => Some(CLKC_A::VALUE3), + 3 => Some(CLKC_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CLKC_A::VALUE1 + **self == CLKC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CLKC_A::VALUE2 + **self == CLKC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLKC_A::VALUE3 + **self == CLKC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLKC_A::VALUE4 + **self == CLKC_A::VALUE4 } } -#[doc = "Write proxy for field `CLKC`"] +impl core::ops::Deref for CLKC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CLKC` writer - Clock information control"] pub struct CLKC_W<'a> { w: &'a mut W, } @@ -473,7 +546,7 @@ impl<'a> CLKC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -491,9 +564,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LRC0E`"] -pub type LRC0E_R = crate::R; +#[doc = "Field `LRC0E` reader - HRC0 low resolution channel enable"] +pub struct LRC0E_R(crate::FieldReader); impl LRC0E_R { + pub(crate) fn new(bits: bool) -> Self { + LRC0E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LRC0E_A { @@ -505,15 +581,22 @@ impl LRC0E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LRC0E_A::VALUE1 + **self == LRC0E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LRC0E_A::VALUE2 + **self == LRC0E_A::VALUE2 + } +} +impl core::ops::Deref for LRC0E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LRC0E`"] +#[doc = "Field `LRC0E` writer - HRC0 low resolution channel enable"] pub struct LRC0E_W<'a> { w: &'a mut W, } @@ -521,9 +604,7 @@ impl<'a> LRC0E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LRC0E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC0 Low Resolution Path is disabled. In this mode, is not possible to use the Low Resolution Path inside of HRC0 to generate an output PWM signal."] #[inline(always)] @@ -548,7 +629,7 @@ impl<'a> LRC0E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -566,9 +647,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LRC1E`"] -pub type LRC1E_R = crate::R; +#[doc = "Field `LRC1E` reader - HRC1 low resolution channel enable"] +pub struct LRC1E_R(crate::FieldReader); impl LRC1E_R { + pub(crate) fn new(bits: bool) -> Self { + LRC1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LRC1E_A { @@ -580,15 +664,22 @@ impl LRC1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LRC1E_A::VALUE1 + **self == LRC1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LRC1E_A::VALUE2 + **self == LRC1E_A::VALUE2 } } -#[doc = "Write proxy for field `LRC1E`"] +impl core::ops::Deref for LRC1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LRC1E` writer - HRC1 low resolution channel enable"] pub struct LRC1E_W<'a> { w: &'a mut W, } @@ -596,9 +687,7 @@ impl<'a> LRC1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LRC1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC1 Low Resolution Path is disabled. In this mode, is not possible to use the Low Resolution Path inside of HRC1 to generate an output PWM signal."] #[inline(always)] @@ -623,7 +712,7 @@ impl<'a> LRC1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -641,9 +730,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LRC2E`"] -pub type LRC2E_R = crate::R; +#[doc = "Field `LRC2E` reader - HRC2 low resolution channel enable"] +pub struct LRC2E_R(crate::FieldReader); impl LRC2E_R { + pub(crate) fn new(bits: bool) -> Self { + LRC2E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LRC2E_A { @@ -655,15 +747,22 @@ impl LRC2E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LRC2E_A::VALUE1 + **self == LRC2E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LRC2E_A::VALUE2 + **self == LRC2E_A::VALUE2 } } -#[doc = "Write proxy for field `LRC2E`"] +impl core::ops::Deref for LRC2E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LRC2E` writer - HRC2 low resolution channel enable"] pub struct LRC2E_W<'a> { w: &'a mut W, } @@ -671,9 +770,7 @@ impl<'a> LRC2E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LRC2E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC2 Low Resolution Path is disabled. In this mode, is not possible to use the Low Resolution Path inside of HRC2 to generate an output PWM signal."] #[inline(always)] @@ -698,7 +795,7 @@ impl<'a> LRC2E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -716,9 +813,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LRC3E`"] -pub type LRC3E_R = crate::R; +#[doc = "Field `LRC3E` reader - HRC3 low resolution channel enable"] +pub struct LRC3E_R(crate::FieldReader); impl LRC3E_R { + pub(crate) fn new(bits: bool) -> Self { + LRC3E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LRC3E_A { @@ -730,15 +830,22 @@ impl LRC3E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LRC3E_A::VALUE1 + **self == LRC3E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LRC3E_A::VALUE2 + **self == LRC3E_A::VALUE2 } } -#[doc = "Write proxy for field `LRC3E`"] +impl core::ops::Deref for LRC3E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LRC3E` writer - HRC3 low resolution channel enable"] pub struct LRC3E_W<'a> { w: &'a mut W, } @@ -746,9 +853,7 @@ impl<'a> LRC3E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LRC3E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRC3 Low Resolution Path is disabled. In this mode, is not possible to use the Low Resolution Path inside of HRC3 to generate an output PWM signal."] #[inline(always)] @@ -773,7 +878,7 @@ impl<'a> LRC3E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -880,4 +985,30 @@ impl W { pub fn lrc3e(&mut self) -> LRC3E_W { LRC3E_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global HRC configuration\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 [hrccfg](index.html) module"] +pub struct HRCCFG_SPEC; +impl crate::RegisterSpec for HRCCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hrccfg::R](R) reader structure"] +impl crate::Readable for HRCCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hrccfg::W](W) writer structure"] +impl crate::Writable for HRCCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HRCCFG to value 0"] +impl crate::Resettable for HRCCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/hrcctrg.rs b/src/hrpwm0/hrcctrg.rs index f1fe325f..b58e0b25 100644 --- a/src/hrpwm0/hrcctrg.rs +++ b/src/hrpwm0/hrcctrg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register HRCCTRG"] -pub type W = crate::W; -#[doc = "Register HRCCTRG `reset()`'s with value 0"] -impl crate::ResetValue for super::HRCCTRG { - type Type = u32; +#[doc = "Register `HRCCTRG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `H0EC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `H0EC` writer - HRC0 high resolution values shadow transfer Enable Clear"] pub struct H0EC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> H0EC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `H0DEC`"] +#[doc = "Field `H0DEC` writer - HRC0 dead time value shadow transfer Enable Clear"] pub struct H0DEC_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> H0DEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `H1EC`"] +#[doc = "Field `H1EC` writer - HRC1 high resolution values shadow transfer Enable Clear"] pub struct H1EC_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> H1EC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `H1DEC`"] +#[doc = "Field `H1DEC` writer - HRC1 dead time value shadow transfer Enable Clear"] pub struct H1DEC_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> H1DEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `H2CEC`"] +#[doc = "Field `H2CEC` writer - HRC2 high resolution values shadow transfer Enable Clear"] pub struct H2CEC_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> H2CEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `H2DEC`"] +#[doc = "Field `H2DEC` writer - HRC2 dead time value shadow transfer Enable Clear"] pub struct H2DEC_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> H2DEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `H3EC`"] +#[doc = "Field `H3EC` writer - HRC3 high resolution values shadow transfer Enable Clear"] pub struct H3EC_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> H3EC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `H3DEC`"] +#[doc = "Field `H3DEC` writer - HRC3 dead time value shadow transfer Enable Clear"] pub struct H3DEC_W<'a> { w: &'a mut W, } @@ -180,7 +191,7 @@ impl<'a> H3DEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -225,4 +236,26 @@ impl W { pub fn h3dec(&mut self) -> H3DEC_W { H3DEC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global HRC shadow trigger clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcctrg](index.html) module"] +pub struct HRCCTRG_SPEC; +impl crate::RegisterSpec for HRCCTRG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hrcctrg::W](W) writer structure"] +impl crate::Writable for HRCCTRG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HRCCTRG to value 0"] +impl crate::Resettable for HRCCTRG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/hrcstrg.rs b/src/hrpwm0/hrcstrg.rs index f2f01a21..90c6b589 100644 --- a/src/hrpwm0/hrcstrg.rs +++ b/src/hrpwm0/hrcstrg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register HRCSTRG"] -pub type W = crate::W; -#[doc = "Register HRCSTRG `reset()`'s with value 0"] -impl crate::ResetValue for super::HRCSTRG { - type Type = u32; +#[doc = "Register `HRCSTRG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `H0ES`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `H0ES` writer - HRC0 high resolution values shadow transfer Enable Set"] pub struct H0ES_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> H0ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `H0DES`"] +#[doc = "Field `H0DES` writer - HRC0 dead time value shadow transfer enable set"] pub struct H0DES_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> H0DES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `H1ES`"] +#[doc = "Field `H1ES` writer - HRC1 high resolution values shadow transfer Enable Set"] pub struct H1ES_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> H1ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `H1DES`"] +#[doc = "Field `H1DES` writer - HRC0 dead time value shadow transfer enable set"] pub struct H1DES_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> H1DES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `H2ES`"] +#[doc = "Field `H2ES` writer - HRC2 high resolution values shadow transfer Enable Set"] pub struct H2ES_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> H2ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `H2DES`"] +#[doc = "Field `H2DES` writer - HRC0 dead time value shadow transfer enable set"] pub struct H2DES_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> H2DES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `H3ES`"] +#[doc = "Field `H3ES` writer - HRC3 high resolution values shadow transfer Enable Set"] pub struct H3ES_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> H3ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `H3DES`"] +#[doc = "Field `H3DES` writer - HRC0 dead time value shadow transfer enable set"] pub struct H3DES_W<'a> { w: &'a mut W, } @@ -180,7 +191,7 @@ impl<'a> H3DES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -225,4 +236,26 @@ impl W { pub fn h3des(&mut self) -> H3DES_W { H3DES_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global HRC shadow trigger set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcstrg](index.html) module"] +pub struct HRCSTRG_SPEC; +impl crate::RegisterSpec for HRCSTRG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hrcstrg::W](W) writer structure"] +impl crate::Writable for HRCSTRG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HRCSTRG to value 0"] +impl crate::Resettable for HRCSTRG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0/hrcstsg.rs b/src/hrpwm0/hrcstsg.rs index 1309a5b7..bf6150e2 100644 --- a/src/hrpwm0/hrcstsg.rs +++ b/src/hrpwm0/hrcstsg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register HRCSTSG"] -pub type R = crate::R; +#[doc = "Register `HRCSTSG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "HRC0 high resolution values shadow transfer status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum H0STE_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H0STE`"] -pub type H0STE_R = crate::R; +#[doc = "Field `H0STE` reader - HRC0 high resolution values shadow transfer status"] +pub struct H0STE_R(crate::FieldReader); impl H0STE_R { + pub(crate) fn new(bits: bool) -> Self { + H0STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H0STE_A { @@ -28,12 +44,19 @@ impl H0STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H0STE_A::VALUE1 + **self == H0STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H0STE_A::VALUE2 + **self == H0STE_A::VALUE2 + } +} +impl core::ops::Deref for H0STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC0 dead time value shadow transfer status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H0DSTE`"] -pub type H0DSTE_R = crate::R; +#[doc = "Field `H0DSTE` reader - HRC0 dead time value shadow transfer status"] +pub struct H0DSTE_R(crate::FieldReader); impl H0DSTE_R { + pub(crate) fn new(bits: bool) -> Self { + H0DSTE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H0DSTE_A { @@ -64,12 +90,19 @@ impl H0DSTE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H0DSTE_A::VALUE1 + **self == H0DSTE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H0DSTE_A::VALUE2 + **self == H0DSTE_A::VALUE2 + } +} +impl core::ops::Deref for H0DSTE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC1 high resolution values shadow transfer status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H1STE`"] -pub type H1STE_R = crate::R; +#[doc = "Field `H1STE` reader - HRC1 high resolution values shadow transfer status"] +pub struct H1STE_R(crate::FieldReader); impl H1STE_R { + pub(crate) fn new(bits: bool) -> Self { + H1STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H1STE_A { @@ -100,12 +136,19 @@ impl H1STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H1STE_A::VALUE1 + **self == H1STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H1STE_A::VALUE2 + **self == H1STE_A::VALUE2 + } +} +impl core::ops::Deref for H1STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC1 dead time value shadow transfer status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H1DSTE`"] -pub type H1DSTE_R = crate::R; +#[doc = "Field `H1DSTE` reader - HRC1 dead time value shadow transfer status"] +pub struct H1DSTE_R(crate::FieldReader); impl H1DSTE_R { + pub(crate) fn new(bits: bool) -> Self { + H1DSTE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H1DSTE_A { @@ -136,12 +182,19 @@ impl H1DSTE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H1DSTE_A::VALUE1 + **self == H1DSTE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H1DSTE_A::VALUE2 + **self == H1DSTE_A::VALUE2 + } +} +impl core::ops::Deref for H1DSTE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC2 high resolution values shadow transfer status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H2STE`"] -pub type H2STE_R = crate::R; +#[doc = "Field `H2STE` reader - HRC2 high resolution values shadow transfer status"] +pub struct H2STE_R(crate::FieldReader); impl H2STE_R { + pub(crate) fn new(bits: bool) -> Self { + H2STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H2STE_A { @@ -172,12 +228,19 @@ impl H2STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H2STE_A::VALUE1 + **self == H2STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H2STE_A::VALUE2 + **self == H2STE_A::VALUE2 + } +} +impl core::ops::Deref for H2STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC2 dead time value shadow transfer status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H2DSTE`"] -pub type H2DSTE_R = crate::R; +#[doc = "Field `H2DSTE` reader - HRC2 dead time value shadow transfer status"] +pub struct H2DSTE_R(crate::FieldReader); impl H2DSTE_R { + pub(crate) fn new(bits: bool) -> Self { + H2DSTE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H2DSTE_A { @@ -208,12 +274,19 @@ impl H2DSTE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H2DSTE_A::VALUE1 + **self == H2DSTE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H2DSTE_A::VALUE2 + **self == H2DSTE_A::VALUE2 + } +} +impl core::ops::Deref for H2DSTE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC3 high resolution values shadow transfer status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H3STE`"] -pub type H3STE_R = crate::R; +#[doc = "Field `H3STE` reader - HRC3 high resolution values shadow transfer status"] +pub struct H3STE_R(crate::FieldReader); impl H3STE_R { + pub(crate) fn new(bits: bool) -> Self { + H3STE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H3STE_A { @@ -244,12 +320,19 @@ impl H3STE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H3STE_A::VALUE1 + **self == H3STE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H3STE_A::VALUE2 + **self == H3STE_A::VALUE2 + } +} +impl core::ops::Deref for H3STE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRC3 dead time value shadow transfer status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `H3DSTE`"] -pub type H3DSTE_R = crate::R; +#[doc = "Field `H3DSTE` reader - HRC3 dead time value shadow transfer status"] +pub struct H3DSTE_R(crate::FieldReader); impl H3DSTE_R { + pub(crate) fn new(bits: bool) -> Self { + H3DSTE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> H3DSTE_A { @@ -280,12 +366,19 @@ impl H3DSTE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == H3DSTE_A::VALUE1 + **self == H3DSTE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == H3DSTE_A::VALUE2 + **self == H3DSTE_A::VALUE2 + } +} +impl core::ops::Deref for H3DSTE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -330,3 +423,19 @@ impl R { H3DSTE_R::new(((self.bits >> 13) & 0x01) != 0) } } +#[doc = "Global HRC shadow transfer status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrcstsg](index.html) module"] +pub struct HRCSTSG_SPEC; +impl crate::RegisterSpec for HRCSTSG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hrcstsg::R](R) reader structure"] +impl crate::Readable for HRCSTSG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HRCSTSG to value 0"] +impl crate::Resettable for HRCSTSG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0/hrghrs.rs b/src/hrpwm0/hrghrs.rs index 4817c892..32a58a2c 100644 --- a/src/hrpwm0/hrghrs.rs +++ b/src/hrpwm0/hrghrs.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register HRGHRS"] -pub type R = crate::R; +#[doc = "Register `HRGHRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "High Resolution Generation Ready\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HRGR_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRGR`"] -pub type HRGR_R = crate::R; +#[doc = "Field `HRGR` reader - High Resolution Generation Ready"] +pub struct HRGR_R(crate::FieldReader); impl HRGR_R { + pub(crate) fn new(bits: bool) -> Self { + HRGR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRGR_A { @@ -28,12 +44,19 @@ impl HRGR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRGR_A::VALUE1 + **self == HRGR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRGR_A::VALUE2 + **self == HRGR_A::VALUE2 + } +} +impl core::ops::Deref for HRGR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { HRGR_R::new((self.bits & 0x01) != 0) } } +#[doc = "High Resolution Generation Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hrghrs](index.html) module"] +pub struct HRGHRS_SPEC; +impl crate::RegisterSpec for HRGHRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hrghrs::R](R) reader structure"] +impl crate::Readable for HRGHRS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HRGHRS to value 0"] +impl crate::Resettable for HRGHRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0/midr.rs b/src/hrpwm0/midr.rs index ca2a62bb..c545ffd0 100644 --- a/src/hrpwm0/midr.rs +++ b/src/hrpwm0/midr.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register MIDR"] -pub type R = crate::R; -#[doc = "Reader of field `MODR`"] -pub type MODR_R = crate::R; -#[doc = "Reader of field `MODT`"] -pub type MODT_R = crate::R; -#[doc = "Reader of field `MODN`"] -pub type MODN_R = crate::R; +#[doc = "Register `MIDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MODR` reader - Module Revision"] +pub struct MODR_R(crate::FieldReader); +impl MODR_R { + pub(crate) fn new(bits: u8) -> Self { + MODR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODT` reader - Module Type"] +pub struct MODT_R(crate::FieldReader); +impl MODT_R { + pub(crate) fn new(bits: u8) -> Self { + MODT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODN` reader - Module Number"] +pub struct MODN_R(crate::FieldReader); +impl MODN_R { + pub(crate) fn new(bits: u16) -> Self { + MODN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MODN_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](index.html) module"] +pub struct MIDR_SPEC; +impl crate::RegisterSpec for MIDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [midr::R](R) reader structure"] +impl crate::Readable for MIDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIDR to value 0x00a9_c000"] +impl crate::Resettable for MIDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a9_c000 + } +} diff --git a/src/hrpwm0_csg0.rs b/src/hrpwm0_csg0.rs index 7fb9c11d..b4d8e4a5 100644 --- a/src/hrpwm0_csg0.rs +++ b/src/hrpwm0_csg0.rs @@ -2,201 +2,99 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - External input selection"] - pub dci: DCI, + pub dci: crate::Reg, #[doc = "0x04 - External input selection"] - pub ies: IES, + pub ies: crate::Reg, #[doc = "0x08 - Slope generation control"] - pub sc: SC, + pub sc: crate::Reg, #[doc = "0x0c - Pulse swallow configuration"] - pub pc: PC, + pub pc: crate::Reg, #[doc = "0x10 - DAC reference value 1"] - pub dsv1: DSV1, + pub dsv1: crate::Reg, #[doc = "0x14 - DAC reference value 1"] - pub dsv2: DSV2, + pub dsv2: crate::Reg, #[doc = "0x18 - Shadow reference value 1"] - pub sdsv1: SDSV1, + pub sdsv1: crate::Reg, #[doc = "0x1c - Shadow Pulse swallow value"] - pub spc: SPC, + pub spc: crate::Reg, #[doc = "0x20 - Comparator configuration"] - pub cc: CC, + pub cc: crate::Reg, #[doc = "0x24 - Passive level configuration"] - pub plc: PLC, + pub plc: crate::Reg, #[doc = "0x28 - Comparator blanking value"] - pub blv: BLV, + pub blv: crate::Reg, #[doc = "0x2c - Service request enable"] - pub sre: SRE, + pub sre: crate::Reg, #[doc = "0x30 - Service request line selector"] - pub srs: SRS, + pub srs: crate::Reg, #[doc = "0x34 - Service request SW set"] - pub sws: SWS, + pub sws: crate::Reg, #[doc = "0x38 - Service request SW clear"] - pub swc: SWC, + pub swc: crate::Reg, #[doc = "0x3c - Service request status"] - pub istat: ISTAT, + pub istat: crate::Reg, } -#[doc = "External input selection\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dci](dci) module"] -pub type DCI = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DCI; -#[doc = "`read()` method returns [dci::R](dci::R) reader structure"] -impl crate::Readable for DCI {} -#[doc = "`write(|w| ..)` method takes [dci::W](dci::W) writer structure"] -impl crate::Writable for DCI {} +#[doc = "DCI register accessor: an alias for `Reg`"] +pub type DCI = crate::Reg; #[doc = "External input selection"] pub mod dci; -#[doc = "External input selection\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ies](ies) module"] -pub type IES = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IES; -#[doc = "`read()` method returns [ies::R](ies::R) reader structure"] -impl crate::Readable for IES {} -#[doc = "`write(|w| ..)` method takes [ies::W](ies::W) writer structure"] -impl crate::Writable for IES {} +#[doc = "IES register accessor: an alias for `Reg`"] +pub type IES = crate::Reg; #[doc = "External input selection"] pub mod ies; -#[doc = "Slope generation control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sc](sc) module"] -pub type SC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SC; -#[doc = "`read()` method returns [sc::R](sc::R) reader structure"] -impl crate::Readable for SC {} -#[doc = "`write(|w| ..)` method takes [sc::W](sc::W) writer structure"] -impl crate::Writable for SC {} +#[doc = "SC register accessor: an alias for `Reg`"] +pub type SC = crate::Reg; #[doc = "Slope generation control"] pub mod sc; -#[doc = "Pulse swallow configuration\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pc](pc) module"] -pub type PC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PC; -#[doc = "`read()` method returns [pc::R](pc::R) reader structure"] -impl crate::Readable for PC {} +#[doc = "PC register accessor: an alias for `Reg`"] +pub type PC = crate::Reg; #[doc = "Pulse swallow configuration"] pub mod pc; -#[doc = "DAC reference value 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsv1](dsv1) module"] -pub type DSV1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSV1; -#[doc = "`read()` method returns [dsv1::R](dsv1::R) reader structure"] -impl crate::Readable for DSV1 {} +#[doc = "DSV1 register accessor: an alias for `Reg`"] +pub type DSV1 = crate::Reg; #[doc = "DAC reference value 1"] pub mod dsv1; -#[doc = "DAC reference value 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsv2](dsv2) module"] -pub type DSV2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSV2; -#[doc = "`read()` method returns [dsv2::R](dsv2::R) reader structure"] -impl crate::Readable for DSV2 {} -#[doc = "`write(|w| ..)` method takes [dsv2::W](dsv2::W) writer structure"] -impl crate::Writable for DSV2 {} +#[doc = "DSV2 register accessor: an alias for `Reg`"] +pub type DSV2 = crate::Reg; #[doc = "DAC reference value 1"] pub mod dsv2; -#[doc = "Shadow reference value 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdsv1](sdsv1) module"] -pub type SDSV1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SDSV1; -#[doc = "`read()` method returns [sdsv1::R](sdsv1::R) reader structure"] -impl crate::Readable for SDSV1 {} -#[doc = "`write(|w| ..)` method takes [sdsv1::W](sdsv1::W) writer structure"] -impl crate::Writable for SDSV1 {} +#[doc = "SDSV1 register accessor: an alias for `Reg`"] +pub type SDSV1 = crate::Reg; #[doc = "Shadow reference value 1"] pub mod sdsv1; -#[doc = "Shadow Pulse swallow value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spc](spc) module"] -pub type SPC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SPC; -#[doc = "`read()` method returns [spc::R](spc::R) reader structure"] -impl crate::Readable for SPC {} -#[doc = "`write(|w| ..)` method takes [spc::W](spc::W) writer structure"] -impl crate::Writable for SPC {} +#[doc = "SPC register accessor: an alias for `Reg`"] +pub type SPC = crate::Reg; #[doc = "Shadow Pulse swallow value"] pub mod spc; -#[doc = "Comparator configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cc](cc) module"] -pub type CC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CC; -#[doc = "`read()` method returns [cc::R](cc::R) reader structure"] -impl crate::Readable for CC {} -#[doc = "`write(|w| ..)` method takes [cc::W](cc::W) writer structure"] -impl crate::Writable for CC {} +#[doc = "CC register accessor: an alias for `Reg`"] +pub type CC = crate::Reg; #[doc = "Comparator configuration"] pub mod cc; -#[doc = "Passive level configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [plc](plc) module"] -pub type PLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PLC; -#[doc = "`read()` method returns [plc::R](plc::R) reader structure"] -impl crate::Readable for PLC {} -#[doc = "`write(|w| ..)` method takes [plc::W](plc::W) writer structure"] -impl crate::Writable for PLC {} +#[doc = "PLC register accessor: an alias for `Reg`"] +pub type PLC = crate::Reg; #[doc = "Passive level configuration"] pub mod plc; -#[doc = "Comparator blanking value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [blv](blv) module"] -pub type BLV = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BLV; -#[doc = "`read()` method returns [blv::R](blv::R) reader structure"] -impl crate::Readable for BLV {} -#[doc = "`write(|w| ..)` method takes [blv::W](blv::W) writer structure"] -impl crate::Writable for BLV {} +#[doc = "BLV register accessor: an alias for `Reg`"] +pub type BLV = crate::Reg; #[doc = "Comparator blanking value"] pub mod blv; -#[doc = "Service request enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sre](sre) module"] -pub type SRE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRE; -#[doc = "`read()` method returns [sre::R](sre::R) reader structure"] -impl crate::Readable for SRE {} -#[doc = "`write(|w| ..)` method takes [sre::W](sre::W) writer structure"] -impl crate::Writable for SRE {} +#[doc = "SRE register accessor: an alias for `Reg`"] +pub type SRE = crate::Reg; #[doc = "Service request enable"] pub mod sre; -#[doc = "Service request line selector\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srs](srs) module"] -pub type SRS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRS; -#[doc = "`read()` method returns [srs::R](srs::R) reader structure"] -impl crate::Readable for SRS {} -#[doc = "`write(|w| ..)` method takes [srs::W](srs::W) writer structure"] -impl crate::Writable for SRS {} +#[doc = "SRS register accessor: an alias for `Reg`"] +pub type SRS = crate::Reg; #[doc = "Service request line selector"] pub mod srs; -#[doc = "Service request SW set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](sws) module"] -pub type SWS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWS; -#[doc = "`write(|w| ..)` method takes [sws::W](sws::W) writer structure"] -impl crate::Writable for SWS {} +#[doc = "SWS register accessor: an alias for `Reg`"] +pub type SWS = crate::Reg; #[doc = "Service request SW set"] pub mod sws; -#[doc = "Service request SW clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swc](swc) module"] -pub type SWC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SWC; -#[doc = "`write(|w| ..)` method takes [swc::W](swc::W) writer structure"] -impl crate::Writable for SWC {} +#[doc = "SWC register accessor: an alias for `Reg`"] +pub type SWC = crate::Reg; #[doc = "Service request SW clear"] pub mod swc; -#[doc = "Service request status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [istat](istat) module"] -pub type ISTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ISTAT; -#[doc = "`read()` method returns [istat::R](istat::R) reader structure"] -impl crate::Readable for ISTAT {} +#[doc = "ISTAT register accessor: an alias for `Reg`"] +pub type ISTAT = crate::Reg; #[doc = "Service request status"] pub mod istat; diff --git a/src/hrpwm0_csg0/blv.rs b/src/hrpwm0_csg0/blv.rs index d6c95acc..47814c97 100644 --- a/src/hrpwm0_csg0/blv.rs +++ b/src/hrpwm0_csg0/blv.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register BLV"] -pub type R = crate::R; -#[doc = "Writer for register BLV"] -pub type W = crate::W; -#[doc = "Register BLV `reset()`'s with value 0"] -impl crate::ResetValue for super::BLV { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BLV` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BLV` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `BLV`"] -pub type BLV_R = crate::R; -#[doc = "Write proxy for field `BLV`"] +#[doc = "Field `BLV` reader - Blanking value"] +pub struct BLV_R(crate::FieldReader); +impl BLV_R { + pub(crate) fn new(bits: u8) -> Self { + BLV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLV` writer - Blanking value"] pub struct BLV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> BLV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn blv(&mut self) -> BLV_W { BLV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Comparator blanking value\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 [blv](index.html) module"] +pub struct BLV_SPEC; +impl crate::RegisterSpec for BLV_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [blv::R](R) reader structure"] +impl crate::Readable for BLV_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [blv::W](W) writer structure"] +impl crate::Writable for BLV_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BLV to value 0"] +impl crate::Resettable for BLV_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/cc.rs b/src/hrpwm0_csg0/cc.rs index fb6c289e..79c18ae0 100644 --- a/src/hrpwm0_csg0/cc.rs +++ b/src/hrpwm0_csg0/cc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CC"] -pub type R = crate::R; -#[doc = "Writer for register CC"] -pub type W = crate::W; -#[doc = "Register CC `reset()`'s with value 0"] -impl crate::ResetValue for super::CC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "External blanking trigger selector\n\nValue on reset: 0"] @@ -53,9 +77,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `IBS`"] -pub type IBS_R = crate::R; +#[doc = "Field `IBS` reader - External blanking trigger selector"] +pub struct IBS_R(crate::FieldReader); impl IBS_R { + pub(crate) fn new(bits: u8) -> Self { + IBS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IBS_A { @@ -82,85 +109,92 @@ impl IBS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IBS_A::VALUE1 + **self == IBS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IBS_A::VALUE2 + **self == IBS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == IBS_A::VALUE3 + **self == IBS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == IBS_A::VALUE4 + **self == IBS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == IBS_A::VALUE5 + **self == IBS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == IBS_A::VALUE6 + **self == IBS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == IBS_A::VALUE7 + **self == IBS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == IBS_A::VALUE8 + **self == IBS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == IBS_A::VALUE9 + **self == IBS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == IBS_A::VALUE10 + **self == IBS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == IBS_A::VALUE11 + **self == IBS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == IBS_A::VALUE12 + **self == IBS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == IBS_A::VALUE13 + **self == IBS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == IBS_A::VALUE14 + **self == IBS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == IBS_A::VALUE15 + **self == IBS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == IBS_A::VALUE16 + **self == IBS_A::VALUE16 } } -#[doc = "Write proxy for field `IBS`"] +impl core::ops::Deref for IBS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IBS` writer - External blanking trigger selector"] pub struct IBS_W<'a> { w: &'a mut W, } @@ -168,9 +202,7 @@ impl<'a> IBS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IBS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "HRPWMx.BLyA"] #[inline(always)] @@ -255,7 +287,7 @@ impl<'a> IBS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -273,9 +305,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IMCS`"] -pub type IMCS_R = crate::R; +#[doc = "Field `IMCS` reader - Inverting comparator input selector"] +pub struct IMCS_R(crate::FieldReader); impl IMCS_R { + pub(crate) fn new(bits: bool) -> Self { + IMCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IMCS_A { @@ -287,15 +322,22 @@ impl IMCS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IMCS_A::VALUE1 + **self == IMCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IMCS_A::VALUE2 + **self == IMCS_A::VALUE2 } } -#[doc = "Write proxy for field `IMCS`"] +impl core::ops::Deref for IMCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IMCS` writer - Inverting comparator input selector"] pub struct IMCS_W<'a> { w: &'a mut W, } @@ -303,9 +345,7 @@ impl<'a> IMCS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IMCS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRPWMx.CyINA"] #[inline(always)] @@ -330,7 +370,7 @@ impl<'a> IMCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -351,37 +391,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `IMCC`"] -pub type IMCC_R = crate::R; +#[doc = "Field `IMCC` reader - Comparator input switching configuration"] +pub struct IMCC_R(crate::FieldReader); impl IMCC_R { + pub(crate) fn new(bits: u8) -> Self { + IMCC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(IMCC_A::VALUE1), - 1 => Val(IMCC_A::VALUE2), - 2 => Val(IMCC_A::VALUE3), - i => Res(i), + 0 => Some(IMCC_A::VALUE1), + 1 => Some(IMCC_A::VALUE2), + 2 => Some(IMCC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IMCC_A::VALUE1 + **self == IMCC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IMCC_A::VALUE2 + **self == IMCC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == IMCC_A::VALUE3 + **self == IMCC_A::VALUE3 } } -#[doc = "Write proxy for field `IMCC`"] +impl core::ops::Deref for IMCC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IMCC` writer - Comparator input switching configuration"] pub struct IMCC_W<'a> { w: &'a mut W, } @@ -409,13 +458,25 @@ impl<'a> IMCC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 9)) | (((value as u32) & 0x03) << 9); + self.w.bits = (self.w.bits & !(0x03 << 9)) | ((value as u32 & 0x03) << 9); self.w } } -#[doc = "Reader of field `ESE`"] -pub type ESE_R = crate::R; -#[doc = "Write proxy for field `ESE`"] +#[doc = "Field `ESE` reader - External triggered switch enable"] +pub struct ESE_R(crate::FieldReader); +impl ESE_R { + pub(crate) fn new(bits: bool) -> Self { + ESE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ESE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ESE` writer - External triggered switch enable"] pub struct ESE_W<'a> { w: &'a mut W, } @@ -433,13 +494,25 @@ impl<'a> ESE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `OIE`"] -pub type OIE_R = crate::R; -#[doc = "Write proxy for field `OIE`"] +#[doc = "Field `OIE` reader - Comparator output inversion enable"] +pub struct OIE_R(crate::FieldReader); +impl OIE_R { + pub(crate) fn new(bits: bool) -> Self { + OIE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OIE` writer - Comparator output inversion enable"] pub struct OIE_W<'a> { w: &'a mut W, } @@ -457,13 +530,25 @@ impl<'a> OIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `OSE`"] -pub type OSE_R = crate::R; -#[doc = "Write proxy for field `OSE`"] +#[doc = "Field `OSE` reader - Comparator output synchronization enable"] +pub struct OSE_R(crate::FieldReader); +impl OSE_R { + pub(crate) fn new(bits: bool) -> Self { + OSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OSE` writer - Comparator output synchronization enable"] pub struct OSE_W<'a> { w: &'a mut W, } @@ -481,7 +566,7 @@ impl<'a> OSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -504,9 +589,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BLMC`"] -pub type BLMC_R = crate::R; +#[doc = "Field `BLMC` reader - Blanking mode"] +pub struct BLMC_R(crate::FieldReader); impl BLMC_R { + pub(crate) fn new(bits: u8) -> Self { + BLMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BLMC_A { @@ -521,25 +609,32 @@ impl BLMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BLMC_A::VALUE1 + **self == BLMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BLMC_A::VALUE2 + **self == BLMC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BLMC_A::VALUE3 + **self == BLMC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BLMC_A::VALUE4 + **self == BLMC_A::VALUE4 } } -#[doc = "Write proxy for field `BLMC`"] +impl core::ops::Deref for BLMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLMC` writer - Blanking mode"] pub struct BLMC_W<'a> { w: &'a mut W, } @@ -547,9 +642,7 @@ impl<'a> BLMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BLMC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Blanking disabled"] #[inline(always)] @@ -574,13 +667,25 @@ impl<'a> BLMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } -#[doc = "Reader of field `EBE`"] -pub type EBE_R = crate::R; -#[doc = "Write proxy for field `EBE`"] +#[doc = "Field `EBE` reader - External blanking trigger enabled"] +pub struct EBE_R(crate::FieldReader); +impl EBE_R { + pub(crate) fn new(bits: bool) -> Self { + EBE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EBE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EBE` writer - External blanking trigger enabled"] pub struct EBE_W<'a> { w: &'a mut W, } @@ -598,7 +703,7 @@ impl<'a> EBE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -616,9 +721,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `COFE`"] -pub type COFE_R = crate::R; +#[doc = "Field `COFE` reader - Comparator output filter enable"] +pub struct COFE_R(crate::FieldReader); impl COFE_R { + pub(crate) fn new(bits: bool) -> Self { + COFE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> COFE_A { @@ -630,15 +738,22 @@ impl COFE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == COFE_A::VALUE1 + **self == COFE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == COFE_A::VALUE2 + **self == COFE_A::VALUE2 + } +} +impl core::ops::Deref for COFE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `COFE`"] +#[doc = "Field `COFE` writer - Comparator output filter enable"] pub struct COFE_W<'a> { w: &'a mut W, } @@ -646,9 +761,7 @@ impl<'a> COFE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: COFE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Filtering stage disabled"] #[inline(always)] @@ -673,7 +786,7 @@ impl<'a> COFE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -704,67 +817,76 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `COFM`"] -pub type COFM_R = crate::R; +#[doc = "Field `COFM` reader - Comparator output filter window"] +pub struct COFM_R(crate::FieldReader); impl COFM_R { + pub(crate) fn new(bits: u8) -> Self { + COFM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(COFM_A::VALUE1), - 1 => Val(COFM_A::VALUE2), - 2 => Val(COFM_A::VALUE3), - 3 => Val(COFM_A::VALUE4), - 12 => Val(COFM_A::VALUE5), - 13 => Val(COFM_A::VALUE6), - 14 => Val(COFM_A::VALUE7), - 15 => Val(COFM_A::VALUE8), - i => Res(i), + 0 => Some(COFM_A::VALUE1), + 1 => Some(COFM_A::VALUE2), + 2 => Some(COFM_A::VALUE3), + 3 => Some(COFM_A::VALUE4), + 12 => Some(COFM_A::VALUE5), + 13 => Some(COFM_A::VALUE6), + 14 => Some(COFM_A::VALUE7), + 15 => Some(COFM_A::VALUE8), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == COFM_A::VALUE1 + **self == COFM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == COFM_A::VALUE2 + **self == COFM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == COFM_A::VALUE3 + **self == COFM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == COFM_A::VALUE4 + **self == COFM_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == COFM_A::VALUE5 + **self == COFM_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == COFM_A::VALUE6 + **self == COFM_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == COFM_A::VALUE7 + **self == COFM_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == COFM_A::VALUE8 + **self == COFM_A::VALUE8 + } +} +impl core::ops::Deref for COFM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `COFM`"] +#[doc = "Field `COFM` writer - Comparator output filter window"] pub struct COFM_W<'a> { w: &'a mut W, } @@ -817,7 +939,7 @@ impl<'a> COFM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 18)) | (((value as u32) & 0x0f) << 18); + self.w.bits = (self.w.bits & !(0x0f << 18)) | ((value as u32 & 0x0f) << 18); self.w } } @@ -838,37 +960,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `COFC`"] -pub type COFC_R = crate::R; +#[doc = "Field `COFC` reader - Comparator output filter control"] +pub struct COFC_R(crate::FieldReader); impl COFC_R { + pub(crate) fn new(bits: u8) -> Self { + COFC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(COFC_A::VALUE1), - 1 => Val(COFC_A::VALUE2), - 2 => Val(COFC_A::VALUE3), - i => Res(i), + 0 => Some(COFC_A::VALUE1), + 1 => Some(COFC_A::VALUE2), + 2 => Some(COFC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == COFC_A::VALUE1 + **self == COFC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == COFC_A::VALUE2 + **self == COFC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == COFC_A::VALUE3 + **self == COFC_A::VALUE3 + } +} +impl core::ops::Deref for COFC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `COFC`"] +#[doc = "Field `COFC` writer - Comparator output filter control"] pub struct COFC_W<'a> { w: &'a mut W, } @@ -896,7 +1027,7 @@ impl<'a> COFC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1013,4 +1144,30 @@ impl W { pub fn cofc(&mut self) -> COFC_W { COFC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Comparator configuration\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 [cc](index.html) module"] +pub struct CC_SPEC; +impl crate::RegisterSpec for CC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc::R](R) reader structure"] +impl crate::Readable for CC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc::W](W) writer structure"] +impl crate::Writable for CC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC to value 0"] +impl crate::Resettable for CC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/dci.rs b/src/hrpwm0_csg0/dci.rs index bbff6fa7..e3400ca1 100644 --- a/src/hrpwm0_csg0/dci.rs +++ b/src/hrpwm0_csg0/dci.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DCI"] -pub type R = crate::R; -#[doc = "Writer for register DCI"] -pub type W = crate::W; -#[doc = "Register DCI `reset()`'s with value 0"] -impl crate::ResetValue for super::DCI { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DCI` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DCI` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Value Selector input selection\n\nValue on reset: 0"] @@ -53,9 +77,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SVIS`"] -pub type SVIS_R = crate::R; +#[doc = "Field `SVIS` reader - Value Selector input selection"] +pub struct SVIS_R(crate::FieldReader); impl SVIS_R { + pub(crate) fn new(bits: u8) -> Self { + SVIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SVIS_A { @@ -82,85 +109,92 @@ impl SVIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVIS_A::VALUE1 + **self == SVIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVIS_A::VALUE2 + **self == SVIS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SVIS_A::VALUE3 + **self == SVIS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SVIS_A::VALUE4 + **self == SVIS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SVIS_A::VALUE5 + **self == SVIS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SVIS_A::VALUE6 + **self == SVIS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SVIS_A::VALUE7 + **self == SVIS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == SVIS_A::VALUE8 + **self == SVIS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == SVIS_A::VALUE9 + **self == SVIS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == SVIS_A::VALUE10 + **self == SVIS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == SVIS_A::VALUE11 + **self == SVIS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == SVIS_A::VALUE12 + **self == SVIS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == SVIS_A::VALUE13 + **self == SVIS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == SVIS_A::VALUE14 + **self == SVIS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == SVIS_A::VALUE15 + **self == SVIS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == SVIS_A::VALUE16 + **self == SVIS_A::VALUE16 + } +} +impl core::ops::Deref for SVIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SVIS`"] +#[doc = "Field `SVIS` writer - Value Selector input selection"] pub struct SVIS_W<'a> { w: &'a mut W, } @@ -168,9 +202,7 @@ impl<'a> SVIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SVIS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "HRPWMx.SyIA"] #[inline(always)] @@ -255,13 +287,25 @@ impl<'a> SVIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `STRIS`"] -pub type STRIS_R = crate::R; -#[doc = "Write proxy for field `STRIS`"] +#[doc = "Field `STRIS` reader - Slope generation start control input selection"] +pub struct STRIS_R(crate::FieldReader); +impl STRIS_R { + pub(crate) fn new(bits: u8) -> Self { + STRIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STRIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STRIS` writer - Slope generation start control input selection"] pub struct STRIS_W<'a> { w: &'a mut W, } @@ -269,13 +313,25 @@ impl<'a> STRIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } -#[doc = "Reader of field `STPIS`"] -pub type STPIS_R = crate::R; -#[doc = "Write proxy for field `STPIS`"] +#[doc = "Field `STPIS` reader - Slope generation stop control input selection"] +pub struct STPIS_R(crate::FieldReader); +impl STPIS_R { + pub(crate) fn new(bits: u8) -> Self { + STPIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STPIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STPIS` writer - Slope generation stop control input selection"] pub struct STPIS_W<'a> { w: &'a mut W, } @@ -283,13 +339,25 @@ impl<'a> STPIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `TRGIS`"] -pub type TRGIS_R = crate::R; -#[doc = "Write proxy for field `TRGIS`"] +#[doc = "Field `TRGIS` reader - External conversion trigger input selection"] +pub struct TRGIS_R(crate::FieldReader); +impl TRGIS_R { + pub(crate) fn new(bits: u8) -> Self { + TRGIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRGIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRGIS` writer - External conversion trigger input selection"] pub struct TRGIS_W<'a> { w: &'a mut W, } @@ -297,13 +365,25 @@ impl<'a> TRGIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } -#[doc = "Reader of field `STIS`"] -pub type STIS_R = crate::R; -#[doc = "Write proxy for field `STIS`"] +#[doc = "Field `STIS` reader - External shadow request enable input selection"] +pub struct STIS_R(crate::FieldReader); +impl STIS_R { + pub(crate) fn new(bits: u8) -> Self { + STIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STIS` writer - External shadow request enable input selection"] pub struct STIS_W<'a> { w: &'a mut W, } @@ -311,7 +391,7 @@ impl<'a> STIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -334,9 +414,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SCS`"] -pub type SCS_R = crate::R; +#[doc = "Field `SCS` reader - Slope generation clock selection"] +pub struct SCS_R(crate::FieldReader); impl SCS_R { + pub(crate) fn new(bits: u8) -> Self { + SCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCS_A { @@ -351,25 +434,32 @@ impl SCS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCS_A::VALUE1 + **self == SCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCS_A::VALUE2 + **self == SCS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SCS_A::VALUE3 + **self == SCS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SCS_A::VALUE4 + **self == SCS_A::VALUE4 } } -#[doc = "Write proxy for field `SCS`"] +impl core::ops::Deref for SCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCS` writer - Slope generation clock selection"] pub struct SCS_W<'a> { w: &'a mut W, } @@ -377,9 +467,7 @@ impl<'a> SCS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "HRPWMx.MCLK (Module clock is used)"] #[inline(always)] @@ -404,7 +492,7 @@ impl<'a> SCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -471,4 +559,30 @@ impl W { pub fn scs(&mut self) -> SCS_W { SCS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External input selection\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 [dci](index.html) module"] +pub struct DCI_SPEC; +impl crate::RegisterSpec for DCI_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dci::R](R) reader structure"] +impl crate::Readable for DCI_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dci::W](W) writer structure"] +impl crate::Writable for DCI_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DCI to value 0"] +impl crate::Resettable for DCI_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/dsv1.rs b/src/hrpwm0_csg0/dsv1.rs index d332b881..0552a251 100644 --- a/src/hrpwm0_csg0/dsv1.rs +++ b/src/hrpwm0_csg0/dsv1.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DSV1"] -pub type R = crate::R; -#[doc = "Reader of field `DSV1`"] -pub type DSV1_R = crate::R; +#[doc = "Register `DSV1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSV1` reader - DAC reference value 1"] +pub struct DSV1_R(crate::FieldReader); +impl DSV1_R { + pub(crate) fn new(bits: u16) -> Self { + DSV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:9 - DAC reference value 1"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DSV1_R::new((self.bits & 0x03ff) as u16) } } +#[doc = "DAC reference value 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsv1](index.html) module"] +pub struct DSV1_SPEC; +impl crate::RegisterSpec for DSV1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dsv1::R](R) reader structure"] +impl crate::Readable for DSV1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DSV1 to value 0"] +impl crate::Resettable for DSV1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_csg0/dsv2.rs b/src/hrpwm0_csg0/dsv2.rs index 1bee44bb..7e3c9a6d 100644 --- a/src/hrpwm0_csg0/dsv2.rs +++ b/src/hrpwm0_csg0/dsv2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DSV2"] -pub type R = crate::R; -#[doc = "Writer for register DSV2"] -pub type W = crate::W; -#[doc = "Register DSV2 `reset()`'s with value 0"] -impl crate::ResetValue for super::DSV2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DSV2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DSV2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DSV2`"] -pub type DSV2_R = crate::R; -#[doc = "Write proxy for field `DSV2`"] +#[doc = "Field `DSV2` reader - DAC reference value 2"] +pub struct DSV2_R(crate::FieldReader); +impl DSV2_R { + pub(crate) fn new(bits: u16) -> Self { + DSV2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSV2` writer - DAC reference value 2"] pub struct DSV2_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DSV2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dsv2(&mut self) -> DSV2_W { DSV2_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DAC reference value 1\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 [dsv2](index.html) module"] +pub struct DSV2_SPEC; +impl crate::RegisterSpec for DSV2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dsv2::R](R) reader structure"] +impl crate::Readable for DSV2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dsv2::W](W) writer structure"] +impl crate::Writable for DSV2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DSV2 to value 0"] +impl crate::Resettable for DSV2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/ies.rs b/src/hrpwm0_csg0/ies.rs index ee3e473a..fea42ec8 100644 --- a/src/hrpwm0_csg0/ies.rs +++ b/src/hrpwm0_csg0/ies.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IES"] -pub type R = crate::R; -#[doc = "Writer for register IES"] -pub type W = crate::W; -#[doc = "Register IES `reset()`'s with value 0"] -impl crate::ResetValue for super::IES { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IES` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "External value switch function level selection\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SVLS`"] -pub type SVLS_R = crate::R; +#[doc = "Field `SVLS` reader - External value switch function level selection"] +pub struct SVLS_R(crate::FieldReader); impl SVLS_R { + pub(crate) fn new(bits: u8) -> Self { + SVLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SVLS_A::VALUE1), - 1 => Val(SVLS_A::VALUE2), - 2 => Val(SVLS_A::VALUE3), - i => Res(i), + 0 => Some(SVLS_A::VALUE1), + 1 => Some(SVLS_A::VALUE2), + 2 => Some(SVLS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVLS_A::VALUE1 + **self == SVLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVLS_A::VALUE2 + **self == SVLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SVLS_A::VALUE3 + **self == SVLS_A::VALUE3 + } +} +impl core::ops::Deref for SVLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SVLS`"] +#[doc = "Field `SVLS` writer - External value switch function level selection"] pub struct SVLS_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> SVLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -108,9 +141,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STRES`"] -pub type STRES_R = crate::R; +#[doc = "Field `STRES` reader - External start function edge selection"] +pub struct STRES_R(crate::FieldReader); impl STRES_R { + pub(crate) fn new(bits: u8) -> Self { + STRES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRES_A { @@ -125,25 +161,32 @@ impl STRES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRES_A::VALUE1 + **self == STRES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRES_A::VALUE2 + **self == STRES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STRES_A::VALUE3 + **self == STRES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STRES_A::VALUE4 + **self == STRES_A::VALUE4 + } +} +impl core::ops::Deref for STRES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STRES`"] +#[doc = "Field `STRES` writer - External start function edge selection"] pub struct STRES_W<'a> { w: &'a mut W, } @@ -151,9 +194,7 @@ impl<'a> STRES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STRES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Function disabled"] #[inline(always)] @@ -178,7 +219,7 @@ impl<'a> STRES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -201,9 +242,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STPES`"] -pub type STPES_R = crate::R; +#[doc = "Field `STPES` reader - External stop function edge selection"] +pub struct STPES_R(crate::FieldReader); impl STPES_R { + pub(crate) fn new(bits: u8) -> Self { + STPES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STPES_A { @@ -218,25 +262,32 @@ impl STPES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STPES_A::VALUE1 + **self == STPES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STPES_A::VALUE2 + **self == STPES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STPES_A::VALUE3 + **self == STPES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STPES_A::VALUE4 + **self == STPES_A::VALUE4 } } -#[doc = "Write proxy for field `STPES`"] +impl core::ops::Deref for STPES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STPES` writer - External stop function edge selection"] pub struct STPES_W<'a> { w: &'a mut W, } @@ -244,9 +295,7 @@ impl<'a> STPES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STPES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Function disabled"] #[inline(always)] @@ -271,7 +320,7 @@ impl<'a> STPES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -294,9 +343,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRGES`"] -pub type TRGES_R = crate::R; +#[doc = "Field `TRGES` reader - External trigger function edge selection"] +pub struct TRGES_R(crate::FieldReader); impl TRGES_R { + pub(crate) fn new(bits: u8) -> Self { + TRGES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRGES_A { @@ -311,25 +363,32 @@ impl TRGES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRGES_A::VALUE1 + **self == TRGES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRGES_A::VALUE2 + **self == TRGES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRGES_A::VALUE3 + **self == TRGES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TRGES_A::VALUE4 + **self == TRGES_A::VALUE4 + } +} +impl core::ops::Deref for TRGES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TRGES`"] +#[doc = "Field `TRGES` writer - External trigger function edge selection"] pub struct TRGES_W<'a> { w: &'a mut W, } @@ -337,9 +396,7 @@ impl<'a> TRGES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRGES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Function disabled"] #[inline(always)] @@ -364,7 +421,7 @@ impl<'a> TRGES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -387,9 +444,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STES`"] -pub type STES_R = crate::R; +#[doc = "Field `STES` reader - External shadow transfer enable edge selection"] +pub struct STES_R(crate::FieldReader); impl STES_R { + pub(crate) fn new(bits: u8) -> Self { + STES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STES_A { @@ -404,25 +464,32 @@ impl STES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STES_A::VALUE1 + **self == STES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STES_A::VALUE2 + **self == STES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STES_A::VALUE3 + **self == STES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STES_A::VALUE4 + **self == STES_A::VALUE4 } } -#[doc = "Write proxy for field `STES`"] +impl core::ops::Deref for STES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STES` writer - External shadow transfer enable edge selection"] pub struct STES_W<'a> { w: &'a mut W, } @@ -430,9 +497,7 @@ impl<'a> STES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Function disabled"] #[inline(always)] @@ -457,7 +522,7 @@ impl<'a> STES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -514,4 +579,30 @@ impl W { pub fn stes(&mut self) -> STES_W { STES_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External input selection\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 [ies](index.html) module"] +pub struct IES_SPEC; +impl crate::RegisterSpec for IES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ies::R](R) reader structure"] +impl crate::Readable for IES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ies::W](W) writer structure"] +impl crate::Writable for IES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IES to value 0"] +impl crate::Resettable for IES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/istat.rs b/src/hrpwm0_csg0/istat.rs index 37aae61d..1f21f343 100644 --- a/src/hrpwm0_csg0/istat.rs +++ b/src/hrpwm0_csg0/istat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register ISTAT"] -pub type R = crate::R; +#[doc = "Register `ISTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Value switch from CSGyDSV1 to CSGyDSV2 interrupt status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VLS1S_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VLS1S`"] -pub type VLS1S_R = crate::R; +#[doc = "Field `VLS1S` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt status"] +pub struct VLS1S_R(crate::FieldReader); impl VLS1S_R { + pub(crate) fn new(bits: bool) -> Self { + VLS1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VLS1S_A { @@ -28,12 +44,19 @@ impl VLS1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VLS1S_A::VALUE1 + **self == VLS1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VLS1S_A::VALUE2 + **self == VLS1S_A::VALUE2 + } +} +impl core::ops::Deref for VLS1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Value switch from CSGyDSV2 to CSGyDSV1 interrupt status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VLS2S`"] -pub type VLS2S_R = crate::R; +#[doc = "Field `VLS2S` reader - Value switch from CSGyDSV2 to CSGyDSV1 interrupt status"] +pub struct VLS2S_R(crate::FieldReader); impl VLS2S_R { + pub(crate) fn new(bits: bool) -> Self { + VLS2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VLS2S_A { @@ -64,12 +90,19 @@ impl VLS2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VLS2S_A::VALUE1 + **self == VLS2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VLS2S_A::VALUE2 + **self == VLS2S_A::VALUE2 + } +} +impl core::ops::Deref for VLS2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Conversion trigger status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TRGSS`"] -pub type TRGSS_R = crate::R; +#[doc = "Field `TRGSS` reader - Conversion trigger status"] +pub struct TRGSS_R(crate::FieldReader); impl TRGSS_R { + pub(crate) fn new(bits: bool) -> Self { + TRGSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRGSS_A { @@ -100,12 +136,19 @@ impl TRGSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRGSS_A::VALUE1 + **self == TRGSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRGSS_A::VALUE2 + **self == TRGSS_A::VALUE2 + } +} +impl core::ops::Deref for TRGSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Start trigger interrupt status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STRSS`"] -pub type STRSS_R = crate::R; +#[doc = "Field `STRSS` reader - Start trigger interrupt status"] +pub struct STRSS_R(crate::FieldReader); impl STRSS_R { + pub(crate) fn new(bits: bool) -> Self { + STRSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STRSS_A { @@ -136,12 +182,19 @@ impl STRSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STRSS_A::VALUE1 + **self == STRSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STRSS_A::VALUE2 + **self == STRSS_A::VALUE2 + } +} +impl core::ops::Deref for STRSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Stop trigger interrupt status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STPSS`"] -pub type STPSS_R = crate::R; +#[doc = "Field `STPSS` reader - Stop trigger interrupt status"] +pub struct STPSS_R(crate::FieldReader); impl STPSS_R { + pub(crate) fn new(bits: bool) -> Self { + STPSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STPSS_A { @@ -172,12 +228,19 @@ impl STPSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STPSS_A::VALUE1 + **self == STPSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STPSS_A::VALUE2 + **self == STPSS_A::VALUE2 + } +} +impl core::ops::Deref for STPSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Shadow transfer interrupt status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STDS`"] -pub type STDS_R = crate::R; +#[doc = "Field `STDS` reader - Shadow transfer interrupt status"] +pub struct STDS_R(crate::FieldReader); impl STDS_R { + pub(crate) fn new(bits: bool) -> Self { + STDS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STDS_A { @@ -208,12 +274,19 @@ impl STDS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STDS_A::VALUE1 + **self == STDS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STDS_A::VALUE2 + **self == STDS_A::VALUE2 + } +} +impl core::ops::Deref for STDS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Comparator rise interrupt status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CRSS`"] -pub type CRSS_R = crate::R; +#[doc = "Field `CRSS` reader - Comparator rise interrupt status"] +pub struct CRSS_R(crate::FieldReader); impl CRSS_R { + pub(crate) fn new(bits: bool) -> Self { + CRSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CRSS_A { @@ -244,12 +320,19 @@ impl CRSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CRSS_A::VALUE1 + **self == CRSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CRSS_A::VALUE2 + **self == CRSS_A::VALUE2 + } +} +impl core::ops::Deref for CRSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Comparator fall interrupt status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CFSS`"] -pub type CFSS_R = crate::R; +#[doc = "Field `CFSS` reader - Comparator fall interrupt status"] +pub struct CFSS_R(crate::FieldReader); impl CFSS_R { + pub(crate) fn new(bits: bool) -> Self { + CFSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CFSS_A { @@ -280,12 +366,19 @@ impl CFSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CFSS_A::VALUE1 + **self == CFSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CFSS_A::VALUE2 + **self == CFSS_A::VALUE2 + } +} +impl core::ops::Deref for CFSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Comparator clamped interrupt status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CSES`"] -pub type CSES_R = crate::R; +#[doc = "Field `CSES` reader - Comparator clamped interrupt status"] +pub struct CSES_R(crate::FieldReader); impl CSES_R { + pub(crate) fn new(bits: bool) -> Self { + CSES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSES_A { @@ -316,12 +412,19 @@ impl CSES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSES_A::VALUE1 + **self == CSES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSES_A::VALUE2 + **self == CSES_A::VALUE2 + } +} +impl core::ops::Deref for CSES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { CSES_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Service request status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [istat](index.html) module"] +pub struct ISTAT_SPEC; +impl crate::RegisterSpec for ISTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [istat::R](R) reader structure"] +impl crate::Readable for ISTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ISTAT to value 0"] +impl crate::Resettable for ISTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_csg0/pc.rs b/src/hrpwm0_csg0/pc.rs index a6a1bf80..54e89fb1 100644 --- a/src/hrpwm0_csg0/pc.rs +++ b/src/hrpwm0_csg0/pc.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register PC"] -pub type R = crate::R; -#[doc = "Reader of field `PSWV`"] -pub type PSWV_R = crate::R; +#[doc = "Register `PC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `PSWV` reader - Pulse swallow configuration"] +pub struct PSWV_R(crate::FieldReader); +impl PSWV_R { + pub(crate) fn new(bits: u8) -> Self { + PSWV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PSWV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:5 - Pulse swallow configuration"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { PSWV_R::new((self.bits & 0x3f) as u8) } } +#[doc = "Pulse swallow configuration\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pc](index.html) module"] +pub struct PC_SPEC; +impl crate::RegisterSpec for PC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pc::R](R) reader structure"] +impl crate::Readable for PC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PC to value 0"] +impl crate::Resettable for PC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_csg0/plc.rs b/src/hrpwm0_csg0/plc.rs index 7dc7e07b..73adb1da 100644 --- a/src/hrpwm0_csg0/plc.rs +++ b/src/hrpwm0_csg0/plc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PLC"] -pub type R = crate::R; -#[doc = "Writer for register PLC"] -pub type W = crate::W; -#[doc = "Register PLC `reset()`'s with value 0"] -impl crate::ResetValue for super::PLC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PLC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clamping control signal selector\n\nValue on reset: 0"] @@ -53,9 +77,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `IPLS`"] -pub type IPLS_R = crate::R; +#[doc = "Field `IPLS` reader - Clamping control signal selector"] +pub struct IPLS_R(crate::FieldReader); impl IPLS_R { + pub(crate) fn new(bits: u8) -> Self { + IPLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IPLS_A { @@ -82,85 +109,92 @@ impl IPLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IPLS_A::VALUE1 + **self == IPLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IPLS_A::VALUE2 + **self == IPLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == IPLS_A::VALUE3 + **self == IPLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == IPLS_A::VALUE4 + **self == IPLS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == IPLS_A::VALUE5 + **self == IPLS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == IPLS_A::VALUE6 + **self == IPLS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == IPLS_A::VALUE7 + **self == IPLS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == IPLS_A::VALUE8 + **self == IPLS_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == IPLS_A::VALUE9 + **self == IPLS_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == IPLS_A::VALUE10 + **self == IPLS_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == IPLS_A::VALUE11 + **self == IPLS_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == IPLS_A::VALUE12 + **self == IPLS_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == IPLS_A::VALUE13 + **self == IPLS_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == IPLS_A::VALUE14 + **self == IPLS_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == IPLS_A::VALUE15 + **self == IPLS_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == IPLS_A::VALUE16 + **self == IPLS_A::VALUE16 + } +} +impl core::ops::Deref for IPLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IPLS`"] +#[doc = "Field `IPLS` writer - Clamping control signal selector"] pub struct IPLS_W<'a> { w: &'a mut W, } @@ -168,9 +202,7 @@ impl<'a> IPLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IPLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "HRPWMx.BLyA"] #[inline(always)] @@ -255,7 +287,7 @@ impl<'a> IPLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -276,37 +308,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PLCL`"] -pub type PLCL_R = crate::R; +#[doc = "Field `PLCL` reader - Clamping control signal level selection"] +pub struct PLCL_R(crate::FieldReader); impl PLCL_R { + pub(crate) fn new(bits: u8) -> Self { + PLCL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PLCL_A::VALUE1), - 1 => Val(PLCL_A::VALUE2), - 2 => Val(PLCL_A::VALUE3), - i => Res(i), + 0 => Some(PLCL_A::VALUE1), + 1 => Some(PLCL_A::VALUE2), + 2 => Some(PLCL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLCL_A::VALUE1 + **self == PLCL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLCL_A::VALUE2 + **self == PLCL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PLCL_A::VALUE3 + **self == PLCL_A::VALUE3 + } +} +impl core::ops::Deref for PLCL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PLCL`"] +#[doc = "Field `PLCL` writer - Clamping control signal level selection"] pub struct PLCL_W<'a> { w: &'a mut W, } @@ -334,7 +375,7 @@ impl<'a> PLCL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -352,9 +393,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL`"] -pub type PSL_R = crate::R; +#[doc = "Field `PSL` reader - Output passive level value"] +pub struct PSL_R(crate::FieldReader); impl PSL_R { + pub(crate) fn new(bits: bool) -> Self { + PSL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL_A { @@ -366,15 +410,22 @@ impl PSL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL_A::VALUE1 + **self == PSL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL_A::VALUE2 + **self == PSL_A::VALUE2 + } +} +impl core::ops::Deref for PSL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSL`"] +#[doc = "Field `PSL` writer - Output passive level value"] pub struct PSL_W<'a> { w: &'a mut W, } @@ -382,9 +433,7 @@ impl<'a> PSL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Output clamped level is LOW"] #[inline(always)] @@ -409,7 +458,7 @@ impl<'a> PSL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -427,9 +476,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLSW`"] -pub type PLSW_R = crate::R; +#[doc = "Field `PLSW` reader - Clamped state exit SW configuration"] +pub struct PLSW_R(crate::FieldReader); impl PLSW_R { + pub(crate) fn new(bits: bool) -> Self { + PLSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLSW_A { @@ -441,15 +493,22 @@ impl PLSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLSW_A::VALUE1 + **self == PLSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLSW_A::VALUE2 + **self == PLSW_A::VALUE2 + } +} +impl core::ops::Deref for PLSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PLSW`"] +#[doc = "Field `PLSW` writer - Clamped state exit SW configuration"] pub struct PLSW_W<'a> { w: &'a mut W, } @@ -457,9 +516,7 @@ impl<'a> PLSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PLSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External signal and SW can remove the output from the clamped state"] #[inline(always)] @@ -484,7 +541,7 @@ impl<'a> PLSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -505,37 +562,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PLEC`"] -pub type PLEC_R = crate::R; +#[doc = "Field `PLEC` reader - Passive level enter configuration"] +pub struct PLEC_R(crate::FieldReader); impl PLEC_R { + pub(crate) fn new(bits: u8) -> Self { + PLEC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PLEC_A::VALUE1), - 1 => Val(PLEC_A::VALUE2), - 2 => Val(PLEC_A::VALUE3), - i => Res(i), + 0 => Some(PLEC_A::VALUE1), + 1 => Some(PLEC_A::VALUE2), + 2 => Some(PLEC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLEC_A::VALUE1 + **self == PLEC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLEC_A::VALUE2 + **self == PLEC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PLEC_A::VALUE3 + **self == PLEC_A::VALUE3 + } +} +impl core::ops::Deref for PLEC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PLEC`"] +#[doc = "Field `PLEC` writer - Passive level enter configuration"] pub struct PLEC_W<'a> { w: &'a mut W, } @@ -563,7 +629,7 @@ impl<'a> PLEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -584,37 +650,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PLXC`"] -pub type PLXC_R = crate::R; +#[doc = "Field `PLXC` reader - Passive level exit configuration"] +pub struct PLXC_R(crate::FieldReader); impl PLXC_R { + pub(crate) fn new(bits: u8) -> Self { + PLXC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PLXC_A::VALUE1), - 1 => Val(PLXC_A::VALUE2), - 2 => Val(PLXC_A::VALUE3), - i => Res(i), + 0 => Some(PLXC_A::VALUE1), + 1 => Some(PLXC_A::VALUE2), + 2 => Some(PLXC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLXC_A::VALUE1 + **self == PLXC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLXC_A::VALUE2 + **self == PLXC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PLXC_A::VALUE3 + **self == PLXC_A::VALUE3 } } -#[doc = "Write proxy for field `PLXC`"] +impl core::ops::Deref for PLXC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PLXC` writer - Passive level exit configuration"] pub struct PLXC_W<'a> { w: &'a mut W, } @@ -642,7 +717,7 @@ impl<'a> PLXC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -709,4 +784,30 @@ impl W { pub fn plxc(&mut self) -> PLXC_W { PLXC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Passive level configuration\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 [plc](index.html) module"] +pub struct PLC_SPEC; +impl crate::RegisterSpec for PLC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [plc::R](R) reader structure"] +impl crate::Readable for PLC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [plc::W](W) writer structure"] +impl crate::Writable for PLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PLC to value 0"] +impl crate::Resettable for PLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/sc.rs b/src/hrpwm0_csg0/sc.rs index 8ac25b3d..d1792091 100644 --- a/src/hrpwm0_csg0/sc.rs +++ b/src/hrpwm0_csg0/sc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SC"] -pub type R = crate::R; -#[doc = "Writer for register SC"] -pub type W = crate::W; -#[doc = "Register SC `reset()`'s with value 0"] -impl crate::ResetValue for super::SC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Prescaler external start configuration\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PSRM`"] -pub type PSRM_R = crate::R; +#[doc = "Field `PSRM` reader - Prescaler external start configuration"] +pub struct PSRM_R(crate::FieldReader); impl PSRM_R { + pub(crate) fn new(bits: u8) -> Self { + PSRM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSRM_A { @@ -46,25 +73,32 @@ impl PSRM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSRM_A::VALUE1 + **self == PSRM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSRM_A::VALUE2 + **self == PSRM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PSRM_A::VALUE3 + **self == PSRM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PSRM_A::VALUE4 + **self == PSRM_A::VALUE4 + } +} +impl core::ops::Deref for PSRM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSRM`"] +#[doc = "Field `PSRM` writer - Prescaler external start configuration"] pub struct PSRM_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> PSRM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSRM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External start trigger is ignored"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> PSRM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PSTM`"] -pub type PSTM_R = crate::R; +#[doc = "Field `PSTM` reader - Prescaler external stop configuration"] +pub struct PSTM_R(crate::FieldReader); impl PSTM_R { + pub(crate) fn new(bits: u8) -> Self { + PSTM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSTM_A { @@ -139,25 +174,32 @@ impl PSTM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSTM_A::VALUE1 + **self == PSTM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSTM_A::VALUE2 + **self == PSTM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PSTM_A::VALUE3 + **self == PSTM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PSTM_A::VALUE4 + **self == PSTM_A::VALUE4 + } +} +impl core::ops::Deref for PSTM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSTM`"] +#[doc = "Field `PSTM` writer - Prescaler external stop configuration"] pub struct PSTM_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> PSTM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSTM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External stop trigger is ignored"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> PSTM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -210,9 +250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FPD`"] -pub type FPD_R = crate::R; +#[doc = "Field `FPD` reader - Fixed division disable"] +pub struct FPD_R(crate::FieldReader); impl FPD_R { + pub(crate) fn new(bits: bool) -> Self { + FPD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FPD_A { @@ -224,15 +267,22 @@ impl FPD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FPD_A::VALUE1 + **self == FPD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FPD_A::VALUE2 + **self == FPD_A::VALUE2 } } -#[doc = "Write proxy for field `FPD`"] +impl core::ops::Deref for FPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FPD` writer - Fixed division disable"] pub struct FPD_W<'a> { w: &'a mut W, } @@ -240,9 +290,7 @@ impl<'a> FPD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FPD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Division by 4 enabled"] #[inline(always)] @@ -267,7 +315,7 @@ impl<'a> FPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -290,9 +338,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PSV`"] -pub type PSV_R = crate::R; +#[doc = "Field `PSV` reader - Prescaler division factor"] +pub struct PSV_R(crate::FieldReader); impl PSV_R { + pub(crate) fn new(bits: u8) -> Self { + PSV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSV_A { @@ -307,25 +358,32 @@ impl PSV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSV_A::VALUE1 + **self == PSV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSV_A::VALUE2 + **self == PSV_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PSV_A::VALUE3 + **self == PSV_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PSV_A::VALUE4 + **self == PSV_A::VALUE4 } } -#[doc = "Write proxy for field `PSV`"] +impl core::ops::Deref for PSV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSV` writer - Prescaler division factor"] pub struct PSV_W<'a> { w: &'a mut W, } @@ -333,9 +391,7 @@ impl<'a> PSV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSV_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "division by 1"] #[inline(always)] @@ -360,7 +416,7 @@ impl<'a> PSV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5); + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); self.w } } @@ -383,9 +439,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SCM`"] -pub type SCM_R = crate::R; +#[doc = "Field `SCM` reader - Slope control mode"] +pub struct SCM_R(crate::FieldReader); impl SCM_R { + pub(crate) fn new(bits: u8) -> Self { + SCM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCM_A { @@ -400,25 +459,32 @@ impl SCM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCM_A::VALUE1 + **self == SCM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCM_A::VALUE2 + **self == SCM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SCM_A::VALUE3 + **self == SCM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SCM_A::VALUE4 + **self == SCM_A::VALUE4 + } +} +impl core::ops::Deref for SCM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SCM`"] +#[doc = "Field `SCM` writer - Slope control mode"] pub struct SCM_W<'a> { w: &'a mut W, } @@ -426,9 +492,7 @@ impl<'a> SCM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Slope generation disabled. Used when the switch between the two reference values, CSGyDSV1This register contains the actual value used for the DSV1 reference. and CSGyDSV2This register contains the actual value used for the DSV2 reference. is done via external signal."] #[inline(always)] @@ -453,7 +517,7 @@ impl<'a> SCM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -474,37 +538,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SSRM`"] -pub type SSRM_R = crate::R; +#[doc = "Field `SSRM` reader - Slope external start configuration"] +pub struct SSRM_R(crate::FieldReader); impl SSRM_R { + pub(crate) fn new(bits: u8) -> Self { + SSRM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SSRM_A::VALUE1), - 1 => Val(SSRM_A::VALUE2), - 2 => Val(SSRM_A::VALUE3), - i => Res(i), + 0 => Some(SSRM_A::VALUE1), + 1 => Some(SSRM_A::VALUE2), + 2 => Some(SSRM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SSRM_A::VALUE1 + **self == SSRM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SSRM_A::VALUE2 + **self == SSRM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SSRM_A::VALUE3 + **self == SSRM_A::VALUE3 + } +} +impl core::ops::Deref for SSRM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SSRM`"] +#[doc = "Field `SSRM` writer - Slope external start configuration"] pub struct SSRM_W<'a> { w: &'a mut W, } @@ -532,7 +605,7 @@ impl<'a> SSRM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -553,37 +626,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SSTM`"] -pub type SSTM_R = crate::R; +#[doc = "Field `SSTM` reader - Slope external stop configuration"] +pub struct SSTM_R(crate::FieldReader); impl SSTM_R { + pub(crate) fn new(bits: u8) -> Self { + SSTM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SSTM_A::VALUE1), - 1 => Val(SSTM_A::VALUE2), - 2 => Val(SSTM_A::VALUE3), - i => Res(i), + 0 => Some(SSTM_A::VALUE1), + 1 => Some(SSTM_A::VALUE2), + 2 => Some(SSTM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SSTM_A::VALUE1 + **self == SSTM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SSTM_A::VALUE2 + **self == SSTM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SSTM_A::VALUE3 + **self == SSTM_A::VALUE3 + } +} +impl core::ops::Deref for SSTM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SSTM`"] +#[doc = "Field `SSTM` writer - Slope external stop configuration"] pub struct SSTM_W<'a> { w: &'a mut W, } @@ -611,7 +693,7 @@ impl<'a> SSTM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -632,37 +714,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SVSC`"] -pub type SVSC_R = crate::R; +#[doc = "Field `SVSC` reader - Slope reference value mode"] +pub struct SVSC_R(crate::FieldReader); impl SVSC_R { + pub(crate) fn new(bits: u8) -> Self { + SVSC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SVSC_A::VALUE1), - 1 => Val(SVSC_A::VALUE2), - 2 => Val(SVSC_A::VALUE3), - i => Res(i), + 0 => Some(SVSC_A::VALUE1), + 1 => Some(SVSC_A::VALUE2), + 2 => Some(SVSC_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVSC_A::VALUE1 + **self == SVSC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVSC_A::VALUE2 + **self == SVSC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SVSC_A::VALUE3 + **self == SVSC_A::VALUE3 } } -#[doc = "Write proxy for field `SVSC`"] +impl core::ops::Deref for SVSC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SVSC` writer - Slope reference value mode"] pub struct SVSC_W<'a> { w: &'a mut W, } @@ -690,7 +781,7 @@ impl<'a> SVSC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -713,9 +804,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SWSM`"] -pub type SWSM_R = crate::R; +#[doc = "Field `SWSM` reader - Initial DAC start mode"] +pub struct SWSM_R(crate::FieldReader); impl SWSM_R { + pub(crate) fn new(bits: u8) -> Self { + SWSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SWSM_A { @@ -730,25 +824,32 @@ impl SWSM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SWSM_A::VALUE1 + **self == SWSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SWSM_A::VALUE2 + **self == SWSM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SWSM_A::VALUE3 + **self == SWSM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SWSM_A::VALUE4 + **self == SWSM_A::VALUE4 } } -#[doc = "Write proxy for field `SWSM`"] +impl core::ops::Deref for SWSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWSM` writer - Initial DAC start mode"] pub struct SWSM_W<'a> { w: &'a mut W, } @@ -756,9 +857,7 @@ impl<'a> SWSM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SWSM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGyDSV2This register contains the actual value used for the DSV2 reference. is fed to the DAC and initial conversion trigger is generated."] #[inline(always)] @@ -783,7 +882,7 @@ impl<'a> SWSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -806,9 +905,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `GCFG`"] -pub type GCFG_R = crate::R; +#[doc = "Field `GCFG` reader - Slope step gain configuration"] +pub struct GCFG_R(crate::FieldReader); impl GCFG_R { + pub(crate) fn new(bits: u8) -> Self { + GCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GCFG_A { @@ -823,25 +925,32 @@ impl GCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GCFG_A::VALUE1 + **self == GCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GCFG_A::VALUE2 + **self == GCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == GCFG_A::VALUE3 + **self == GCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == GCFG_A::VALUE4 + **self == GCFG_A::VALUE4 + } +} +impl core::ops::Deref for GCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GCFG`"] +#[doc = "Field `GCFG` writer - Slope step gain configuration"] pub struct GCFG_W<'a> { w: &'a mut W, } @@ -849,9 +958,7 @@ impl<'a> GCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GCFG_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Each slope step has an increment/decrement of 1"] #[inline(always)] @@ -876,13 +983,25 @@ impl<'a> GCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } -#[doc = "Reader of field `IST`"] -pub type IST_R = crate::R; -#[doc = "Write proxy for field `IST`"] +#[doc = "Field `IST` reader - Immediate shadow transfer"] +pub struct IST_R(crate::FieldReader); +impl IST_R { + pub(crate) fn new(bits: bool) -> Self { + IST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IST` writer - Immediate shadow transfer"] pub struct IST_W<'a> { w: &'a mut W, } @@ -900,7 +1019,7 @@ impl<'a> IST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -918,9 +1037,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSE`"] -pub type PSE_R = crate::R; +#[doc = "Field `PSE` reader - Pulse swallow enable"] +pub struct PSE_R(crate::FieldReader); impl PSE_R { + pub(crate) fn new(bits: bool) -> Self { + PSE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSE_A { @@ -932,15 +1054,22 @@ impl PSE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSE_A::VALUE1 + **self == PSE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSE_A::VALUE2 + **self == PSE_A::VALUE2 } } -#[doc = "Write proxy for field `PSE`"] +impl core::ops::Deref for PSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSE` writer - Pulse swallow enable"] pub struct PSE_W<'a> { w: &'a mut W, } @@ -948,9 +1077,7 @@ impl<'a> PSE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pulse swallow disabled"] #[inline(always)] @@ -975,7 +1102,7 @@ impl<'a> PSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -996,37 +1123,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PSWM`"] -pub type PSWM_R = crate::R; +#[doc = "Field `PSWM` reader - Pulse swallow window mode"] +pub struct PSWM_R(crate::FieldReader); impl PSWM_R { + pub(crate) fn new(bits: u8) -> Self { + PSWM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PSWM_A::VALUE1), - 1 => Val(PSWM_A::VALUE2), - 2 => Val(PSWM_A::VALUE3), - i => Res(i), + 0 => Some(PSWM_A::VALUE1), + 1 => Some(PSWM_A::VALUE2), + 2 => Some(PSWM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSWM_A::VALUE1 + **self == PSWM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSWM_A::VALUE2 + **self == PSWM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PSWM_A::VALUE3 + **self == PSWM_A::VALUE3 } } -#[doc = "Write proxy for field `PSWM`"] +impl core::ops::Deref for PSWM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSWM` writer - Pulse swallow window mode"] pub struct PSWM_W<'a> { w: &'a mut W, } @@ -1054,7 +1190,7 @@ impl<'a> PSWM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1191,4 +1327,30 @@ impl W { pub fn pswm(&mut self) -> PSWM_W { PSWM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope generation control\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 [sc](index.html) module"] +pub struct SC_SPEC; +impl crate::RegisterSpec for SC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sc::R](R) reader structure"] +impl crate::Readable for SC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sc::W](W) writer structure"] +impl crate::Writable for SC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SC to value 0"] +impl crate::Resettable for SC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/sdsv1.rs b/src/hrpwm0_csg0/sdsv1.rs index f6c1db6b..84044ec1 100644 --- a/src/hrpwm0_csg0/sdsv1.rs +++ b/src/hrpwm0_csg0/sdsv1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SDSV1"] -pub type R = crate::R; -#[doc = "Writer for register SDSV1"] -pub type W = crate::W; -#[doc = "Register SDSV1 `reset()`'s with value 0"] -impl crate::ResetValue for super::SDSV1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SDSV1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDSV1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SDSV1`"] -pub type SDSV1_R = crate::R; -#[doc = "Write proxy for field `SDSV1`"] +#[doc = "Field `SDSV1` reader - Shadow DAC reference value 1"] +pub struct SDSV1_R(crate::FieldReader); +impl SDSV1_R { + pub(crate) fn new(bits: u16) -> Self { + SDSV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SDSV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SDSV1` writer - Shadow DAC reference value 1"] pub struct SDSV1_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SDSV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sdsv1(&mut self) -> SDSV1_W { SDSV1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shadow reference value 1\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 [sdsv1](index.html) module"] +pub struct SDSV1_SPEC; +impl crate::RegisterSpec for SDSV1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sdsv1::R](R) reader structure"] +impl crate::Readable for SDSV1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sdsv1::W](W) writer structure"] +impl crate::Writable for SDSV1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDSV1 to value 0"] +impl crate::Resettable for SDSV1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/spc.rs b/src/hrpwm0_csg0/spc.rs index cdd7b0ea..f55ac566 100644 --- a/src/hrpwm0_csg0/spc.rs +++ b/src/hrpwm0_csg0/spc.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SPC"] -pub type R = crate::R; -#[doc = "Writer for register SPC"] -pub type W = crate::W; -#[doc = "Register SPC `reset()`'s with value 0"] -impl crate::ResetValue for super::SPC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SPC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SPC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SPSWV`"] -pub type SPSWV_R = crate::R; -#[doc = "Write proxy for field `SPSWV`"] +#[doc = "Field `SPSWV` reader - Shadow pulse swallow value"] +pub struct SPSWV_R(crate::FieldReader); +impl SPSWV_R { + pub(crate) fn new(bits: u8) -> Self { + SPSWV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPSWV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPSWV` writer - Shadow pulse swallow value"] pub struct SPSWV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SPSWV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn spswv(&mut self) -> SPSWV_W { SPSWV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shadow Pulse swallow value\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 [spc](index.html) module"] +pub struct SPC_SPEC; +impl crate::RegisterSpec for SPC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [spc::R](R) reader structure"] +impl crate::Readable for SPC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [spc::W](W) writer structure"] +impl crate::Writable for SPC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SPC to value 0"] +impl crate::Resettable for SPC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/sre.rs b/src/hrpwm0_csg0/sre.rs index f45cbd47..57bc3dd9 100644 --- a/src/hrpwm0_csg0/sre.rs +++ b/src/hrpwm0_csg0/sre.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SRE"] -pub type R = crate::R; -#[doc = "Writer for register SRE"] -pub type W = crate::W; -#[doc = "Register SRE `reset()`'s with value 0"] -impl crate::ResetValue for super::SRE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `VLS1E` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] +pub struct VLS1E_R(crate::FieldReader); +impl VLS1E_R { + pub(crate) fn new(bits: bool) -> Self { + VLS1E_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VLS1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `VLS1E`"] -pub type VLS1E_R = crate::R; -#[doc = "Write proxy for field `VLS1E`"] +#[doc = "Field `VLS1E` writer - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] pub struct VLS1E_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> VLS1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `VLS2E`"] -pub type VLS2E_R = crate::R; -#[doc = "Write proxy for field `VLS2E`"] +#[doc = "Field `VLS2E` reader - Value switch from CSGyDSV2 to CSGyDSV1 interrupt enable"] +pub struct VLS2E_R(crate::FieldReader); +impl VLS2E_R { + pub(crate) fn new(bits: bool) -> Self { + VLS2E_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VLS2E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VLS2E` writer - Value switch from CSGyDSV2 to CSGyDSV1 interrupt enable"] pub struct VLS2E_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> VLS2E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `TRGSE`"] -pub type TRGSE_R = crate::R; -#[doc = "Write proxy for field `TRGSE`"] +#[doc = "Field `TRGSE` reader - Conversion trigger interrupt enable"] +pub struct TRGSE_R(crate::FieldReader); +impl TRGSE_R { + pub(crate) fn new(bits: bool) -> Self { + TRGSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRGSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRGSE` writer - Conversion trigger interrupt enable"] pub struct TRGSE_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> TRGSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `STRSE`"] -pub type STRSE_R = crate::R; -#[doc = "Write proxy for field `STRSE`"] +#[doc = "Field `STRSE` reader - Start trigger interrupt enable"] +pub struct STRSE_R(crate::FieldReader); +impl STRSE_R { + pub(crate) fn new(bits: bool) -> Self { + STRSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STRSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STRSE` writer - Start trigger interrupt enable"] pub struct STRSE_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> STRSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `STPSE`"] -pub type STPSE_R = crate::R; -#[doc = "Write proxy for field `STPSE`"] +#[doc = "Field `STPSE` reader - Stop trigger interrupt enable"] +pub struct STPSE_R(crate::FieldReader); +impl STPSE_R { + pub(crate) fn new(bits: bool) -> Self { + STPSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STPSE` writer - Stop trigger interrupt enable"] pub struct STPSE_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> STPSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `STDE`"] -pub type STDE_R = crate::R; -#[doc = "Write proxy for field `STDE`"] +#[doc = "Field `STDE` reader - Shadow transfer done interrupt enable"] +pub struct STDE_R(crate::FieldReader); +impl STDE_R { + pub(crate) fn new(bits: bool) -> Self { + STDE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STDE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STDE` writer - Shadow transfer done interrupt enable"] pub struct STDE_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> STDE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CRSE`"] -pub type CRSE_R = crate::R; -#[doc = "Write proxy for field `CRSE`"] +#[doc = "Field `CRSE` reader - Comparator rise interrupt enable"] +pub struct CRSE_R(crate::FieldReader); +impl CRSE_R { + pub(crate) fn new(bits: bool) -> Self { + CRSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRSE` writer - Comparator rise interrupt enable"] pub struct CRSE_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CRSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CFSE`"] -pub type CFSE_R = crate::R; -#[doc = "Write proxy for field `CFSE`"] +#[doc = "Field `CFSE` reader - Comparator fall interrupt enable"] +pub struct CFSE_R(crate::FieldReader); +impl CFSE_R { + pub(crate) fn new(bits: bool) -> Self { + CFSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CFSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CFSE` writer - Comparator fall interrupt enable"] pub struct CFSE_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> CFSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `CSEE`"] -pub type CSEE_R = crate::R; -#[doc = "Write proxy for field `CSEE`"] +#[doc = "Field `CSEE` reader - Clamped state interrupt enable"] +pub struct CSEE_R(crate::FieldReader); +impl CSEE_R { + pub(crate) fn new(bits: bool) -> Self { + CSEE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CSEE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CSEE` writer - Clamped state interrupt enable"] pub struct CSEE_W<'a> { w: &'a mut W, } @@ -222,7 +354,7 @@ impl<'a> CSEE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -319,4 +451,30 @@ impl W { pub fn csee(&mut self) -> CSEE_W { CSEE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service request enable\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 [sre](index.html) module"] +pub struct SRE_SPEC; +impl crate::RegisterSpec for SRE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sre::R](R) reader structure"] +impl crate::Readable for SRE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sre::W](W) writer structure"] +impl crate::Writable for SRE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRE to value 0"] +impl crate::Resettable for SRE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/srs.rs b/src/hrpwm0_csg0/srs.rs index 18bb8eab..8c4145a3 100644 --- a/src/hrpwm0_csg0/srs.rs +++ b/src/hrpwm0_csg0/srs.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SRS"] -pub type R = crate::R; -#[doc = "Writer for register SRS"] -pub type W = crate::W; -#[doc = "Register SRS `reset()`'s with value 0"] -impl crate::ResetValue for super::SRS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `VLS1S`"] -pub type VLS1S_R = crate::R; +#[doc = "Field `VLS1S` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection"] +pub struct VLS1S_R(crate::FieldReader); impl VLS1S_R { + pub(crate) fn new(bits: u8) -> Self { + VLS1S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VLS1S_A { @@ -46,25 +73,32 @@ impl VLS1S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VLS1S_A::VALUE1 + **self == VLS1S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VLS1S_A::VALUE2 + **self == VLS1S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == VLS1S_A::VALUE3 + **self == VLS1S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == VLS1S_A::VALUE4 + **self == VLS1S_A::VALUE4 } } -#[doc = "Write proxy for field `VLS1S`"] +impl core::ops::Deref for VLS1S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VLS1S` writer - Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection"] pub struct VLS1S_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> VLS1S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VLS1S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> VLS1S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `VLS2S`"] -pub type VLS2S_R = crate::R; +#[doc = "Field `VLS2S` reader - Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection"] +pub struct VLS2S_R(crate::FieldReader); impl VLS2S_R { + pub(crate) fn new(bits: u8) -> Self { + VLS2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VLS2S_A { @@ -139,25 +174,32 @@ impl VLS2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VLS2S_A::VALUE1 + **self == VLS2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VLS2S_A::VALUE2 + **self == VLS2S_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == VLS2S_A::VALUE3 + **self == VLS2S_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == VLS2S_A::VALUE4 + **self == VLS2S_A::VALUE4 + } +} +impl core::ops::Deref for VLS2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VLS2S`"] +#[doc = "Field `VLS2S` writer - Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection"] pub struct VLS2S_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> VLS2S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VLS2S_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> VLS2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -215,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRLS`"] -pub type TRLS_R = crate::R; +#[doc = "Field `TRLS` reader - Conversion trigger interrupt line selection"] +pub struct TRLS_R(crate::FieldReader); impl TRLS_R { + pub(crate) fn new(bits: u8) -> Self { + TRLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRLS_A { @@ -232,25 +275,32 @@ impl TRLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRLS_A::VALUE1 + **self == TRLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRLS_A::VALUE2 + **self == TRLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRLS_A::VALUE3 + **self == TRLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TRLS_A::VALUE4 + **self == TRLS_A::VALUE4 } } -#[doc = "Write proxy for field `TRLS`"] +impl core::ops::Deref for TRLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRLS` writer - Conversion trigger interrupt line selection"] pub struct TRLS_W<'a> { w: &'a mut W, } @@ -258,9 +308,7 @@ impl<'a> TRLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -285,7 +333,7 @@ impl<'a> TRLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -308,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SSLS`"] -pub type SSLS_R = crate::R; +#[doc = "Field `SSLS` reader - Start/Stop trigger interrupt line selection"] +pub struct SSLS_R(crate::FieldReader); impl SSLS_R { + pub(crate) fn new(bits: u8) -> Self { + SSLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SSLS_A { @@ -325,25 +376,32 @@ impl SSLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SSLS_A::VALUE1 + **self == SSLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SSLS_A::VALUE2 + **self == SSLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SSLS_A::VALUE3 + **self == SSLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SSLS_A::VALUE4 + **self == SSLS_A::VALUE4 + } +} +impl core::ops::Deref for SSLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SSLS`"] +#[doc = "Field `SSLS` writer - Start/Stop trigger interrupt line selection"] pub struct SSLS_W<'a> { w: &'a mut W, } @@ -351,9 +409,7 @@ impl<'a> SSLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SSLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -378,7 +434,7 @@ impl<'a> SSLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -401,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STLS`"] -pub type STLS_R = crate::R; +#[doc = "Field `STLS` reader - Shadow transfer done interrupt line selection"] +pub struct STLS_R(crate::FieldReader); impl STLS_R { + pub(crate) fn new(bits: u8) -> Self { + STLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STLS_A { @@ -418,25 +477,32 @@ impl STLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STLS_A::VALUE1 + **self == STLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STLS_A::VALUE2 + **self == STLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STLS_A::VALUE3 + **self == STLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STLS_A::VALUE4 + **self == STLS_A::VALUE4 } } -#[doc = "Write proxy for field `STLS`"] +impl core::ops::Deref for STLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STLS` writer - Shadow transfer done interrupt line selection"] pub struct STLS_W<'a> { w: &'a mut W, } @@ -444,9 +510,7 @@ impl<'a> STLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -471,7 +535,7 @@ impl<'a> STLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -494,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CRFLS`"] -pub type CRFLS_R = crate::R; +#[doc = "Field `CRFLS` reader - Comparator rise/fall interrupt line selection"] +pub struct CRFLS_R(crate::FieldReader); impl CRFLS_R { + pub(crate) fn new(bits: u8) -> Self { + CRFLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CRFLS_A { @@ -511,25 +578,32 @@ impl CRFLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CRFLS_A::VALUE1 + **self == CRFLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CRFLS_A::VALUE2 + **self == CRFLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CRFLS_A::VALUE3 + **self == CRFLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CRFLS_A::VALUE4 + **self == CRFLS_A::VALUE4 } } -#[doc = "Write proxy for field `CRFLS`"] +impl core::ops::Deref for CRFLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRFLS` writer - Comparator rise/fall interrupt line selection"] pub struct CRFLS_W<'a> { w: &'a mut W, } @@ -537,9 +611,7 @@ impl<'a> CRFLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRFLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -564,7 +636,7 @@ impl<'a> CRFLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -587,9 +659,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CSLS`"] -pub type CSLS_R = crate::R; +#[doc = "Field `CSLS` reader - Comparator clamped state interrupt line selection"] +pub struct CSLS_R(crate::FieldReader); impl CSLS_R { + pub(crate) fn new(bits: u8) -> Self { + CSLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSLS_A { @@ -604,25 +679,32 @@ impl CSLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSLS_A::VALUE1 + **self == CSLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSLS_A::VALUE2 + **self == CSLS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CSLS_A::VALUE3 + **self == CSLS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CSLS_A::VALUE4 + **self == CSLS_A::VALUE4 + } +} +impl core::ops::Deref for CSLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CSLS`"] +#[doc = "Field `CSLS` writer - Comparator clamped state interrupt line selection"] pub struct CSLS_W<'a> { w: &'a mut W, } @@ -630,9 +712,7 @@ impl<'a> CSLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSLS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "CSGySR0"] #[inline(always)] @@ -657,7 +737,7 @@ impl<'a> CSLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -734,4 +814,30 @@ impl W { pub fn csls(&mut self) -> CSLS_W { CSLS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service request line selector\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 [srs](index.html) module"] +pub struct SRS_SPEC; +impl crate::RegisterSpec for SRS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srs::R](R) reader structure"] +impl crate::Readable for SRS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [srs::W](W) writer structure"] +impl crate::Writable for SRS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRS to value 0"] +impl crate::Resettable for SRS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/swc.rs b/src/hrpwm0_csg0/swc.rs index 0d2d6017..6de23139 100644 --- a/src/hrpwm0_csg0/swc.rs +++ b/src/hrpwm0_csg0/swc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWC"] -pub type W = crate::W; -#[doc = "Register SWC `reset()`'s with value 0"] -impl crate::ResetValue for super::SWC { - type Type = u32; +#[doc = "Register `SWC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `CVLS1`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CVLS1` writer - Value switch from CSGyDSV1 to CSGyDSV2 status clear"] pub struct CVLS1_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> CVLS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `CVLS2`"] +#[doc = "Field `CVLS2` writer - Value switch from CSGyDSV2 to CSGyDSV1 status clear"] pub struct CVLS2_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> CVLS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `CTRGS`"] +#[doc = "Field `CTRGS` writer - Conversion trigger status clear"] pub struct CTRGS_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> CTRGS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `CSTRS`"] +#[doc = "Field `CSTRS` writer - Start trigger status clear"] pub struct CSTRS_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> CSTRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `CSTPS`"] +#[doc = "Field `CSTPS` writer - Stop trigger status clear"] pub struct CSTPS_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> CSTPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `CSTD`"] +#[doc = "Field `CSTD` writer - Shadow transfer status clear"] pub struct CSTD_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> CSTD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `CCRS`"] +#[doc = "Field `CCRS` writer - Comparator rise status clear"] pub struct CCRS_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> CCRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `CCFS`"] +#[doc = "Field `CCFS` writer - Comparator fall status clear"] pub struct CCFS_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> CCFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `CCSS`"] +#[doc = "Field `CCSS` writer - Comparator clamped status clear"] pub struct CCSS_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> CCSS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn ccss(&mut self) -> CCSS_W { CCSS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service request SW clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swc](index.html) module"] +pub struct SWC_SPEC; +impl crate::RegisterSpec for SWC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [swc::W](W) writer structure"] +impl crate::Writable for SWC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWC to value 0"] +impl crate::Resettable for SWC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_csg0/sws.rs b/src/hrpwm0_csg0/sws.rs index 2f1fb43f..ce53b443 100644 --- a/src/hrpwm0_csg0/sws.rs +++ b/src/hrpwm0_csg0/sws.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SWS"] -pub type W = crate::W; -#[doc = "Register SWS `reset()`'s with value 0"] -impl crate::ResetValue for super::SWS { - type Type = u32; +#[doc = "Register `SWS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SVLS1`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SVLS1` writer - Value switch from CSGyDSV1 to CSGyDSV2 status set"] pub struct SVLS1_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SVLS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SVLS2`"] +#[doc = "Field `SVLS2` writer - Value switch from CSGyDSV2 to CSGyDSV1 status set"] pub struct SVLS2_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SVLS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `STRGS`"] +#[doc = "Field `STRGS` writer - Conversion trigger status set"] pub struct STRGS_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> STRGS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SSTRS`"] +#[doc = "Field `SSTRS` writer - Start trigger status set"] pub struct SSTRS_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SSTRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `SSTPS`"] +#[doc = "Field `SSTPS` writer - Stop trigger status set"] pub struct SSTPS_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SSTPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `SSTD`"] +#[doc = "Field `SSTD` writer - Shadow transfer status set"] pub struct SSTD_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SSTD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `SCRS`"] +#[doc = "Field `SCRS` writer - Comparator rise status set"] pub struct SCRS_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> SCRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `SCFS`"] +#[doc = "Field `SCFS` writer - Comparator fall status set"] pub struct SCFS_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> SCFS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `SCSS`"] +#[doc = "Field `SCSS` writer - Comparator clamped state status set"] pub struct SCSS_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> SCSS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn scss(&mut self) -> SCSS_W { SCSS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service request SW set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sws](index.html) module"] +pub struct SWS_SPEC; +impl crate::RegisterSpec for SWS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +impl crate::Writable for SWS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWS to value 0"] +impl crate::Resettable for SWS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0.rs b/src/hrpwm0_hrc0.rs index 9a6c7b24..83ee4a1c 100644 --- a/src/hrpwm0_hrc0.rs +++ b/src/hrpwm0_hrc0.rs @@ -2,175 +2,87 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - HRC mode configuration"] - pub gc: GC, + pub gc: crate::Reg, #[doc = "0x04 - HRC output passive level"] - pub pl: PL, + pub pl: crate::Reg, #[doc = "0x08 - HRC global control selection"] - pub gsel: GSEL, + pub gsel: crate::Reg, #[doc = "0x0c - HRC timer selection"] - pub tsel: TSEL, + pub tsel: crate::Reg, #[doc = "0x10 - HRC current source for shadow"] - pub sc: SC, + pub sc: crate::Reg, #[doc = "0x14 - HRC dead time rising value"] - pub dcr: DCR, + pub dcr: crate::Reg, #[doc = "0x18 - HRC dead time falling value"] - pub dcf: DCF, + pub dcf: crate::Reg, #[doc = "0x1c - HRC rising edge value"] - pub cr1: CR1, + pub cr1: crate::Reg, #[doc = "0x20 - HRC falling edge value"] - pub cr2: CR2, + pub cr2: crate::Reg, #[doc = "0x24 - HRC next source for shadow"] - pub ssc: SSC, + pub ssc: crate::Reg, #[doc = "0x28 - HRC shadow dead time rising"] - pub sdcr: SDCR, + pub sdcr: crate::Reg, #[doc = "0x2c - HRC shadow dead time falling"] - pub sdcf: SDCF, + pub sdcf: crate::Reg, #[doc = "0x30 - HRC shadow rising edge value"] - pub scr1: SCR1, + pub scr1: crate::Reg, #[doc = "0x34 - HRC shadow falling edge value"] - pub scr2: SCR2, + pub scr2: crate::Reg, } -#[doc = "HRC mode configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gc](gc) module"] -pub type GC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GC; -#[doc = "`read()` method returns [gc::R](gc::R) reader structure"] -impl crate::Readable for GC {} -#[doc = "`write(|w| ..)` method takes [gc::W](gc::W) writer structure"] -impl crate::Writable for GC {} +#[doc = "GC register accessor: an alias for `Reg`"] +pub type GC = crate::Reg; #[doc = "HRC mode configuration"] pub mod gc; -#[doc = "HRC output passive level\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pl](pl) module"] -pub type PL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PL; -#[doc = "`read()` method returns [pl::R](pl::R) reader structure"] -impl crate::Readable for PL {} -#[doc = "`write(|w| ..)` method takes [pl::W](pl::W) writer structure"] -impl crate::Writable for PL {} +#[doc = "PL register accessor: an alias for `Reg`"] +pub type PL = crate::Reg; #[doc = "HRC output passive level"] pub mod pl; -#[doc = "HRC global control selection\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gsel](gsel) module"] -pub type GSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GSEL; -#[doc = "`read()` method returns [gsel::R](gsel::R) reader structure"] -impl crate::Readable for GSEL {} -#[doc = "`write(|w| ..)` method takes [gsel::W](gsel::W) writer structure"] -impl crate::Writable for GSEL {} +#[doc = "GSEL register accessor: an alias for `Reg`"] +pub type GSEL = crate::Reg; #[doc = "HRC global control selection"] pub mod gsel; -#[doc = "HRC timer selection\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tsel](tsel) module"] -pub type TSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TSEL; -#[doc = "`read()` method returns [tsel::R](tsel::R) reader structure"] -impl crate::Readable for TSEL {} -#[doc = "`write(|w| ..)` method takes [tsel::W](tsel::W) writer structure"] -impl crate::Writable for TSEL {} +#[doc = "TSEL register accessor: an alias for `Reg`"] +pub type TSEL = crate::Reg; #[doc = "HRC timer selection"] pub mod tsel; -#[doc = "HRC current source for shadow\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sc](sc) module"] -pub type SC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SC; -#[doc = "`read()` method returns [sc::R](sc::R) reader structure"] -impl crate::Readable for SC {} +#[doc = "SC register accessor: an alias for `Reg`"] +pub type SC = crate::Reg; #[doc = "HRC current source for shadow"] pub mod sc; -#[doc = "HRC dead time rising value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcr](dcr) module"] -pub type DCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DCR; -#[doc = "`read()` method returns [dcr::R](dcr::R) reader structure"] -impl crate::Readable for DCR {} +#[doc = "DCR register accessor: an alias for `Reg`"] +pub type DCR = crate::Reg; #[doc = "HRC dead time rising value"] pub mod dcr; -#[doc = "HRC dead time falling value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcf](dcf) module"] -pub type DCF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DCF; -#[doc = "`read()` method returns [dcf::R](dcf::R) reader structure"] -impl crate::Readable for DCF {} +#[doc = "DCF register accessor: an alias for `Reg`"] +pub type DCF = crate::Reg; #[doc = "HRC dead time falling value"] pub mod dcf; -#[doc = "HRC rising edge value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](cr1) module"] -pub type CR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR1; -#[doc = "`read()` method returns [cr1::R](cr1::R) reader structure"] -impl crate::Readable for CR1 {} +#[doc = "CR1 register accessor: an alias for `Reg`"] +pub type CR1 = crate::Reg; #[doc = "HRC rising edge value"] pub mod cr1; -#[doc = "HRC falling edge value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr2](cr2) module"] -pub type CR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CR2; -#[doc = "`read()` method returns [cr2::R](cr2::R) reader structure"] -impl crate::Readable for CR2 {} +#[doc = "CR2 register accessor: an alias for `Reg`"] +pub type CR2 = crate::Reg; #[doc = "HRC falling edge value"] pub mod cr2; -#[doc = "HRC next source for shadow\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ssc](ssc) module"] -pub type SSC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SSC; -#[doc = "`read()` method returns [ssc::R](ssc::R) reader structure"] -impl crate::Readable for SSC {} -#[doc = "`write(|w| ..)` method takes [ssc::W](ssc::W) writer structure"] -impl crate::Writable for SSC {} +#[doc = "SSC register accessor: an alias for `Reg`"] +pub type SSC = crate::Reg; #[doc = "HRC next source for shadow"] pub mod ssc; -#[doc = "HRC shadow dead time rising\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdcr](sdcr) module"] -pub type SDCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SDCR; -#[doc = "`read()` method returns [sdcr::R](sdcr::R) reader structure"] -impl crate::Readable for SDCR {} -#[doc = "`write(|w| ..)` method takes [sdcr::W](sdcr::W) writer structure"] -impl crate::Writable for SDCR {} +#[doc = "SDCR register accessor: an alias for `Reg`"] +pub type SDCR = crate::Reg; #[doc = "HRC shadow dead time rising"] pub mod sdcr; -#[doc = "HRC shadow dead time falling\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdcf](sdcf) module"] -pub type SDCF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SDCF; -#[doc = "`read()` method returns [sdcf::R](sdcf::R) reader structure"] -impl crate::Readable for SDCF {} -#[doc = "`write(|w| ..)` method takes [sdcf::W](sdcf::W) writer structure"] -impl crate::Writable for SDCF {} +#[doc = "SDCF register accessor: an alias for `Reg`"] +pub type SDCF = crate::Reg; #[doc = "HRC shadow dead time falling"] pub mod sdcf; -#[doc = "HRC shadow rising edge value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scr1](scr1) module"] -pub type SCR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SCR1; -#[doc = "`read()` method returns [scr1::R](scr1::R) reader structure"] -impl crate::Readable for SCR1 {} -#[doc = "`write(|w| ..)` method takes [scr1::W](scr1::W) writer structure"] -impl crate::Writable for SCR1 {} +#[doc = "SCR1 register accessor: an alias for `Reg`"] +pub type SCR1 = crate::Reg; #[doc = "HRC shadow rising edge value"] pub mod scr1; -#[doc = "HRC shadow falling edge value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scr2](scr2) module"] -pub type SCR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SCR2; -#[doc = "`read()` method returns [scr2::R](scr2::R) reader structure"] -impl crate::Readable for SCR2 {} -#[doc = "`write(|w| ..)` method takes [scr2::W](scr2::W) writer structure"] -impl crate::Writable for SCR2 {} +#[doc = "SCR2 register accessor: an alias for `Reg`"] +pub type SCR2 = crate::Reg; #[doc = "HRC shadow falling edge value"] pub mod scr2; diff --git a/src/hrpwm0_hrc0/cr1.rs b/src/hrpwm0_hrc0/cr1.rs index d4e8d78d..3ba2bdb9 100644 --- a/src/hrpwm0_hrc0/cr1.rs +++ b/src/hrpwm0_hrc0/cr1.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register CR1"] -pub type R = crate::R; -#[doc = "Reader of field `CR1`"] -pub type CR1_R = crate::R; +#[doc = "Register `CR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CR1` reader - High resolution rising edge value"] +pub struct CR1_R(crate::FieldReader); +impl CR1_R { + pub(crate) fn new(bits: u8) -> Self { + CR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - High resolution rising edge value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { CR1_R::new((self.bits & 0xff) as u8) } } +#[doc = "HRC rising edge value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](index.html) module"] +pub struct CR1_SPEC; +impl crate::RegisterSpec for CR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr1::R](R) reader structure"] +impl crate::Readable for CR1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CR1 to value 0"] +impl crate::Resettable for CR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_hrc0/cr2.rs b/src/hrpwm0_hrc0/cr2.rs index b2ed2ab1..59a171da 100644 --- a/src/hrpwm0_hrc0/cr2.rs +++ b/src/hrpwm0_hrc0/cr2.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register CR2"] -pub type R = crate::R; -#[doc = "Reader of field `CR2`"] -pub type CR2_R = crate::R; +#[doc = "Register `CR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CR2` reader - High resolution falling edge value"] +pub struct CR2_R(crate::FieldReader); +impl CR2_R { + pub(crate) fn new(bits: u8) -> Self { + CR2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - High resolution falling edge value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { CR2_R::new((self.bits & 0xff) as u8) } } +#[doc = "HRC falling edge value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr2](index.html) module"] +pub struct CR2_SPEC; +impl crate::RegisterSpec for CR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cr2::R](R) reader structure"] +impl crate::Readable for CR2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CR2 to value 0"] +impl crate::Resettable for CR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_hrc0/dcf.rs b/src/hrpwm0_hrc0/dcf.rs index 1233d626..95563410 100644 --- a/src/hrpwm0_hrc0/dcf.rs +++ b/src/hrpwm0_hrc0/dcf.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DCF"] -pub type R = crate::R; -#[doc = "Reader of field `DTFV`"] -pub type DTFV_R = crate::R; +#[doc = "Register `DCF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DTFV` reader - Dead time falling value"] +pub struct DTFV_R(crate::FieldReader); +impl DTFV_R { + pub(crate) fn new(bits: u16) -> Self { + DTFV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTFV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Dead time falling value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DTFV_R::new((self.bits & 0xffff) as u16) } } +#[doc = "HRC dead time falling value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcf](index.html) module"] +pub struct DCF_SPEC; +impl crate::RegisterSpec for DCF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dcf::R](R) reader structure"] +impl crate::Readable for DCF_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DCF to value 0x01"] +impl crate::Resettable for DCF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/hrpwm0_hrc0/dcr.rs b/src/hrpwm0_hrc0/dcr.rs index edb1f5cd..3d6f6f34 100644 --- a/src/hrpwm0_hrc0/dcr.rs +++ b/src/hrpwm0_hrc0/dcr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DCR"] -pub type R = crate::R; -#[doc = "Reader of field `DTRV`"] -pub type DTRV_R = crate::R; +#[doc = "Register `DCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DTRV` reader - Dead time rising value"] +pub struct DTRV_R(crate::FieldReader); +impl DTRV_R { + pub(crate) fn new(bits: u16) -> Self { + DTRV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTRV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Dead time rising value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DTRV_R::new((self.bits & 0xffff) as u16) } } +#[doc = "HRC dead time rising value\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcr](index.html) module"] +pub struct DCR_SPEC; +impl crate::RegisterSpec for DCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dcr::R](R) reader structure"] +impl crate::Readable for DCR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DCR to value 0x01"] +impl crate::Resettable for DCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/hrpwm0_hrc0/gc.rs b/src/hrpwm0_hrc0/gc.rs index 3de1ca21..568b63d7 100644 --- a/src/hrpwm0_hrc0/gc.rs +++ b/src/hrpwm0_hrc0/gc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GC"] -pub type R = crate::R; -#[doc = "Writer for register GC"] -pub type W = crate::W; -#[doc = "Register GC `reset()`'s with value 0"] -impl crate::ResetValue for super::GC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "HRCy high resolution mode configuration for source selector 0\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HRM0`"] -pub type HRM0_R = crate::R; +#[doc = "Field `HRM0` reader - HRCy high resolution mode configuration for source selector 0"] +pub struct HRM0_R(crate::FieldReader); impl HRM0_R { + pub(crate) fn new(bits: u8) -> Self { + HRM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRM0_A { @@ -46,25 +73,32 @@ impl HRM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRM0_A::VALUE1 + **self == HRM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRM0_A::VALUE2 + **self == HRM0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HRM0_A::VALUE3 + **self == HRM0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HRM0_A::VALUE4 + **self == HRM0_A::VALUE4 } } -#[doc = "Write proxy for field `HRM0`"] +impl core::ops::Deref for HRM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HRM0` writer - HRCy high resolution mode configuration for source selector 0"] pub struct HRM0_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> HRM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRM0_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> HRM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HRM1`"] -pub type HRM1_R = crate::R; +#[doc = "Field `HRM1` reader - HRCy high resolution mode configuration for source selector 1"] +pub struct HRM1_R(crate::FieldReader); impl HRM1_R { + pub(crate) fn new(bits: u8) -> Self { + HRM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRM1_A { @@ -139,25 +174,32 @@ impl HRM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRM1_A::VALUE1 + **self == HRM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRM1_A::VALUE2 + **self == HRM1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HRM1_A::VALUE3 + **self == HRM1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HRM1_A::VALUE4 + **self == HRM1_A::VALUE4 } } -#[doc = "Write proxy for field `HRM1`"] +impl core::ops::Deref for HRM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HRM1` writer - HRCy high resolution mode configuration for source selector 1"] pub struct HRM1_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> HRM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRM1_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> HRM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -210,9 +250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTE`"] -pub type DTE_R = crate::R; +#[doc = "Field `DTE` reader - HRCy dead time enable"] +pub struct DTE_R(crate::FieldReader); impl DTE_R { + pub(crate) fn new(bits: bool) -> Self { + DTE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTE_A { @@ -224,15 +267,22 @@ impl DTE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTE_A::VALUE1 + **self == DTE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTE_A::VALUE2 + **self == DTE_A::VALUE2 + } +} +impl core::ops::Deref for DTE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DTE`"] +#[doc = "Field `DTE` writer - HRCy dead time enable"] pub struct DTE_W<'a> { w: &'a mut W, } @@ -240,9 +290,7 @@ impl<'a> DTE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Dead time insertion is disabled"] #[inline(always)] @@ -267,7 +315,7 @@ impl<'a> DTE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -285,9 +333,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TR0E`"] -pub type TR0E_R = crate::R; +#[doc = "Field `TR0E` reader - HRCy trap enable"] +pub struct TR0E_R(crate::FieldReader); impl TR0E_R { + pub(crate) fn new(bits: bool) -> Self { + TR0E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TR0E_A { @@ -299,15 +350,22 @@ impl TR0E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TR0E_A::VALUE1 + **self == TR0E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TR0E_A::VALUE2 + **self == TR0E_A::VALUE2 + } +} +impl core::ops::Deref for TR0E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TR0E`"] +#[doc = "Field `TR0E` writer - HRCy trap enable"] pub struct TR0E_W<'a> { w: &'a mut W, } @@ -315,9 +373,7 @@ impl<'a> TR0E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TR0E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"] #[inline(always)] @@ -342,7 +398,7 @@ impl<'a> TR0E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -360,9 +416,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TR1E`"] -pub type TR1E_R = crate::R; +#[doc = "Field `TR1E` reader - HRCy complementary trap enable"] +pub struct TR1E_R(crate::FieldReader); impl TR1E_R { + pub(crate) fn new(bits: bool) -> Self { + TR1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TR1E_A { @@ -374,15 +433,22 @@ impl TR1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TR1E_A::VALUE1 + **self == TR1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TR1E_A::VALUE2 + **self == TR1E_A::VALUE2 } } -#[doc = "Write proxy for field `TR1E`"] +impl core::ops::Deref for TR1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TR1E` writer - HRCy complementary trap enable"] pub struct TR1E_W<'a> { w: &'a mut W, } @@ -390,9 +456,7 @@ impl<'a> TR1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TR1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"] #[inline(always)] @@ -417,7 +481,7 @@ impl<'a> TR1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -435,9 +499,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STC`"] -pub type STC_R = crate::R; +#[doc = "Field `STC` reader - HRCy shadow transfer configuration"] +pub struct STC_R(crate::FieldReader); impl STC_R { + pub(crate) fn new(bits: bool) -> Self { + STC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STC_A { @@ -449,15 +516,22 @@ impl STC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STC_A::VALUE1 + **self == STC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STC_A::VALUE2 + **self == STC_A::VALUE2 } } -#[doc = "Write proxy for field `STC`"] +impl core::ops::Deref for STC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STC` writer - HRCy shadow transfer configuration"] pub struct STC_W<'a> { w: &'a mut W, } @@ -465,9 +539,7 @@ impl<'a> STC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRCy shadow transfer enable for HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . values is not linked with the specific Capture/Compare Unit timer."] #[inline(always)] @@ -492,7 +564,7 @@ impl<'a> STC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -510,9 +582,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSTC`"] -pub type DSTC_R = crate::R; +#[doc = "Field `DSTC` reader - HRCy dead time shadow transfer configuration"] +pub struct DSTC_R(crate::FieldReader); impl DSTC_R { + pub(crate) fn new(bits: bool) -> Self { + DSTC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSTC_A { @@ -524,15 +599,22 @@ impl DSTC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSTC_A::VALUE1 + **self == DSTC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSTC_A::VALUE2 + **self == DSTC_A::VALUE2 + } +} +impl core::ops::Deref for DSTC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSTC`"] +#[doc = "Field `DSTC` writer - HRCy dead time shadow transfer configuration"] pub struct DSTC_W<'a> { w: &'a mut W, } @@ -540,9 +622,7 @@ impl<'a> DSTC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSTC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRCy shadow transfer enable for HRCyDCRThis register holds the dead time value that is going to be inserted whenever a rising transition on the output latch is sensed. and HRCyDCFThis register holds the dead time value that is going to be inserted whenever a falling transition on the output latch is sensed. values is not linked with the specific Capture/Compare Unit timer."] #[inline(always)] @@ -567,7 +647,7 @@ impl<'a> DSTC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -585,9 +665,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS0`"] -pub type OCS0_R = crate::R; +#[doc = "Field `OCS0` reader - HRPWMx.OUTy0 channel selector"] +pub struct OCS0_R(crate::FieldReader); impl OCS0_R { + pub(crate) fn new(bits: bool) -> Self { + OCS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS0_A { @@ -599,15 +682,22 @@ impl OCS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS0_A::VALUE1 + **self == OCS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS0_A::VALUE2 + **self == OCS0_A::VALUE2 } } -#[doc = "Write proxy for field `OCS0`"] +impl core::ops::Deref for OCS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OCS0` writer - HRPWMx.OUTy0 channel selector"] pub struct OCS0_W<'a> { w: &'a mut W, } @@ -615,9 +705,7 @@ impl<'a> OCS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"] #[inline(always)] @@ -642,7 +730,7 @@ impl<'a> OCS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -660,9 +748,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OCS1`"] -pub type OCS1_R = crate::R; +#[doc = "Field `OCS1` reader - HRPWMx.OUTy1 channel selector"] +pub struct OCS1_R(crate::FieldReader); impl OCS1_R { + pub(crate) fn new(bits: bool) -> Self { + OCS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OCS1_A { @@ -674,15 +765,22 @@ impl OCS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OCS1_A::VALUE1 + **self == OCS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OCS1_A::VALUE2 + **self == OCS1_A::VALUE2 } } -#[doc = "Write proxy for field `OCS1`"] +impl core::ops::Deref for OCS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OCS1` writer - HRPWMx.OUTy1 channel selector"] pub struct OCS1_W<'a> { w: &'a mut W, } @@ -690,9 +788,7 @@ impl<'a> OCS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OCS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"] #[inline(always)] @@ -717,7 +813,7 @@ impl<'a> OCS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -735,9 +831,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTUS`"] -pub type DTUS_R = crate::R; +#[doc = "Field `DTUS` reader - Dead Time update trigger selector"] +pub struct DTUS_R(crate::FieldReader); impl DTUS_R { + pub(crate) fn new(bits: bool) -> Self { + DTUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTUS_A { @@ -749,15 +848,22 @@ impl DTUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTUS_A::VALUE1 + **self == DTUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTUS_A::VALUE2 + **self == DTUS_A::VALUE2 } } -#[doc = "Write proxy for field `DTUS`"] +impl core::ops::Deref for DTUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTUS` writer - Dead Time update trigger selector"] pub struct DTUS_W<'a> { w: &'a mut W, } @@ -765,9 +871,7 @@ impl<'a> DTUS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTUS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The update of the values is done with the trigger generated by the timers. This is the same trigger that is used to update the HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, .."] #[inline(always)] @@ -792,7 +896,7 @@ impl<'a> DTUS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -899,4 +1003,30 @@ impl W { pub fn dtus(&mut self) -> DTUS_W { DTUS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC mode configuration\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 [gc](index.html) module"] +pub struct GC_SPEC; +impl crate::RegisterSpec for GC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gc::R](R) reader structure"] +impl crate::Readable for GC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gc::W](W) writer structure"] +impl crate::Writable for GC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GC to value 0"] +impl crate::Resettable for GC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/gsel.rs b/src/hrpwm0_hrc0/gsel.rs index e3e5f889..257bc8fa 100644 --- a/src/hrpwm0_hrc0/gsel.rs +++ b/src/hrpwm0_hrc0/gsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GSEL"] -pub type R = crate::R; -#[doc = "Writer for register GSEL"] -pub type W = crate::W; -#[doc = "Register GSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::GSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source selector 0 comparator set configuration\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C0SS`"] -pub type C0SS_R = crate::R; +#[doc = "Field `C0SS` reader - Source selector 0 comparator set configuration"] +pub struct C0SS_R(crate::FieldReader); impl C0SS_R { + pub(crate) fn new(bits: u8) -> Self { + C0SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C0SS_A::VALUE1), - 1 => Val(C0SS_A::VALUE2), - 2 => Val(C0SS_A::VALUE3), - i => Res(i), + 0 => Some(C0SS_A::VALUE1), + 1 => Some(C0SS_A::VALUE2), + 2 => Some(C0SS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0SS_A::VALUE1 + **self == C0SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0SS_A::VALUE2 + **self == C0SS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C0SS_A::VALUE3 + **self == C0SS_A::VALUE3 } } -#[doc = "Write proxy for field `C0SS`"] +impl core::ops::Deref for C0SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C0SS` writer - Source selector 0 comparator set configuration"] pub struct C0SS_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> C0SS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C0CS`"] -pub type C0CS_R = crate::R; +#[doc = "Field `C0CS` reader - Source selector 0 comparator clear configuration"] +pub struct C0CS_R(crate::FieldReader); impl C0CS_R { + pub(crate) fn new(bits: u8) -> Self { + C0CS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C0CS_A::VALUE1), - 1 => Val(C0CS_A::VALUE2), - 2 => Val(C0CS_A::VALUE3), - i => Res(i), + 0 => Some(C0CS_A::VALUE1), + 1 => Some(C0CS_A::VALUE2), + 2 => Some(C0CS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0CS_A::VALUE1 + **self == C0CS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0CS_A::VALUE2 + **self == C0CS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C0CS_A::VALUE3 + **self == C0CS_A::VALUE3 } } -#[doc = "Write proxy for field `C0CS`"] +impl core::ops::Deref for C0CS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C0CS` writer - Source selector 0 comparator clear configuration"] pub struct C0CS_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> C0CS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 3)) | (((value as u32) & 0x07) << 3); + self.w.bits = (self.w.bits & !(0x07 << 3)) | ((value as u32 & 0x07) << 3); self.w } } @@ -183,31 +225,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `S0M`"] -pub type S0M_R = crate::R; +#[doc = "Field `S0M` reader - Source selector 0 set configuration"] +pub struct S0M_R(crate::FieldReader); impl S0M_R { + pub(crate) fn new(bits: u8) -> Self { + S0M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(S0M_A::VALUE1), - 1 => Val(S0M_A::VALUE2), - i => Res(i), + 0 => Some(S0M_A::VALUE1), + 1 => Some(S0M_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0M_A::VALUE1 + **self == S0M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0M_A::VALUE2 + **self == S0M_A::VALUE2 + } +} +impl core::ops::Deref for S0M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `S0M`"] +#[doc = "Field `S0M` writer - Source selector 0 set configuration"] pub struct S0M_W<'a> { w: &'a mut W, } @@ -230,7 +281,7 @@ impl<'a> S0M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -249,31 +300,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C0M`"] -pub type C0M_R = crate::R; +#[doc = "Field `C0M` reader - Source selector 0 clear configuration"] +pub struct C0M_R(crate::FieldReader); impl C0M_R { + pub(crate) fn new(bits: u8) -> Self { + C0M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C0M_A::VALUE1), - 1 => Val(C0M_A::VALUE2), - i => Res(i), + 0 => Some(C0M_A::VALUE1), + 1 => Some(C0M_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0M_A::VALUE1 + **self == C0M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0M_A::VALUE2 + **self == C0M_A::VALUE2 } } -#[doc = "Write proxy for field `C0M`"] +impl core::ops::Deref for C0M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C0M` writer - Source selector 0 clear configuration"] pub struct C0M_W<'a> { w: &'a mut W, } @@ -296,7 +356,7 @@ impl<'a> C0M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -319,9 +379,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `S0ES`"] -pub type S0ES_R = crate::R; +#[doc = "Field `S0ES` reader - Source selector 0 set edge configuration"] +pub struct S0ES_R(crate::FieldReader); impl S0ES_R { + pub(crate) fn new(bits: u8) -> Self { + S0ES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S0ES_A { @@ -336,25 +399,32 @@ impl S0ES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S0ES_A::VALUE1 + **self == S0ES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S0ES_A::VALUE2 + **self == S0ES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == S0ES_A::VALUE3 + **self == S0ES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == S0ES_A::VALUE4 + **self == S0ES_A::VALUE4 + } +} +impl core::ops::Deref for S0ES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `S0ES`"] +#[doc = "Field `S0ES` writer - Source selector 0 set edge configuration"] pub struct S0ES_W<'a> { w: &'a mut W, } @@ -362,9 +432,7 @@ impl<'a> S0ES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: S0ES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Generation of the set signal is disabled"] #[inline(always)] @@ -389,7 +457,7 @@ impl<'a> S0ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -412,9 +480,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C0ES`"] -pub type C0ES_R = crate::R; +#[doc = "Field `C0ES` reader - Source selector 0 clear edge configuration"] +pub struct C0ES_R(crate::FieldReader); impl C0ES_R { + pub(crate) fn new(bits: u8) -> Self { + C0ES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> C0ES_A { @@ -429,25 +500,32 @@ impl C0ES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C0ES_A::VALUE1 + **self == C0ES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C0ES_A::VALUE2 + **self == C0ES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C0ES_A::VALUE3 + **self == C0ES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == C0ES_A::VALUE4 + **self == C0ES_A::VALUE4 } } -#[doc = "Write proxy for field `C0ES`"] +impl core::ops::Deref for C0ES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C0ES` writer - Source selector 0 clear edge configuration"] pub struct C0ES_W<'a> { w: &'a mut W, } @@ -455,9 +533,7 @@ impl<'a> C0ES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: C0ES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Generation of the clear signal is disabled"] #[inline(always)] @@ -482,7 +558,7 @@ impl<'a> C0ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -503,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C1SS`"] -pub type C1SS_R = crate::R; +#[doc = "Field `C1SS` reader - Source selector 1 comparator set configuration"] +pub struct C1SS_R(crate::FieldReader); impl C1SS_R { + pub(crate) fn new(bits: u8) -> Self { + C1SS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C1SS_A::VALUE1), - 1 => Val(C1SS_A::VALUE2), - 2 => Val(C1SS_A::VALUE3), - i => Res(i), + 0 => Some(C1SS_A::VALUE1), + 1 => Some(C1SS_A::VALUE2), + 2 => Some(C1SS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1SS_A::VALUE1 + **self == C1SS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1SS_A::VALUE2 + **self == C1SS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C1SS_A::VALUE3 + **self == C1SS_A::VALUE3 + } +} +impl core::ops::Deref for C1SS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `C1SS`"] +#[doc = "Field `C1SS` writer - Source selector 1 comparator set configuration"] pub struct C1SS_W<'a> { w: &'a mut W, } @@ -561,7 +646,7 @@ impl<'a> C1SS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -582,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C1CS`"] -pub type C1CS_R = crate::R; +#[doc = "Field `C1CS` reader - Source selector 1 comparator clear configuration"] +pub struct C1CS_R(crate::FieldReader); impl C1CS_R { + pub(crate) fn new(bits: u8) -> Self { + C1CS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C1CS_A::VALUE1), - 1 => Val(C1CS_A::VALUE2), - 2 => Val(C1CS_A::VALUE3), - i => Res(i), + 0 => Some(C1CS_A::VALUE1), + 1 => Some(C1CS_A::VALUE2), + 2 => Some(C1CS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1CS_A::VALUE1 + **self == C1CS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1CS_A::VALUE2 + **self == C1CS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C1CS_A::VALUE3 + **self == C1CS_A::VALUE3 + } +} +impl core::ops::Deref for C1CS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `C1CS`"] +#[doc = "Field `C1CS` writer - Source selector 1 comparator clear configuration"] pub struct C1CS_W<'a> { w: &'a mut W, } @@ -640,7 +734,7 @@ impl<'a> C1CS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } @@ -659,31 +753,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `S1M`"] -pub type S1M_R = crate::R; +#[doc = "Field `S1M` reader - Source selector 1 set configuration"] +pub struct S1M_R(crate::FieldReader); impl S1M_R { + pub(crate) fn new(bits: u8) -> Self { + S1M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(S1M_A::VALUE1), - 1 => Val(S1M_A::VALUE2), - i => Res(i), + 0 => Some(S1M_A::VALUE1), + 1 => Some(S1M_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1M_A::VALUE1 + **self == S1M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1M_A::VALUE2 + **self == S1M_A::VALUE2 } } -#[doc = "Write proxy for field `S1M`"] +impl core::ops::Deref for S1M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1M` writer - Source selector 1 set configuration"] pub struct S1M_W<'a> { w: &'a mut W, } @@ -706,7 +809,7 @@ impl<'a> S1M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -725,31 +828,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C1M`"] -pub type C1M_R = crate::R; +#[doc = "Field `C1M` reader - Source selector 1 clear configuration"] +pub struct C1M_R(crate::FieldReader); impl C1M_R { + pub(crate) fn new(bits: u8) -> Self { + C1M_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(C1M_A::VALUE1), - 1 => Val(C1M_A::VALUE2), - i => Res(i), + 0 => Some(C1M_A::VALUE1), + 1 => Some(C1M_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1M_A::VALUE1 + **self == C1M_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1M_A::VALUE2 + **self == C1M_A::VALUE2 } } -#[doc = "Write proxy for field `C1M`"] +impl core::ops::Deref for C1M_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C1M` writer - Source selector 1 clear configuration"] pub struct C1M_W<'a> { w: &'a mut W, } @@ -772,7 +884,7 @@ impl<'a> C1M_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -795,9 +907,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `S1ES`"] -pub type S1ES_R = crate::R; +#[doc = "Field `S1ES` reader - Source selector 1 set edge configuration"] +pub struct S1ES_R(crate::FieldReader); impl S1ES_R { + pub(crate) fn new(bits: u8) -> Self { + S1ES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> S1ES_A { @@ -812,25 +927,32 @@ impl S1ES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == S1ES_A::VALUE1 + **self == S1ES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == S1ES_A::VALUE2 + **self == S1ES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == S1ES_A::VALUE3 + **self == S1ES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == S1ES_A::VALUE4 + **self == S1ES_A::VALUE4 } } -#[doc = "Write proxy for field `S1ES`"] +impl core::ops::Deref for S1ES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1ES` writer - Source selector 1 set edge configuration"] pub struct S1ES_W<'a> { w: &'a mut W, } @@ -838,9 +960,7 @@ impl<'a> S1ES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: S1ES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Generation of the set signal is disabled"] #[inline(always)] @@ -865,7 +985,7 @@ impl<'a> S1ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -888,9 +1008,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `C1ES`"] -pub type C1ES_R = crate::R; +#[doc = "Field `C1ES` reader - Source selector 1 clear edge configuration"] +pub struct C1ES_R(crate::FieldReader); impl C1ES_R { + pub(crate) fn new(bits: u8) -> Self { + C1ES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> C1ES_A { @@ -905,25 +1028,32 @@ impl C1ES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == C1ES_A::VALUE1 + **self == C1ES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == C1ES_A::VALUE2 + **self == C1ES_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == C1ES_A::VALUE3 + **self == C1ES_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == C1ES_A::VALUE4 + **self == C1ES_A::VALUE4 } } -#[doc = "Write proxy for field `C1ES`"] +impl core::ops::Deref for C1ES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C1ES` writer - Source selector 1 clear edge configuration"] pub struct C1ES_W<'a> { w: &'a mut W, } @@ -931,9 +1061,7 @@ impl<'a> C1ES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: C1ES_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Generation of the clear signal is disabled"] #[inline(always)] @@ -958,7 +1086,7 @@ impl<'a> C1ES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1085,4 +1213,30 @@ impl W { pub fn c1es(&mut self) -> C1ES_W { C1ES_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC global control selection\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 [gsel](index.html) module"] +pub struct GSEL_SPEC; +impl crate::RegisterSpec for GSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gsel::R](R) reader structure"] +impl crate::Readable for GSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gsel::W](W) writer structure"] +impl crate::Writable for GSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GSEL to value 0"] +impl crate::Resettable for GSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/pl.rs b/src/hrpwm0_hrc0/pl.rs index 91c0913e..cee6720d 100644 --- a/src/hrpwm0_hrc0/pl.rs +++ b/src/hrpwm0_hrc0/pl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PL"] -pub type R = crate::R; -#[doc = "Writer for register PL"] -pub type W = crate::W; -#[doc = "Register PL `reset()`'s with value 0"] -impl crate::ResetValue for super::PL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "HRPWMx.OUTy0 passive level\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL0`"] -pub type PSL0_R = crate::R; +#[doc = "Field `PSL0` reader - HRPWMx.OUTy0 passive level"] +pub struct PSL0_R(crate::FieldReader); impl PSL0_R { + pub(crate) fn new(bits: bool) -> Self { + PSL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL0_A { @@ -38,15 +65,22 @@ impl PSL0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL0_A::VALUE1 + **self == PSL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL0_A::VALUE2 + **self == PSL0_A::VALUE2 } } -#[doc = "Write proxy for field `PSL0`"] +impl core::ops::Deref for PSL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSL0` writer - HRPWMx.OUTy0 passive level"] pub struct PSL0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PSL0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRPWMx.OUTy0 output passive level is set to LOW"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PSL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PSL1`"] -pub type PSL1_R = crate::R; +#[doc = "Field `PSL1` reader - HRPWMx.OUTy1 passive level"] +pub struct PSL1_R(crate::FieldReader); impl PSL1_R { + pub(crate) fn new(bits: bool) -> Self { + PSL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PSL1_A { @@ -113,15 +148,22 @@ impl PSL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PSL1_A::VALUE1 + **self == PSL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PSL1_A::VALUE2 + **self == PSL1_A::VALUE2 + } +} +impl core::ops::Deref for PSL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PSL1`"] +#[doc = "Field `PSL1` writer - HRPWMx.OUTy1 passive level"] pub struct PSL1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PSL1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PSL1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HRPWMx.OUTy1 output passive level is set to LOW"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PSL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -183,4 +223,30 @@ impl W { pub fn psl1(&mut self) -> PSL1_W { PSL1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC output passive level\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 [pl](index.html) module"] +pub struct PL_SPEC; +impl crate::RegisterSpec for PL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pl::R](R) reader structure"] +impl crate::Readable for PL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pl::W](W) writer structure"] +impl crate::Writable for PL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PL to value 0"] +impl crate::Resettable for PL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/sc.rs b/src/hrpwm0_hrc0/sc.rs index b11351a9..0aa3e185 100644 --- a/src/hrpwm0_hrc0/sc.rs +++ b/src/hrpwm0_hrc0/sc.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register SC"] -pub type R = crate::R; +#[doc = "Register `SC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Source selector for the shadow transfer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ST_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ST`"] -pub type ST_R = crate::R; +#[doc = "Field `ST` reader - Source selector for the shadow transfer"] +pub struct ST_R(crate::FieldReader); impl ST_R { + pub(crate) fn new(bits: bool) -> Self { + ST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ST_A { @@ -28,12 +44,19 @@ impl ST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ST_A::VALUE1 + **self == ST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ST_A::VALUE2 + **self == ST_A::VALUE2 + } +} +impl core::ops::Deref for ST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { ST_R::new((self.bits & 0x01) != 0) } } +#[doc = "HRC current source for shadow\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sc](index.html) module"] +pub struct SC_SPEC; +impl crate::RegisterSpec for SC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sc::R](R) reader structure"] +impl crate::Readable for SC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SC to value 0"] +impl crate::Resettable for SC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/hrpwm0_hrc0/scr1.rs b/src/hrpwm0_hrc0/scr1.rs index a8ba831e..163fe7b8 100644 --- a/src/hrpwm0_hrc0/scr1.rs +++ b/src/hrpwm0_hrc0/scr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SCR1"] -pub type R = crate::R; -#[doc = "Writer for register SCR1"] -pub type W = crate::W; -#[doc = "Register SCR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::SCR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SCR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SCR1`"] -pub type SCR1_R = crate::R; -#[doc = "Write proxy for field `SCR1`"] +#[doc = "Field `SCR1` reader - High resolution falling edge value"] +pub struct SCR1_R(crate::FieldReader); +impl SCR1_R { + pub(crate) fn new(bits: u8) -> Self { + SCR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SCR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCR1` writer - High resolution falling edge value"] pub struct SCR1_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SCR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn scr1(&mut self) -> SCR1_W { SCR1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC shadow rising edge value\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 [scr1](index.html) module"] +pub struct SCR1_SPEC; +impl crate::RegisterSpec for SCR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scr1::R](R) reader structure"] +impl crate::Readable for SCR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scr1::W](W) writer structure"] +impl crate::Writable for SCR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCR1 to value 0"] +impl crate::Resettable for SCR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/scr2.rs b/src/hrpwm0_hrc0/scr2.rs index 8b168e03..63ecfe15 100644 --- a/src/hrpwm0_hrc0/scr2.rs +++ b/src/hrpwm0_hrc0/scr2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SCR2"] -pub type R = crate::R; -#[doc = "Writer for register SCR2"] -pub type W = crate::W; -#[doc = "Register SCR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::SCR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SCR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SCR2`"] -pub type SCR2_R = crate::R; -#[doc = "Write proxy for field `SCR2`"] +#[doc = "Field `SCR2` reader - High resolution rising edge value"] +pub struct SCR2_R(crate::FieldReader); +impl SCR2_R { + pub(crate) fn new(bits: u8) -> Self { + SCR2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SCR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCR2` writer - High resolution rising edge value"] pub struct SCR2_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SCR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn scr2(&mut self) -> SCR2_W { SCR2_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC shadow falling edge value\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 [scr2](index.html) module"] +pub struct SCR2_SPEC; +impl crate::RegisterSpec for SCR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scr2::R](R) reader structure"] +impl crate::Readable for SCR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scr2::W](W) writer structure"] +impl crate::Writable for SCR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCR2 to value 0"] +impl crate::Resettable for SCR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/sdcf.rs b/src/hrpwm0_hrc0/sdcf.rs index 91c77811..459357e6 100644 --- a/src/hrpwm0_hrc0/sdcf.rs +++ b/src/hrpwm0_hrc0/sdcf.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SDCF"] -pub type R = crate::R; -#[doc = "Writer for register SDCF"] -pub type W = crate::W; -#[doc = "Register SDCF `reset()`'s with value 0x01"] -impl crate::ResetValue for super::SDCF { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `SDCF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDCF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SDTFV`"] -pub type SDTFV_R = crate::R; -#[doc = "Write proxy for field `SDTFV`"] +#[doc = "Field `SDTFV` reader - Shadow dead time falling value"] +pub struct SDTFV_R(crate::FieldReader); +impl SDTFV_R { + pub(crate) fn new(bits: u16) -> Self { + SDTFV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SDTFV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SDTFV` writer - Shadow dead time falling value"] pub struct SDTFV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SDTFV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sdtfv(&mut self) -> SDTFV_W { SDTFV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC shadow dead time falling\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 [sdcf](index.html) module"] +pub struct SDCF_SPEC; +impl crate::RegisterSpec for SDCF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sdcf::R](R) reader structure"] +impl crate::Readable for SDCF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sdcf::W](W) writer structure"] +impl crate::Writable for SDCF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDCF to value 0x01"] +impl crate::Resettable for SDCF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/hrpwm0_hrc0/sdcr.rs b/src/hrpwm0_hrc0/sdcr.rs index abe7e80a..a8903403 100644 --- a/src/hrpwm0_hrc0/sdcr.rs +++ b/src/hrpwm0_hrc0/sdcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SDCR"] -pub type R = crate::R; -#[doc = "Writer for register SDCR"] -pub type W = crate::W; -#[doc = "Register SDCR `reset()`'s with value 0x01"] -impl crate::ResetValue for super::SDCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `SDCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `SDTRV`"] -pub type SDTRV_R = crate::R; -#[doc = "Write proxy for field `SDTRV`"] +#[doc = "Field `SDTRV` reader - Shadow dead time rising value"] +pub struct SDTRV_R(crate::FieldReader); +impl SDTRV_R { + pub(crate) fn new(bits: u16) -> Self { + SDTRV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SDTRV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SDTRV` writer - Shadow dead time rising value"] pub struct SDTRV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SDTRV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn sdtrv(&mut self) -> SDTRV_W { SDTRV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC shadow dead time rising\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 [sdcr](index.html) module"] +pub struct SDCR_SPEC; +impl crate::RegisterSpec for SDCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sdcr::R](R) reader structure"] +impl crate::Readable for SDCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sdcr::W](W) writer structure"] +impl crate::Writable for SDCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDCR to value 0x01"] +impl crate::Resettable for SDCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/hrpwm0_hrc0/ssc.rs b/src/hrpwm0_hrc0/ssc.rs index 1dad72f3..2a43892b 100644 --- a/src/hrpwm0_hrc0/ssc.rs +++ b/src/hrpwm0_hrc0/ssc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SSC"] -pub type R = crate::R; -#[doc = "Writer for register SSC"] -pub type W = crate::W; -#[doc = "Register SSC `reset()`'s with value 0"] -impl crate::ResetValue for super::SSC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SSC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SSC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source selector for the shadow transfer\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SST`"] -pub type SST_R = crate::R; +#[doc = "Field `SST` reader - Source selector for the shadow transfer"] +pub struct SST_R(crate::FieldReader); impl SST_R { + pub(crate) fn new(bits: bool) -> Self { + SST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SST_A { @@ -38,15 +65,22 @@ impl SST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SST_A::VALUE1 + **self == SST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SST_A::VALUE2 + **self == SST_A::VALUE2 + } +} +impl core::ops::Deref for SST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SST`"] +#[doc = "Field `SST` writer - Source selector for the shadow transfer"] pub struct SST_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Next shadow transfer signals (shadow transfer trigger and shadow transfer enable) are linked with the timer CC8y connected to the Source Selector 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn sst(&mut self) -> SST_W { SST_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC next source for shadow\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 [ssc](index.html) module"] +pub struct SSC_SPEC; +impl crate::RegisterSpec for SSC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ssc::R](R) reader structure"] +impl crate::Readable for SSC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ssc::W](W) writer structure"] +impl crate::Writable for SSC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SSC to value 0"] +impl crate::Resettable for SSC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/hrpwm0_hrc0/tsel.rs b/src/hrpwm0_hrc0/tsel.rs index 88cb4ec1..35f894c5 100644 --- a/src/hrpwm0_hrc0/tsel.rs +++ b/src/hrpwm0_hrc0/tsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TSEL"] -pub type R = crate::R; -#[doc = "Writer for register TSEL"] -pub type W = crate::W; -#[doc = "Register TSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::TSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source Selector 0 Timer connection\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TSEL0`"] -pub type TSEL0_R = crate::R; +#[doc = "Field `TSEL0` reader - Source Selector 0 Timer connection"] +pub struct TSEL0_R(crate::FieldReader); impl TSEL0_R { + pub(crate) fn new(bits: u8) -> Self { + TSEL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TSEL0_A::VALUE1), - 1 => Val(TSEL0_A::VALUE2), - 2 => Val(TSEL0_A::VALUE3), - 3 => Val(TSEL0_A::VALUE4), - i => Res(i), + 0 => Some(TSEL0_A::VALUE1), + 1 => Some(TSEL0_A::VALUE2), + 2 => Some(TSEL0_A::VALUE3), + 3 => Some(TSEL0_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSEL0_A::VALUE1 + **self == TSEL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSEL0_A::VALUE2 + **self == TSEL0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TSEL0_A::VALUE3 + **self == TSEL0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TSEL0_A::VALUE4 + **self == TSEL0_A::VALUE4 + } +} +impl core::ops::Deref for TSEL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSEL0`"] +#[doc = "Field `TSEL0` writer - Source Selector 0 Timer connection"] pub struct TSEL0_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> TSEL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TSEL1`"] -pub type TSEL1_R = crate::R; +#[doc = "Field `TSEL1` reader - Source Selector 1 Timer connection"] +pub struct TSEL1_R(crate::FieldReader); impl TSEL1_R { + pub(crate) fn new(bits: u8) -> Self { + TSEL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TSEL1_A::VALUE1), - 1 => Val(TSEL1_A::VALUE2), - 2 => Val(TSEL1_A::VALUE3), - 3 => Val(TSEL1_A::VALUE4), - i => Res(i), + 0 => Some(TSEL1_A::VALUE1), + 1 => Some(TSEL1_A::VALUE2), + 2 => Some(TSEL1_A::VALUE3), + 3 => Some(TSEL1_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSEL1_A::VALUE1 + **self == TSEL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSEL1_A::VALUE2 + **self == TSEL1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TSEL1_A::VALUE3 + **self == TSEL1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TSEL1_A::VALUE4 + **self == TSEL1_A::VALUE4 } } -#[doc = "Write proxy for field `TSEL1`"] +impl core::ops::Deref for TSEL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSEL1` writer - Source Selector 1 Timer connection"] pub struct TSEL1_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> TSEL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 3)) | (((value as u32) & 0x07) << 3); + self.w.bits = (self.w.bits & !(0x07 << 3)) | ((value as u32 & 0x07) << 3); self.w } } @@ -208,9 +250,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TS0E`"] -pub type TS0E_R = crate::R; +#[doc = "Field `TS0E` reader - Source selector 0 TRAP enable"] +pub struct TS0E_R(crate::FieldReader); impl TS0E_R { + pub(crate) fn new(bits: bool) -> Self { + TS0E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TS0E_A { @@ -222,15 +267,22 @@ impl TS0E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TS0E_A::VALUE1 + **self == TS0E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TS0E_A::VALUE2 + **self == TS0E_A::VALUE2 + } +} +impl core::ops::Deref for TS0E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TS0E`"] +#[doc = "Field `TS0E` writer - Source selector 0 TRAP enable"] pub struct TS0E_W<'a> { w: &'a mut W, } @@ -238,9 +290,7 @@ impl<'a> TS0E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TS0E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TRAP signal generated from the Timer connected to Source Selector 0 is disabled."] #[inline(always)] @@ -265,7 +315,7 @@ impl<'a> TS0E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -283,9 +333,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TS1E`"] -pub type TS1E_R = crate::R; +#[doc = "Field `TS1E` reader - Source selector 1 TRAP enable"] +pub struct TS1E_R(crate::FieldReader); impl TS1E_R { + pub(crate) fn new(bits: bool) -> Self { + TS1E_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TS1E_A { @@ -297,15 +350,22 @@ impl TS1E_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TS1E_A::VALUE1 + **self == TS1E_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TS1E_A::VALUE2 + **self == TS1E_A::VALUE2 + } +} +impl core::ops::Deref for TS1E_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TS1E`"] +#[doc = "Field `TS1E` writer - Source selector 1 TRAP enable"] pub struct TS1E_W<'a> { w: &'a mut W, } @@ -313,9 +373,7 @@ impl<'a> TS1E_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TS1E_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TRAP signal generated from the Timer connected to Source Selector 1 is disabled."] #[inline(always)] @@ -340,7 +398,7 @@ impl<'a> TS1E_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -387,4 +445,30 @@ impl W { pub fn ts1e(&mut self) -> TS1E_W { TS1E_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HRC timer selection\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 [tsel](index.html) module"] +pub struct TSEL_SPEC; +impl crate::RegisterSpec for TSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tsel::R](R) reader structure"] +impl crate::Readable for TSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tsel::W](W) writer structure"] +impl crate::Writable for TSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TSEL to value 0"] +impl crate::Resettable for TSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0.rs b/src/ledts0.rs index 3ceb5ab4..5406130b 100644 --- a/src/ledts0.rs +++ b/src/ledts0.rs @@ -2,144 +2,69 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x04 - Global Control Register"] - pub globctl: GLOBCTL, + pub globctl: crate::Reg, #[doc = "0x08 - Function Control Register"] - pub fnctl: FNCTL, + pub fnctl: crate::Reg, #[doc = "0x0c - Event Flag Register"] - pub evfr: EVFR, + pub evfr: crate::Reg, #[doc = "0x10 - Touch-sense TS-Counter Value"] - pub tsval: TSVAL, + pub tsval: crate::Reg, #[doc = "0x14 - Line Pattern Register 0"] - pub line0: LINE0, + pub line0: crate::Reg, #[doc = "0x18 - Line Pattern Register 1"] - pub line1: LINE1, + pub line1: crate::Reg, #[doc = "0x1c - LED Compare Register 0"] - pub ldcmp0: LDCMP0, + pub ldcmp0: crate::Reg, #[doc = "0x20 - LED Compare Register 1"] - pub ldcmp1: LDCMP1, + pub ldcmp1: crate::Reg, #[doc = "0x24 - Touch-sense Compare Register 0"] - pub tscmp0: TSCMP0, + pub tscmp0: crate::Reg, #[doc = "0x28 - Touch-sense Compare Register 1"] - pub tscmp1: TSCMP1, + pub tscmp1: crate::Reg, } -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "Global Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globctl](globctl) module"] -pub type GLOBCTL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBCTL; -#[doc = "`read()` method returns [globctl::R](globctl::R) reader structure"] -impl crate::Readable for GLOBCTL {} -#[doc = "`write(|w| ..)` method takes [globctl::W](globctl::W) writer structure"] -impl crate::Writable for GLOBCTL {} +#[doc = "GLOBCTL register accessor: an alias for `Reg`"] +pub type GLOBCTL = crate::Reg; #[doc = "Global Control Register"] pub mod globctl; -#[doc = "Function Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fnctl](fnctl) module"] -pub type FNCTL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FNCTL; -#[doc = "`read()` method returns [fnctl::R](fnctl::R) reader structure"] -impl crate::Readable for FNCTL {} -#[doc = "`write(|w| ..)` method takes [fnctl::W](fnctl::W) writer structure"] -impl crate::Writable for FNCTL {} +#[doc = "FNCTL register accessor: an alias for `Reg`"] +pub type FNCTL = crate::Reg; #[doc = "Function Control Register"] pub mod fnctl; -#[doc = "Event Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evfr](evfr) module"] -pub type EVFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EVFR; -#[doc = "`read()` method returns [evfr::R](evfr::R) reader structure"] -impl crate::Readable for EVFR {} -#[doc = "`write(|w| ..)` method takes [evfr::W](evfr::W) writer structure"] -impl crate::Writable for EVFR {} +#[doc = "EVFR register accessor: an alias for `Reg`"] +pub type EVFR = crate::Reg; #[doc = "Event Flag Register"] pub mod evfr; -#[doc = "Touch-sense TS-Counter Value\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tsval](tsval) module"] -pub type TSVAL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TSVAL; -#[doc = "`read()` method returns [tsval::R](tsval::R) reader structure"] -impl crate::Readable for TSVAL {} -#[doc = "`write(|w| ..)` method takes [tsval::W](tsval::W) writer structure"] -impl crate::Writable for TSVAL {} +#[doc = "TSVAL register accessor: an alias for `Reg`"] +pub type TSVAL = crate::Reg; #[doc = "Touch-sense TS-Counter Value"] pub mod tsval; -#[doc = "Line Pattern Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [line0](line0) module"] -pub type LINE0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LINE0; -#[doc = "`read()` method returns [line0::R](line0::R) reader structure"] -impl crate::Readable for LINE0 {} -#[doc = "`write(|w| ..)` method takes [line0::W](line0::W) writer structure"] -impl crate::Writable for LINE0 {} +#[doc = "LINE0 register accessor: an alias for `Reg`"] +pub type LINE0 = crate::Reg; #[doc = "Line Pattern Register 0"] pub mod line0; -#[doc = "Line Pattern Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [line1](line1) module"] -pub type LINE1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LINE1; -#[doc = "`read()` method returns [line1::R](line1::R) reader structure"] -impl crate::Readable for LINE1 {} -#[doc = "`write(|w| ..)` method takes [line1::W](line1::W) writer structure"] -impl crate::Writable for LINE1 {} +#[doc = "LINE1 register accessor: an alias for `Reg`"] +pub type LINE1 = crate::Reg; #[doc = "Line Pattern Register 1"] pub mod line1; -#[doc = "LED Compare Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ldcmp0](ldcmp0) module"] -pub type LDCMP0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LDCMP0; -#[doc = "`read()` method returns [ldcmp0::R](ldcmp0::R) reader structure"] -impl crate::Readable for LDCMP0 {} -#[doc = "`write(|w| ..)` method takes [ldcmp0::W](ldcmp0::W) writer structure"] -impl crate::Writable for LDCMP0 {} +#[doc = "LDCMP0 register accessor: an alias for `Reg`"] +pub type LDCMP0 = crate::Reg; #[doc = "LED Compare Register 0"] pub mod ldcmp0; -#[doc = "LED Compare Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ldcmp1](ldcmp1) module"] -pub type LDCMP1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LDCMP1; -#[doc = "`read()` method returns [ldcmp1::R](ldcmp1::R) reader structure"] -impl crate::Readable for LDCMP1 {} -#[doc = "`write(|w| ..)` method takes [ldcmp1::W](ldcmp1::W) writer structure"] -impl crate::Writable for LDCMP1 {} +#[doc = "LDCMP1 register accessor: an alias for `Reg`"] +pub type LDCMP1 = crate::Reg; #[doc = "LED Compare Register 1"] pub mod ldcmp1; -#[doc = "Touch-sense Compare Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tscmp0](tscmp0) module"] -pub type TSCMP0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TSCMP0; -#[doc = "`read()` method returns [tscmp0::R](tscmp0::R) reader structure"] -impl crate::Readable for TSCMP0 {} -#[doc = "`write(|w| ..)` method takes [tscmp0::W](tscmp0::W) writer structure"] -impl crate::Writable for TSCMP0 {} +#[doc = "TSCMP0 register accessor: an alias for `Reg`"] +pub type TSCMP0 = crate::Reg; #[doc = "Touch-sense Compare Register 0"] pub mod tscmp0; -#[doc = "Touch-sense Compare Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tscmp1](tscmp1) module"] -pub type TSCMP1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TSCMP1; -#[doc = "`read()` method returns [tscmp1::R](tscmp1::R) reader structure"] -impl crate::Readable for TSCMP1 {} -#[doc = "`write(|w| ..)` method takes [tscmp1::W](tscmp1::W) writer structure"] -impl crate::Writable for TSCMP1 {} +#[doc = "TSCMP1 register accessor: an alias for `Reg`"] +pub type TSCMP1 = crate::Reg; #[doc = "Touch-sense Compare Register 1"] pub mod tscmp1; diff --git a/src/ledts0/evfr.rs b/src/ledts0/evfr.rs index 0e3c231f..41c6d09f 100644 --- a/src/ledts0/evfr.rs +++ b/src/ledts0/evfr.rs @@ -1,21 +1,81 @@ -#[doc = "Reader of register EVFR"] -pub type R = crate::R; -#[doc = "Writer for register EVFR"] -pub type W = crate::W; -#[doc = "Register EVFR `reset()`'s with value 0"] -impl crate::ResetValue for super::EVFR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `EVFR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVFR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TSF` reader - Time Slice Interrupt Flag"] +pub struct TSF_R(crate::FieldReader); +impl TSF_R { + pub(crate) fn new(bits: bool) -> Self { + TSF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TFF` reader - (Extended) Time Frame Interrupt Flag"] +pub struct TFF_R(crate::FieldReader); +impl TFF_R { + pub(crate) fn new(bits: bool) -> Self { + TFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TPF` reader - Autoscan Time Period Interrupt Flag"] +pub struct TPF_R(crate::FieldReader); +impl TPF_R { + pub(crate) fn new(bits: bool) -> Self { + TPF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TPF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `TSF`"] -pub type TSF_R = crate::R; -#[doc = "Reader of field `TFF`"] -pub type TFF_R = crate::R; -#[doc = "Reader of field `TPF`"] -pub type TPF_R = crate::R; #[doc = "TS-Counter Overflow Indication\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum TSCTROVF_A { @@ -30,9 +90,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSCTROVF`"] -pub type TSCTROVF_R = crate::R; +#[doc = "Field `TSCTROVF` reader - TS-Counter Overflow Indication"] +pub struct TSCTROVF_R(crate::FieldReader); impl TSCTROVF_R { + pub(crate) fn new(bits: bool) -> Self { + TSCTROVF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSCTROVF_A { @@ -44,12 +107,19 @@ impl TSCTROVF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSCTROVF_A::VALUE1 + **self == TSCTROVF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSCTROVF_A::VALUE2 + **self == TSCTROVF_A::VALUE2 + } +} +impl core::ops::Deref for TSCTROVF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Clear Time Slice Interrupt Flag\n\nValue on reset: 0"] @@ -66,7 +136,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTSF`"] +#[doc = "Field `CTSF` writer - Clear Time Slice Interrupt Flag"] pub struct CTSF_W<'a> { w: &'a mut W, } @@ -74,9 +144,7 @@ impl<'a> CTSF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTSF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -101,7 +169,7 @@ impl<'a> CTSF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -119,7 +187,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTFF`"] +#[doc = "Field `CTFF` writer - Clear (Extended) Time Frame Interrupt Flag"] pub struct CTFF_W<'a> { w: &'a mut W, } @@ -127,9 +195,7 @@ impl<'a> CTFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTFF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -154,7 +220,7 @@ impl<'a> CTFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -172,7 +238,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTPF`"] +#[doc = "Field `CTPF` writer - Clear Autoscan Time Period Interrupt Flag"] pub struct CTPF_W<'a> { w: &'a mut W, } @@ -180,9 +246,7 @@ impl<'a> CTPF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTPF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -207,7 +271,7 @@ impl<'a> CTPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -249,4 +313,30 @@ impl W { pub fn ctpf(&mut self) -> CTPF_W { CTPF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event Flag Register\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 [evfr](index.html) module"] +pub struct EVFR_SPEC; +impl crate::RegisterSpec for EVFR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evfr::R](R) reader structure"] +impl crate::Readable for EVFR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [evfr::W](W) writer structure"] +impl crate::Writable for EVFR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVFR to value 0"] +impl crate::Resettable for EVFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/fnctl.rs b/src/ledts0/fnctl.rs index 0f6ac8b6..69647ce1 100644 --- a/src/ledts0/fnctl.rs +++ b/src/ledts0/fnctl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register FNCTL"] -pub type R = crate::R; -#[doc = "Writer for register FNCTL"] -pub type W = crate::W; -#[doc = "Register FNCTL `reset()`'s with value 0"] -impl crate::ResetValue for super::FNCTL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FNCTL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FNCTL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Touch-Sense TSIN Pad Turn\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PADT`"] -pub type PADT_R = crate::R; +#[doc = "Field `PADT` reader - Touch-Sense TSIN Pad Turn"] +pub struct PADT_R(crate::FieldReader); impl PADT_R { + pub(crate) fn new(bits: u8) -> Self { + PADT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PADT_A::VALUE1), - 7 => Val(PADT_A::VALUE2), - i => Res(i), + 0 => Some(PADT_A::VALUE1), + 7 => Some(PADT_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PADT_A::VALUE1 + **self == PADT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PADT_A::VALUE2 + **self == PADT_A::VALUE2 } } -#[doc = "Write proxy for field `PADT`"] +impl core::ops::Deref for PADT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PADT` writer - Touch-Sense TSIN Pad Turn"] pub struct PADT_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> PADT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -90,9 +123,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PADTSW`"] -pub type PADTSW_R = crate::R; +#[doc = "Field `PADTSW` reader - Software Control for Touch-Sense Pad Turn"] +pub struct PADTSW_R(crate::FieldReader); impl PADTSW_R { + pub(crate) fn new(bits: bool) -> Self { + PADTSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PADTSW_A { @@ -104,15 +140,22 @@ impl PADTSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PADTSW_A::VALUE1 + **self == PADTSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PADTSW_A::VALUE2 + **self == PADTSW_A::VALUE2 + } +} +impl core::ops::Deref for PADTSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PADTSW`"] +#[doc = "Field `PADTSW` writer - Software Control for Touch-Sense Pad Turn"] pub struct PADTSW_W<'a> { w: &'a mut W, } @@ -120,9 +163,7 @@ impl<'a> PADTSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PADTSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The hardware automatically enables the touch-sense inputs in sequence round-robin, starting from TSIN0."] #[inline(always)] @@ -147,7 +188,7 @@ impl<'a> PADTSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -166,9 +207,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EPULL`"] -pub type EPULL_R = crate::R; +#[doc = "Field `EPULL` reader - Enable External Pull-up Configuration on Pin COLA"] +pub struct EPULL_R(crate::FieldReader); impl EPULL_R { + pub(crate) fn new(bits: bool) -> Self { + EPULL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPULL_A { @@ -180,15 +224,22 @@ impl EPULL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPULL_A::VALUE1 + **self == EPULL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPULL_A::VALUE2 + **self == EPULL_A::VALUE2 + } +} +impl core::ops::Deref for EPULL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EPULL`"] +#[doc = "Field `EPULL` writer - Enable External Pull-up Configuration on Pin COLA"] pub struct EPULL_W<'a> { w: &'a mut W, } @@ -196,9 +247,7 @@ impl<'a> EPULL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPULL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HW over-rule to enable internal pull-up is active on TSIN\\[x\\] for set duration in touch-sense time slice. With this setting, it is not specified to assign the COLA to any pin."] @@ -224,12 +273,24 @@ for set duration in touch-sense time slice. With this setting, it is not specifi #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `FNCOL`"] -pub type FNCOL_R = crate::R; +#[doc = "Field `FNCOL` reader - Previous Active Function/LED Column Status"] +pub struct FNCOL_R(crate::FieldReader); +impl FNCOL_R { + pub(crate) fn new(bits: u8) -> Self { + FNCOL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FNCOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Accumulate Count on Touch-Sense Input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -247,37 +308,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ACCCNT`"] -pub type ACCCNT_R = crate::R; +#[doc = "Field `ACCCNT` reader - Accumulate Count on Touch-Sense Input"] +pub struct ACCCNT_R(crate::FieldReader); impl ACCCNT_R { + pub(crate) fn new(bits: u8) -> Self { + ACCCNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ACCCNT_A::VALUE1), - 1 => Val(ACCCNT_A::VALUE2), - 15 => Val(ACCCNT_A::VALUE3), - i => Res(i), + 0 => Some(ACCCNT_A::VALUE1), + 1 => Some(ACCCNT_A::VALUE2), + 15 => Some(ACCCNT_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACCCNT_A::VALUE1 + **self == ACCCNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACCCNT_A::VALUE2 + **self == ACCCNT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ACCCNT_A::VALUE3 + **self == ACCCNT_A::VALUE3 + } +} +impl core::ops::Deref for ACCCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACCCNT`"] +#[doc = "Field `ACCCNT` writer - Accumulate Count on Touch-Sense Input"] pub struct ACCCNT_W<'a> { w: &'a mut W, } @@ -305,7 +375,7 @@ impl<'a> ACCCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -323,9 +393,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSCCMP`"] -pub type TSCCMP_R = crate::R; +#[doc = "Field `TSCCMP` reader - Common Compare Enable for Touch-Sense"] +pub struct TSCCMP_R(crate::FieldReader); impl TSCCMP_R { + pub(crate) fn new(bits: bool) -> Self { + TSCCMP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSCCMP_A { @@ -337,15 +410,22 @@ impl TSCCMP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSCCMP_A::VALUE1 + **self == TSCCMP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSCCMP_A::VALUE2 + **self == TSCCMP_A::VALUE2 + } +} +impl core::ops::Deref for TSCCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSCCMP`"] +#[doc = "Field `TSCCMP` writer - Common Compare Enable for Touch-Sense"] pub struct TSCCMP_W<'a> { w: &'a mut W, } @@ -353,9 +433,7 @@ impl<'a> TSCCMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSCCMP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable common compare for touch-sense"] #[inline(always)] @@ -380,7 +458,7 @@ impl<'a> TSCCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -403,9 +481,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TSOEXT`"] -pub type TSOEXT_R = crate::R; +#[doc = "Field `TSOEXT` reader - Extension for Touch-Sense Output for Pin-Low-Level"] +pub struct TSOEXT_R(crate::FieldReader); impl TSOEXT_R { + pub(crate) fn new(bits: u8) -> Self { + TSOEXT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSOEXT_A { @@ -420,25 +501,32 @@ impl TSOEXT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSOEXT_A::VALUE1 + **self == TSOEXT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSOEXT_A::VALUE2 + **self == TSOEXT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TSOEXT_A::VALUE3 + **self == TSOEXT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TSOEXT_A::VALUE4 + **self == TSOEXT_A::VALUE4 + } +} +impl core::ops::Deref for TSOEXT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSOEXT`"] +#[doc = "Field `TSOEXT` writer - Extension for Touch-Sense Output for Pin-Low-Level"] pub struct TSOEXT_W<'a> { w: &'a mut W, } @@ -446,9 +534,7 @@ impl<'a> TSOEXT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSOEXT_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Extend by 1 ledts_clk"] #[inline(always)] @@ -473,7 +559,7 @@ impl<'a> TSOEXT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 21)) | (((value as u32) & 0x03) << 21); + self.w.bits = (self.w.bits & !(0x03 << 21)) | ((value as u32 & 0x03) << 21); self.w } } @@ -491,9 +577,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSCTRR`"] -pub type TSCTRR_R = crate::R; +#[doc = "Field `TSCTRR` reader - TS-Counter Auto Reset"] +pub struct TSCTRR_R(crate::FieldReader); impl TSCTRR_R { + pub(crate) fn new(bits: bool) -> Self { + TSCTRR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSCTRR_A { @@ -505,15 +594,22 @@ impl TSCTRR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSCTRR_A::VALUE1 + **self == TSCTRR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSCTRR_A::VALUE2 + **self == TSCTRR_A::VALUE2 + } +} +impl core::ops::Deref for TSCTRR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSCTRR`"] +#[doc = "Field `TSCTRR` writer - TS-Counter Auto Reset"] pub struct TSCTRR_W<'a> { w: &'a mut W, } @@ -521,9 +617,7 @@ impl<'a> TSCTRR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSCTRR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable TS-counter automatic reset"] #[inline(always)] @@ -548,7 +642,7 @@ impl<'a> TSCTRR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -566,9 +660,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSCTRSAT`"] -pub type TSCTRSAT_R = crate::R; +#[doc = "Field `TSCTRSAT` reader - Saturation of TS-Counter"] +pub struct TSCTRSAT_R(crate::FieldReader); impl TSCTRSAT_R { + pub(crate) fn new(bits: bool) -> Self { + TSCTRSAT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSCTRSAT_A { @@ -580,15 +677,22 @@ impl TSCTRSAT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSCTRSAT_A::VALUE1 + **self == TSCTRSAT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSCTRSAT_A::VALUE2 + **self == TSCTRSAT_A::VALUE2 + } +} +impl core::ops::Deref for TSCTRSAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSCTRSAT`"] +#[doc = "Field `TSCTRSAT` writer - Saturation of TS-Counter"] pub struct TSCTRSAT_W<'a> { w: &'a mut W, } @@ -596,9 +700,7 @@ impl<'a> TSCTRSAT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSCTRSAT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -623,7 +725,7 @@ impl<'a> TSCTRSAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -642,31 +744,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `NR_TSIN`"] -pub type NR_TSIN_R = crate::R; +#[doc = "Field `NR_TSIN` reader - Number of Touch-Sense Input"] +pub struct NR_TSIN_R(crate::FieldReader); impl NR_TSIN_R { + pub(crate) fn new(bits: u8) -> Self { + NR_TSIN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(NR_TSIN_A::VALUE1), - 7 => Val(NR_TSIN_A::VALUE2), - i => Res(i), + 0 => Some(NR_TSIN_A::VALUE1), + 7 => Some(NR_TSIN_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NR_TSIN_A::VALUE1 + **self == NR_TSIN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NR_TSIN_A::VALUE2 + **self == NR_TSIN_A::VALUE2 + } +} +impl core::ops::Deref for NR_TSIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NR_TSIN`"] +#[doc = "Field `NR_TSIN` writer - Number of Touch-Sense Input"] pub struct NR_TSIN_W<'a> { w: &'a mut W, } @@ -689,7 +800,7 @@ impl<'a> NR_TSIN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 25)) | (((value as u32) & 0x07) << 25); + self.w.bits = (self.w.bits & !(0x07 << 25)) | ((value as u32 & 0x07) << 25); self.w } } @@ -707,9 +818,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `COLLEV`"] -pub type COLLEV_R = crate::R; +#[doc = "Field `COLLEV` reader - Active Level of LED Column"] +pub struct COLLEV_R(crate::FieldReader); impl COLLEV_R { + pub(crate) fn new(bits: bool) -> Self { + COLLEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> COLLEV_A { @@ -721,15 +835,22 @@ impl COLLEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == COLLEV_A::VALUE1 + **self == COLLEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == COLLEV_A::VALUE2 + **self == COLLEV_A::VALUE2 + } +} +impl core::ops::Deref for COLLEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `COLLEV`"] +#[doc = "Field `COLLEV` writer - Active Level of LED Column"] pub struct COLLEV_W<'a> { w: &'a mut W, } @@ -737,9 +858,7 @@ impl<'a> COLLEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: COLLEV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Active low"] #[inline(always)] @@ -764,7 +883,7 @@ impl<'a> COLLEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -795,9 +914,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `NR_LEDCOL`"] -pub type NR_LEDCOL_R = crate::R; +#[doc = "Field `NR_LEDCOL` reader - Number of LED Columns"] +pub struct NR_LEDCOL_R(crate::FieldReader); impl NR_LEDCOL_R { + pub(crate) fn new(bits: u8) -> Self { + NR_LEDCOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NR_LEDCOL_A { @@ -816,45 +938,52 @@ impl NR_LEDCOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NR_LEDCOL_A::VALUE1 + **self == NR_LEDCOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NR_LEDCOL_A::VALUE2 + **self == NR_LEDCOL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == NR_LEDCOL_A::VALUE3 + **self == NR_LEDCOL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == NR_LEDCOL_A::VALUE4 + **self == NR_LEDCOL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == NR_LEDCOL_A::VALUE5 + **self == NR_LEDCOL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == NR_LEDCOL_A::VALUE6 + **self == NR_LEDCOL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == NR_LEDCOL_A::VALUE7 + **self == NR_LEDCOL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == NR_LEDCOL_A::VALUE8 + **self == NR_LEDCOL_A::VALUE8 + } +} +impl core::ops::Deref for NR_LEDCOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NR_LEDCOL`"] +#[doc = "Field `NR_LEDCOL` writer - Number of LED Columns"] pub struct NR_LEDCOL_W<'a> { w: &'a mut W, } @@ -862,9 +991,7 @@ impl<'a> NR_LEDCOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NR_LEDCOL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "1 LED column"] #[inline(always)] @@ -909,7 +1036,7 @@ impl<'a> NR_LEDCOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 29)) | (((value as u32) & 0x07) << 29); + self.w.bits = (self.w.bits & !(0x07 << 29)) | ((value as u32 & 0x07) << 29); self.w } } @@ -1031,4 +1158,30 @@ impl W { pub fn nr_ledcol(&mut self) -> NR_LEDCOL_W { NR_LEDCOL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Function Control Register\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 [fnctl](index.html) module"] +pub struct FNCTL_SPEC; +impl crate::RegisterSpec for FNCTL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fnctl::R](R) reader structure"] +impl crate::Readable for FNCTL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fnctl::W](W) writer structure"] +impl crate::Writable for FNCTL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FNCTL to value 0"] +impl crate::Resettable for FNCTL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/globctl.rs b/src/ledts0/globctl.rs index 7dff1a23..e478a31d 100644 --- a/src/ledts0/globctl.rs +++ b/src/ledts0/globctl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLOBCTL"] -pub type R = crate::R; -#[doc = "Writer for register GLOBCTL"] -pub type W = crate::W; -#[doc = "Register GLOBCTL `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBCTL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBCTL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBCTL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TS_EN` reader - Touch-Sense Function Enable"] +pub struct TS_EN_R(crate::FieldReader); +impl TS_EN_R { + pub(crate) fn new(bits: bool) -> Self { + TS_EN_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `TS_EN`"] -pub type TS_EN_R = crate::R; -#[doc = "Write proxy for field `TS_EN`"] +impl core::ops::Deref for TS_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TS_EN` writer - Touch-Sense Function Enable"] pub struct TS_EN_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> TS_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `LD_EN`"] -pub type LD_EN_R = crate::R; -#[doc = "Write proxy for field `LD_EN`"] +#[doc = "Field `LD_EN` reader - LED Function Enable"] +pub struct LD_EN_R(crate::FieldReader); +impl LD_EN_R { + pub(crate) fn new(bits: bool) -> Self { + LD_EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LD_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LD_EN` writer - LED Function Enable"] pub struct LD_EN_W<'a> { w: &'a mut W, } @@ -54,7 +102,7 @@ impl<'a> LD_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -72,9 +120,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CMTR`"] -pub type CMTR_R = crate::R; +#[doc = "Field `CMTR` reader - Clock Master Disable"] +pub struct CMTR_R(crate::FieldReader); impl CMTR_R { + pub(crate) fn new(bits: bool) -> Self { + CMTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CMTR_A { @@ -86,15 +137,22 @@ impl CMTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMTR_A::VALUE1 + **self == CMTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMTR_A::VALUE2 + **self == CMTR_A::VALUE2 } } -#[doc = "Write proxy for field `CMTR`"] +impl core::ops::Deref for CMTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMTR` writer - Clock Master Disable"] pub struct CMTR_W<'a> { w: &'a mut W, } @@ -102,9 +160,7 @@ impl<'a> CMTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CMTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Kernel generates its own clock for LEDTS-counter based on SFR setting"] #[inline(always)] @@ -129,7 +185,7 @@ impl<'a> CMTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -147,9 +203,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENSYNC`"] -pub type ENSYNC_R = crate::R; +#[doc = "Field `ENSYNC` reader - Enable Autoscan Time Period Synchronization"] +pub struct ENSYNC_R(crate::FieldReader); impl ENSYNC_R { + pub(crate) fn new(bits: bool) -> Self { + ENSYNC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENSYNC_A { @@ -161,15 +220,22 @@ impl ENSYNC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENSYNC_A::VALUE1 + **self == ENSYNC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENSYNC_A::VALUE2 + **self == ENSYNC_A::VALUE2 } } -#[doc = "Write proxy for field `ENSYNC`"] +impl core::ops::Deref for ENSYNC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENSYNC` writer - Enable Autoscan Time Period Synchronization"] pub struct ENSYNC_W<'a> { w: &'a mut W, } @@ -177,9 +243,7 @@ impl<'a> ENSYNC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENSYNC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No synchronization"] #[inline(always)] @@ -204,7 +268,7 @@ impl<'a> ENSYNC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -222,9 +286,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SUSCFG`"] -pub type SUSCFG_R = crate::R; +#[doc = "Field `SUSCFG` reader - Suspend Request Configuration"] +pub struct SUSCFG_R(crate::FieldReader); impl SUSCFG_R { + pub(crate) fn new(bits: bool) -> Self { + SUSCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSCFG_A { @@ -236,15 +303,22 @@ impl SUSCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSCFG_A::VALUE1 + **self == SUSCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSCFG_A::VALUE2 + **self == SUSCFG_A::VALUE2 } } -#[doc = "Write proxy for field `SUSCFG`"] +impl core::ops::Deref for SUSCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSCFG` writer - Suspend Request Configuration"] pub struct SUSCFG_W<'a> { w: &'a mut W, } @@ -252,9 +326,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SUSCFG_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore suspend request"] #[inline(always)] @@ -279,7 +351,7 @@ impl<'a> SUSCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -300,37 +372,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MASKVAL`"] -pub type MASKVAL_R = crate::R; +#[doc = "Field `MASKVAL` reader - Mask Number of LSB Bits for Event Validation"] +pub struct MASKVAL_R(crate::FieldReader); impl MASKVAL_R { + pub(crate) fn new(bits: u8) -> Self { + MASKVAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MASKVAL_A::VALUE1), - 1 => Val(MASKVAL_A::VALUE2), - 7 => Val(MASKVAL_A::VALUE3), - i => Res(i), + 0 => Some(MASKVAL_A::VALUE1), + 1 => Some(MASKVAL_A::VALUE2), + 7 => Some(MASKVAL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MASKVAL_A::VALUE1 + **self == MASKVAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MASKVAL_A::VALUE2 + **self == MASKVAL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MASKVAL_A::VALUE3 + **self == MASKVAL_A::VALUE3 } } -#[doc = "Write proxy for field `MASKVAL`"] +impl core::ops::Deref for MASKVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MASKVAL` writer - Mask Number of LSB Bits for Event Validation"] pub struct MASKVAL_W<'a> { w: &'a mut W, } @@ -358,7 +439,7 @@ impl<'a> MASKVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 9)) | (((value as u32) & 0x07) << 9); + self.w.bits = (self.w.bits & !(0x07 << 9)) | ((value as u32 & 0x07) << 9); self.w } } @@ -376,9 +457,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FENVAL`"] -pub type FENVAL_R = crate::R; +#[doc = "Field `FENVAL` reader - Enable (Extended) Time Frame Validation"] +pub struct FENVAL_R(crate::FieldReader); impl FENVAL_R { + pub(crate) fn new(bits: bool) -> Self { + FENVAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FENVAL_A { @@ -390,15 +474,22 @@ impl FENVAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FENVAL_A::VALUE1 + **self == FENVAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FENVAL_A::VALUE2 + **self == FENVAL_A::VALUE2 } } -#[doc = "Write proxy for field `FENVAL`"] +impl core::ops::Deref for FENVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FENVAL` writer - Enable (Extended) Time Frame Validation"] pub struct FENVAL_W<'a> { w: &'a mut W, } @@ -406,9 +497,7 @@ impl<'a> FENVAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FENVAL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -433,7 +522,7 @@ impl<'a> FENVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -451,9 +540,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ITS_EN`"] -pub type ITS_EN_R = crate::R; +#[doc = "Field `ITS_EN` reader - Enable Time Slice Interrupt"] +pub struct ITS_EN_R(crate::FieldReader); impl ITS_EN_R { + pub(crate) fn new(bits: bool) -> Self { + ITS_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ITS_EN_A { @@ -465,15 +557,22 @@ impl ITS_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ITS_EN_A::VALUE1 + **self == ITS_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ITS_EN_A::VALUE2 + **self == ITS_EN_A::VALUE2 } } -#[doc = "Write proxy for field `ITS_EN`"] +impl core::ops::Deref for ITS_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ITS_EN` writer - Enable Time Slice Interrupt"] pub struct ITS_EN_W<'a> { w: &'a mut W, } @@ -481,9 +580,7 @@ impl<'a> ITS_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ITS_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -508,7 +605,7 @@ impl<'a> ITS_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -526,9 +623,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ITF_EN`"] -pub type ITF_EN_R = crate::R; +#[doc = "Field `ITF_EN` reader - Enable (Extended) Time Frame Interrupt"] +pub struct ITF_EN_R(crate::FieldReader); impl ITF_EN_R { + pub(crate) fn new(bits: bool) -> Self { + ITF_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ITF_EN_A { @@ -540,15 +640,22 @@ impl ITF_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ITF_EN_A::VALUE1 + **self == ITF_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ITF_EN_A::VALUE2 + **self == ITF_EN_A::VALUE2 } } -#[doc = "Write proxy for field `ITF_EN`"] +impl core::ops::Deref for ITF_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ITF_EN` writer - Enable (Extended) Time Frame Interrupt"] pub struct ITF_EN_W<'a> { w: &'a mut W, } @@ -556,9 +663,7 @@ impl<'a> ITF_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ITF_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -583,7 +688,7 @@ impl<'a> ITF_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -601,9 +706,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ITP_EN`"] -pub type ITP_EN_R = crate::R; +#[doc = "Field `ITP_EN` reader - Enable Autoscan Time Period Interrupt"] +pub struct ITP_EN_R(crate::FieldReader); impl ITP_EN_R { + pub(crate) fn new(bits: bool) -> Self { + ITP_EN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ITP_EN_A { @@ -615,15 +723,22 @@ impl ITP_EN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ITP_EN_A::VALUE1 + **self == ITP_EN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ITP_EN_A::VALUE2 + **self == ITP_EN_A::VALUE2 } } -#[doc = "Write proxy for field `ITP_EN`"] +impl core::ops::Deref for ITP_EN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ITP_EN` writer - Enable Autoscan Time Period Interrupt"] pub struct ITP_EN_W<'a> { w: &'a mut W, } @@ -631,9 +746,7 @@ impl<'a> ITP_EN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ITP_EN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -658,13 +771,25 @@ impl<'a> ITP_EN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CLK_PS`"] -pub type CLK_PS_R = crate::R; -#[doc = "Write proxy for field `CLK_PS`"] +#[doc = "Field `CLK_PS` reader - LEDTS-Counter Clock Pre-Scale Factor"] +pub struct CLK_PS_R(crate::FieldReader); +impl CLK_PS_R { + pub(crate) fn new(bits: u16) -> Self { + CLK_PS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CLK_PS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CLK_PS` writer - LEDTS-Counter Clock Pre-Scale Factor"] pub struct CLK_PS_W<'a> { w: &'a mut W, } @@ -672,7 +797,7 @@ impl<'a> CLK_PS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -789,4 +914,30 @@ impl W { pub fn clk_ps(&mut self) -> CLK_PS_W { CLK_PS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Control Register\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 [globctl](index.html) module"] +pub struct GLOBCTL_SPEC; +impl crate::RegisterSpec for GLOBCTL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globctl::R](R) reader structure"] +impl crate::Readable for GLOBCTL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globctl::W](W) writer structure"] +impl crate::Writable for GLOBCTL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBCTL to value 0"] +impl crate::Resettable for GLOBCTL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/id.rs b/src/ledts0/id.rs index ad754b74..f6bd05d0 100644 --- a/src/ledts0/id.rs +++ b/src/ledts0/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00ab_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00ab_c000 + } +} diff --git a/src/ledts0/ldcmp0.rs b/src/ledts0/ldcmp0.rs index ec454ee0..086e36a8 100644 --- a/src/ledts0/ldcmp0.rs +++ b/src/ledts0/ldcmp0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LDCMP0"] -pub type R = crate::R; -#[doc = "Writer for register LDCMP0"] -pub type W = crate::W; -#[doc = "Register LDCMP0 `reset()`'s with value 0"] -impl crate::ResetValue for super::LDCMP0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LDCMP0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LDCMP0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CMP_LD0`"] -pub type CMP_LD0_R = crate::R; -#[doc = "Write proxy for field `CMP_LD0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CMP_LD0` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD0_R(crate::FieldReader); +impl CMP_LD0_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD0` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> CMP_LD0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `CMP_LD1`"] -pub type CMP_LD1_R = crate::R; -#[doc = "Write proxy for field `CMP_LD1`"] +#[doc = "Field `CMP_LD1` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD1_R(crate::FieldReader); +impl CMP_LD1_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD1` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> CMP_LD1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CMP_LD2`"] -pub type CMP_LD2_R = crate::R; -#[doc = "Write proxy for field `CMP_LD2`"] +#[doc = "Field `CMP_LD2` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD2_R(crate::FieldReader); +impl CMP_LD2_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD2` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> CMP_LD2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `CMP_LD3`"] -pub type CMP_LD3_R = crate::R; -#[doc = "Write proxy for field `CMP_LD3`"] +#[doc = "Field `CMP_LD3` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD3_R(crate::FieldReader); +impl CMP_LD3_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD3` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> CMP_LD3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn cmp_ld3(&mut self) -> CMP_LD3_W { CMP_LD3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LED Compare Register 0\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 [ldcmp0](index.html) module"] +pub struct LDCMP0_SPEC; +impl crate::RegisterSpec for LDCMP0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ldcmp0::R](R) reader structure"] +impl crate::Readable for LDCMP0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ldcmp0::W](W) writer structure"] +impl crate::Writable for LDCMP0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LDCMP0 to value 0"] +impl crate::Resettable for LDCMP0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/ldcmp1.rs b/src/ledts0/ldcmp1.rs index 8051aacb..b4f39f25 100644 --- a/src/ledts0/ldcmp1.rs +++ b/src/ledts0/ldcmp1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LDCMP1"] -pub type R = crate::R; -#[doc = "Writer for register LDCMP1"] -pub type W = crate::W; -#[doc = "Register LDCMP1 `reset()`'s with value 0"] -impl crate::ResetValue for super::LDCMP1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LDCMP1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LDCMP1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CMP_LD4`"] -pub type CMP_LD4_R = crate::R; -#[doc = "Write proxy for field `CMP_LD4`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CMP_LD4` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD4_R(crate::FieldReader); +impl CMP_LD4_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD4` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD4_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> CMP_LD4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `CMP_LD5`"] -pub type CMP_LD5_R = crate::R; -#[doc = "Write proxy for field `CMP_LD5`"] +#[doc = "Field `CMP_LD5` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD5_R(crate::FieldReader); +impl CMP_LD5_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD5` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD5_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> CMP_LD5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CMP_LD6`"] -pub type CMP_LD6_R = crate::R; -#[doc = "Write proxy for field `CMP_LD6`"] +#[doc = "Field `CMP_LD6` reader - Compare Value for LED COL\\[x\\]"] +pub struct CMP_LD6_R(crate::FieldReader); +impl CMP_LD6_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LD6` writer - Compare Value for LED COL\\[x\\]"] pub struct CMP_LD6_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> CMP_LD6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `CMP_LDA_TSCOM`"] -pub type CMP_LDA_TSCOM_R = crate::R; -#[doc = "Write proxy for field `CMP_LDA_TSCOM`"] +#[doc = "Field `CMP_LDA_TSCOM` reader - Compare Value for LED COLA / Common Compare Value for Touch-sense Pad Turns"] +pub struct CMP_LDA_TSCOM_R(crate::FieldReader); +impl CMP_LDA_TSCOM_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_LDA_TSCOM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_LDA_TSCOM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_LDA_TSCOM` writer - Compare Value for LED COLA / Common Compare Value for Touch-sense Pad Turns"] pub struct CMP_LDA_TSCOM_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> CMP_LDA_TSCOM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn cmp_lda_tscom(&mut self) -> CMP_LDA_TSCOM_W { CMP_LDA_TSCOM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LED Compare Register 1\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 [ldcmp1](index.html) module"] +pub struct LDCMP1_SPEC; +impl crate::RegisterSpec for LDCMP1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ldcmp1::R](R) reader structure"] +impl crate::Readable for LDCMP1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ldcmp1::W](W) writer structure"] +impl crate::Writable for LDCMP1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LDCMP1 to value 0"] +impl crate::Resettable for LDCMP1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/line0.rs b/src/ledts0/line0.rs index 6815686a..461c9b28 100644 --- a/src/ledts0/line0.rs +++ b/src/ledts0/line0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LINE0"] -pub type R = crate::R; -#[doc = "Writer for register LINE0"] -pub type W = crate::W; -#[doc = "Register LINE0 `reset()`'s with value 0"] -impl crate::ResetValue for super::LINE0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LINE0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LINE0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `LINE_0`"] -pub type LINE_0_R = crate::R; -#[doc = "Write proxy for field `LINE_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LINE_0` reader - Output on LINE\\[x\\]"] +pub struct LINE_0_R(crate::FieldReader); +impl LINE_0_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_0` writer - Output on LINE\\[x\\]"] pub struct LINE_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> LINE_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `LINE_1`"] -pub type LINE_1_R = crate::R; -#[doc = "Write proxy for field `LINE_1`"] +#[doc = "Field `LINE_1` reader - Output on LINE\\[x\\]"] +pub struct LINE_1_R(crate::FieldReader); +impl LINE_1_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_1` writer - Output on LINE\\[x\\]"] pub struct LINE_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> LINE_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `LINE_2`"] -pub type LINE_2_R = crate::R; -#[doc = "Write proxy for field `LINE_2`"] +#[doc = "Field `LINE_2` reader - Output on LINE\\[x\\]"] +pub struct LINE_2_R(crate::FieldReader); +impl LINE_2_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_2` writer - Output on LINE\\[x\\]"] pub struct LINE_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> LINE_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `LINE_3`"] -pub type LINE_3_R = crate::R; -#[doc = "Write proxy for field `LINE_3`"] +#[doc = "Field `LINE_3` reader - Output on LINE\\[x\\]"] +pub struct LINE_3_R(crate::FieldReader); +impl LINE_3_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_3` writer - Output on LINE\\[x\\]"] pub struct LINE_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> LINE_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn line_3(&mut self) -> LINE_3_W { LINE_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Line Pattern Register 0\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 [line0](index.html) module"] +pub struct LINE0_SPEC; +impl crate::RegisterSpec for LINE0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [line0::R](R) reader structure"] +impl crate::Readable for LINE0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [line0::W](W) writer structure"] +impl crate::Writable for LINE0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LINE0 to value 0"] +impl crate::Resettable for LINE0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/line1.rs b/src/ledts0/line1.rs index 6fd9f16a..428ed5bd 100644 --- a/src/ledts0/line1.rs +++ b/src/ledts0/line1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LINE1"] -pub type R = crate::R; -#[doc = "Writer for register LINE1"] -pub type W = crate::W; -#[doc = "Register LINE1 `reset()`'s with value 0"] -impl crate::ResetValue for super::LINE1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `LINE1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LINE1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `LINE_4`"] -pub type LINE_4_R = crate::R; -#[doc = "Write proxy for field `LINE_4`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LINE_4` reader - Output on LINE\\[x\\]"] +pub struct LINE_4_R(crate::FieldReader); +impl LINE_4_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_4` writer - Output on LINE\\[x\\]"] pub struct LINE_4_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> LINE_4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `LINE_5`"] -pub type LINE_5_R = crate::R; -#[doc = "Write proxy for field `LINE_5`"] +#[doc = "Field `LINE_5` reader - Output on LINE\\[x\\]"] +pub struct LINE_5_R(crate::FieldReader); +impl LINE_5_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_5` writer - Output on LINE\\[x\\]"] pub struct LINE_5_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> LINE_5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `LINE_6`"] -pub type LINE_6_R = crate::R; -#[doc = "Write proxy for field `LINE_6`"] +#[doc = "Field `LINE_6` reader - Output on LINE\\[x\\]"] +pub struct LINE_6_R(crate::FieldReader); +impl LINE_6_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_6` writer - Output on LINE\\[x\\]"] pub struct LINE_6_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> LINE_6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `LINE_A`"] -pub type LINE_A_R = crate::R; -#[doc = "Write proxy for field `LINE_A`"] +#[doc = "Field `LINE_A` reader - Output on LINE\\[x\\]"] +pub struct LINE_A_R(crate::FieldReader); +impl LINE_A_R { + pub(crate) fn new(bits: u8) -> Self { + LINE_A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LINE_A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LINE_A` writer - Output on LINE\\[x\\]"] pub struct LINE_A_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> LINE_A_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn line_a(&mut self) -> LINE_A_W { LINE_A_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Line Pattern Register 1\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 [line1](index.html) module"] +pub struct LINE1_SPEC; +impl crate::RegisterSpec for LINE1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [line1::R](R) reader structure"] +impl crate::Readable for LINE1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [line1::W](W) writer structure"] +impl crate::Writable for LINE1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LINE1 to value 0"] +impl crate::Resettable for LINE1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/tscmp0.rs b/src/ledts0/tscmp0.rs index 6fb6db8b..844fe22c 100644 --- a/src/ledts0/tscmp0.rs +++ b/src/ledts0/tscmp0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TSCMP0"] -pub type R = crate::R; -#[doc = "Writer for register TSCMP0"] -pub type W = crate::W; -#[doc = "Register TSCMP0 `reset()`'s with value 0"] -impl crate::ResetValue for super::TSCMP0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TSCMP0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TSCMP0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CMP_TS0`"] -pub type CMP_TS0_R = crate::R; -#[doc = "Write proxy for field `CMP_TS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CMP_TS0` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS0_R(crate::FieldReader); +impl CMP_TS0_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS0` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> CMP_TS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `CMP_TS1`"] -pub type CMP_TS1_R = crate::R; -#[doc = "Write proxy for field `CMP_TS1`"] +#[doc = "Field `CMP_TS1` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS1_R(crate::FieldReader); +impl CMP_TS1_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS1` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> CMP_TS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CMP_TS2`"] -pub type CMP_TS2_R = crate::R; -#[doc = "Write proxy for field `CMP_TS2`"] +#[doc = "Field `CMP_TS2` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS2_R(crate::FieldReader); +impl CMP_TS2_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS2` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> CMP_TS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `CMP_TS3`"] -pub type CMP_TS3_R = crate::R; -#[doc = "Write proxy for field `CMP_TS3`"] +#[doc = "Field `CMP_TS3` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS3_R(crate::FieldReader); +impl CMP_TS3_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS3` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> CMP_TS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn cmp_ts3(&mut self) -> CMP_TS3_W { CMP_TS3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Touch-sense Compare Register 0\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 [tscmp0](index.html) module"] +pub struct TSCMP0_SPEC; +impl crate::RegisterSpec for TSCMP0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tscmp0::R](R) reader structure"] +impl crate::Readable for TSCMP0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tscmp0::W](W) writer structure"] +impl crate::Writable for TSCMP0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TSCMP0 to value 0"] +impl crate::Resettable for TSCMP0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/tscmp1.rs b/src/ledts0/tscmp1.rs index 9506a00b..0e7ad8af 100644 --- a/src/ledts0/tscmp1.rs +++ b/src/ledts0/tscmp1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TSCMP1"] -pub type R = crate::R; -#[doc = "Writer for register TSCMP1"] -pub type W = crate::W; -#[doc = "Register TSCMP1 `reset()`'s with value 0"] -impl crate::ResetValue for super::TSCMP1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TSCMP1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TSCMP1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CMP_TS4`"] -pub type CMP_TS4_R = crate::R; -#[doc = "Write proxy for field `CMP_TS4`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CMP_TS4` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS4_R(crate::FieldReader); +impl CMP_TS4_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS4` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS4_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> CMP_TS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `CMP_TS5`"] -pub type CMP_TS5_R = crate::R; -#[doc = "Write proxy for field `CMP_TS5`"] +#[doc = "Field `CMP_TS5` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS5_R(crate::FieldReader); +impl CMP_TS5_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS5` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS5_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> CMP_TS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `CMP_TS6`"] -pub type CMP_TS6_R = crate::R; -#[doc = "Write proxy for field `CMP_TS6`"] +#[doc = "Field `CMP_TS6` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS6_R(crate::FieldReader); +impl CMP_TS6_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS6` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS6_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> CMP_TS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `CMP_TS7`"] -pub type CMP_TS7_R = crate::R; -#[doc = "Write proxy for field `CMP_TS7`"] +#[doc = "Field `CMP_TS7` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] +pub struct CMP_TS7_R(crate::FieldReader); +impl CMP_TS7_R { + pub(crate) fn new(bits: u8) -> Self { + CMP_TS7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP_TS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP_TS7` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] pub struct CMP_TS7_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> CMP_TS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn cmp_ts7(&mut self) -> CMP_TS7_W { CMP_TS7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Touch-sense Compare Register 1\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 [tscmp1](index.html) module"] +pub struct TSCMP1_SPEC; +impl crate::RegisterSpec for TSCMP1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tscmp1::R](R) reader structure"] +impl crate::Readable for TSCMP1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tscmp1::W](W) writer structure"] +impl crate::Writable for TSCMP1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TSCMP1 to value 0"] +impl crate::Resettable for TSCMP1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ledts0/tsval.rs b/src/ledts0/tsval.rs index 6b37e53d..066909e1 100644 --- a/src/ledts0/tsval.rs +++ b/src/ledts0/tsval.rs @@ -1,20 +1,68 @@ -#[doc = "Reader of register TSVAL"] -pub type R = crate::R; -#[doc = "Writer for register TSVAL"] -pub type W = crate::W; -#[doc = "Register TSVAL `reset()`'s with value 0"] -impl crate::ResetValue for super::TSVAL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TSVAL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `TSCTRVALR`"] -pub type TSCTRVALR_R = crate::R; -#[doc = "Reader of field `TSCTRVAL`"] -pub type TSCTRVAL_R = crate::R; -#[doc = "Write proxy for field `TSCTRVAL`"] +#[doc = "Register `TSVAL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TSCTRVALR` reader - Shadow TS-Counter (Read)"] +pub struct TSCTRVALR_R(crate::FieldReader); +impl TSCTRVALR_R { + pub(crate) fn new(bits: u16) -> Self { + TSCTRVALR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSCTRVALR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSCTRVAL` reader - TS-Counter Value"] +pub struct TSCTRVAL_R(crate::FieldReader); +impl TSCTRVAL_R { + pub(crate) fn new(bits: u16) -> Self { + TSCTRVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSCTRVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSCTRVAL` writer - TS-Counter Value"] pub struct TSCTRVAL_W<'a> { w: &'a mut W, } @@ -22,7 +70,7 @@ impl<'a> TSCTRVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -44,4 +92,30 @@ impl W { pub fn tsctrval(&mut self) -> TSCTRVAL_W { TSCTRVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Touch-sense TS-Counter Value\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 [tsval](index.html) module"] +pub struct TSVAL_SPEC; +impl crate::RegisterSpec for TSVAL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tsval::R](R) reader structure"] +impl crate::Readable for TSVAL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tsval::W](W) writer structure"] +impl crate::Writable for TSVAL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TSVAL to value 0"] +impl crate::Resettable for TSVAL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/lib.rs b/src/lib.rs index 9c350891..a388dfbb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,16 @@ -#![doc = "Peripheral access API for XMC4100 microcontrollers (generated using svd2rust v0.17.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.17.0/svd2rust/#peripheral-api"] +#![doc = "Peripheral access API for XMC4100 microcontrollers (generated using svd2rust v0.19.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] +svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.19.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] #![deny(const_err)] #![deny(dead_code)] #![deny(improper_ctypes)] -#![deny(legacy_directory_ownership)] #![deny(missing_docs)] #![deny(no_mangle_generic_items)] #![deny(non_shorthand_field_patterns)] #![deny(overflowing_literals)] #![deny(path_statements)] #![deny(patterns_in_fns_without_body)] -#![deny(plugin_as_library)] #![deny(private_in_public)] -#![deny(safe_extern_statics)] #![deny(unconditional_recursion)] -#![deny(unions_with_drop_fields)] #![deny(unused_allocation)] #![deny(unused_comparisons)] #![deny(unused_parens)] @@ -21,16 +18,21 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] -extern crate bare_metal; -extern crate cortex_m; -#[cfg(feature = "rt")] -extern crate cortex_m_rt; -extern crate vcell; use core::marker::PhantomData; use core::ops::Deref; #[doc = r"Number available in the NVIC for configuring priority"] pub const NVIC_PRIO_BITS: u8 = 6; #[cfg(feature = "rt")] +pub use self::Interrupt as interrupt; +pub use cortex_m::peripheral::Peripherals as CorePeripherals; +pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU}; +#[cfg(feature = "rt")] +pub use cortex_m_rt::interrupt; +#[allow(unused_imports)] +use generic::*; +#[doc = r"Common register and bit access and modify traits"] +pub mod generic; +#[cfg(feature = "rt")] extern "C" { fn SCU_0(); fn ERU0_0(); @@ -218,9 +220,9 @@ pub static __INTERRUPTS: [Vector; 108] = [ Vector { _reserved: 0 }, Vector { _handler: USB0_0 }, ]; -#[doc = r"Enumeration of all the interrupts"] -#[derive(Copy, Clone, Debug)] -#[repr(u8)] +#[doc = r"Enumeration of all the interrupts."] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(u16)] pub enum Interrupt { #[doc = "0 - System Control"] SCU_0 = 0, @@ -355,39 +357,36 @@ pub enum Interrupt { #[doc = "107 - Universal Serial Bus (Module 0)"] USB0_0 = 107, } -unsafe impl bare_metal::Nr for Interrupt { +unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt { #[inline(always)] - fn nr(&self) -> u8 { - *self as u8 + fn number(self) -> u16 { + self as u16 } } -#[cfg(feature = "rt")] -pub use self::Interrupt as interrupt; -pub use cortex_m::peripheral::Peripherals as CorePeripherals; -pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU}; -#[cfg(feature = "rt")] -pub use cortex_m_rt::interrupt; -#[allow(unused_imports)] -use generic::*; -#[doc = r"Common register and bit access and modify traits"] -pub mod generic; #[doc = "Cortex-M4 Private Peripheral Block"] pub struct PPB { _marker: PhantomData<*const ()>, } unsafe impl Send for PPB {} impl PPB { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ppb::RegisterBlock = 0xe000_e000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ppb::RegisterBlock { - 0xe000_e000 as *const _ + Self::PTR } } impl Deref for PPB { type Target = ppb::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PPB::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PPB { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PPB").finish() } } #[doc = "Cortex-M4 Private Peripheral Block"] @@ -398,17 +397,24 @@ pub struct DLR { } unsafe impl Send for DLR {} impl DLR { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const dlr::RegisterBlock = 0x5000_4900 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const dlr::RegisterBlock { - 0x5000_4900 as *const _ + Self::PTR } } impl Deref for DLR { type Target = dlr::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*DLR::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for DLR { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("DLR").finish() } } #[doc = "DMA Line Router"] @@ -419,17 +425,24 @@ pub struct ERU0 { } unsafe impl Send for ERU0 {} impl ERU0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const eru0::RegisterBlock = 0x5000_4800 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const eru0::RegisterBlock { - 0x5000_4800 as *const _ + Self::PTR } } impl Deref for ERU0 { type Target = eru0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*ERU0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for ERU0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("ERU0").finish() } } #[doc = "Event Request Unit 0"] @@ -440,17 +453,24 @@ pub struct ERU1 { } unsafe impl Send for ERU1 {} impl ERU1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const eru0::RegisterBlock = 0x4004_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const eru0::RegisterBlock { - 0x4004_4000 as *const _ + Self::PTR } } impl Deref for ERU1 { type Target = eru0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*ERU1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for ERU1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("ERU1").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -459,17 +479,24 @@ pub struct GPDMA0 { } unsafe impl Send for GPDMA0 {} impl GPDMA0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0::RegisterBlock = 0x5001_42c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0::RegisterBlock { - 0x5001_42c0 as *const _ + Self::PTR } } impl Deref for GPDMA0 { type Target = gpdma0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -480,17 +507,24 @@ pub struct GPDMA0_CH0 { } unsafe impl Send for GPDMA0_CH0 {} impl GPDMA0_CH0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch0::RegisterBlock = 0x5001_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch0::RegisterBlock { - 0x5001_4000 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH0 { type Target = gpdma0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH0").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -501,17 +535,24 @@ pub struct GPDMA0_CH1 { } unsafe impl Send for GPDMA0_CH1 {} impl GPDMA0_CH1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch0::RegisterBlock = 0x5001_4058 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch0::RegisterBlock { - 0x5001_4058 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH1 { type Target = gpdma0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH1").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -520,17 +561,24 @@ pub struct GPDMA0_CH2 { } unsafe impl Send for GPDMA0_CH2 {} impl GPDMA0_CH2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_40b0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_40b0 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH2 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH2").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -541,17 +589,24 @@ pub struct GPDMA0_CH3 { } unsafe impl Send for GPDMA0_CH3 {} impl GPDMA0_CH3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_4108 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_4108 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH3 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH3").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -560,17 +615,24 @@ pub struct GPDMA0_CH4 { } unsafe impl Send for GPDMA0_CH4 {} impl GPDMA0_CH4 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_4160 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_4160 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH4 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH4::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH4").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -579,17 +641,24 @@ pub struct GPDMA0_CH5 { } unsafe impl Send for GPDMA0_CH5 {} impl GPDMA0_CH5 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_41b8 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_41b8 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH5 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH5::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH5 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH5").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -598,17 +667,24 @@ pub struct GPDMA0_CH6 { } unsafe impl Send for GPDMA0_CH6 {} impl GPDMA0_CH6 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_4210 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_4210 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH6 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH6::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH6 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH6").finish() } } #[doc = "General Purpose DMA Unit 0"] @@ -617,17 +693,24 @@ pub struct GPDMA0_CH7 { } unsafe impl Send for GPDMA0_CH7 {} impl GPDMA0_CH7 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpdma0_ch2::RegisterBlock = 0x5001_4268 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { - 0x5001_4268 as *const _ + Self::PTR } } impl Deref for GPDMA0_CH7 { type Target = gpdma0_ch2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*GPDMA0_CH7::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPDMA0_CH7 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPDMA0_CH7").finish() } } #[doc = "Flexible CRC Engine"] @@ -636,17 +719,24 @@ pub struct FCE { } unsafe impl Send for FCE {} impl FCE { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const fce::RegisterBlock = 0x5002_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const fce::RegisterBlock { - 0x5002_0000 as *const _ + Self::PTR } } impl Deref for FCE { type Target = fce::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FCE::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FCE { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FCE").finish() } } #[doc = "Flexible CRC Engine"] @@ -657,17 +747,24 @@ pub struct FCE_KE0 { } unsafe impl Send for FCE_KE0 {} impl FCE_KE0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const fce_ke0::RegisterBlock = 0x5002_0020 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const fce_ke0::RegisterBlock { - 0x5002_0020 as *const _ + Self::PTR } } impl Deref for FCE_KE0 { type Target = fce_ke0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FCE_KE0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FCE_KE0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FCE_KE0").finish() } } #[doc = "Flexible CRC Engine"] @@ -678,17 +775,24 @@ pub struct FCE_KE1 { } unsafe impl Send for FCE_KE1 {} impl FCE_KE1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const fce_ke0::RegisterBlock = 0x5002_0040 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const fce_ke0::RegisterBlock { - 0x5002_0040 as *const _ + Self::PTR } } impl Deref for FCE_KE1 { type Target = fce_ke0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FCE_KE1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FCE_KE1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FCE_KE1").finish() } } #[doc = "Flexible CRC Engine"] @@ -697,17 +801,24 @@ pub struct FCE_KE2 { } unsafe impl Send for FCE_KE2 {} impl FCE_KE2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const fce_ke0::RegisterBlock = 0x5002_0060 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const fce_ke0::RegisterBlock { - 0x5002_0060 as *const _ + Self::PTR } } impl Deref for FCE_KE2 { type Target = fce_ke0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FCE_KE2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FCE_KE2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FCE_KE2").finish() } } #[doc = "Flexible CRC Engine"] @@ -716,17 +827,24 @@ pub struct FCE_KE3 { } unsafe impl Send for FCE_KE3 {} impl FCE_KE3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const fce_ke0::RegisterBlock = 0x5002_0080 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const fce_ke0::RegisterBlock { - 0x5002_0080 as *const _ + Self::PTR } } impl Deref for FCE_KE3 { type Target = fce_ke0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FCE_KE3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FCE_KE3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FCE_KE3").finish() } } #[doc = "Peripheral Bridge AHB 0"] @@ -735,17 +853,24 @@ pub struct PBA0 { } unsafe impl Send for PBA0 {} impl PBA0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const pba0::RegisterBlock = 0x4000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const pba0::RegisterBlock { - 0x4000_0000 as *const _ + Self::PTR } } impl Deref for PBA0 { type Target = pba0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PBA0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PBA0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PBA0").finish() } } #[doc = "Peripheral Bridge AHB 0"] @@ -756,17 +881,24 @@ pub struct PBA1 { } unsafe impl Send for PBA1 {} impl PBA1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const pba0::RegisterBlock = 0x4800_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const pba0::RegisterBlock { - 0x4800_0000 as *const _ + Self::PTR } } impl Deref for PBA1 { type Target = pba0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PBA1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PBA1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PBA1").finish() } } #[doc = "Flash Memory Controller"] @@ -775,17 +907,24 @@ pub struct FLASH0 { } unsafe impl Send for FLASH0 {} impl FLASH0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const flash0::RegisterBlock = 0x5800_1000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const flash0::RegisterBlock { - 0x5800_1000 as *const _ + Self::PTR } } impl Deref for FLASH0 { type Target = flash0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*FLASH0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FLASH0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FLASH0").finish() } } #[doc = "Flash Memory Controller"] @@ -796,17 +935,24 @@ pub struct PREF { } unsafe impl Send for PREF {} impl PREF { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const pref::RegisterBlock = 0x5800_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const pref::RegisterBlock { - 0x5800_4000 as *const _ + Self::PTR } } impl Deref for PREF { type Target = pref::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PREF::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PREF { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PREF").finish() } } #[doc = "Prefetch Unit"] @@ -817,17 +963,24 @@ pub struct PMU0 { } unsafe impl Send for PMU0 {} impl PMU0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const pmu0::RegisterBlock = 0x5800_0508 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const pmu0::RegisterBlock { - 0x5800_0508 as *const _ + Self::PTR } } impl Deref for PMU0 { type Target = pmu0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PMU0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PMU0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PMU0").finish() } } #[doc = "Program Management Unit"] @@ -838,17 +991,24 @@ pub struct WDT { } unsafe impl Send for WDT {} impl WDT { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const wdt::RegisterBlock = 0x5000_8000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const wdt::RegisterBlock { - 0x5000_8000 as *const _ + Self::PTR } } impl Deref for WDT { type Target = wdt::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*WDT::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for WDT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("WDT").finish() } } #[doc = "Watch Dog Timer"] @@ -859,17 +1019,24 @@ pub struct RTC { } unsafe impl Send for RTC {} impl RTC { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const rtc::RegisterBlock = 0x5000_4a00 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const rtc::RegisterBlock { - 0x5000_4a00 as *const _ + Self::PTR } } impl Deref for RTC { type Target = rtc::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*RTC::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RTC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RTC").finish() } } #[doc = "Real Time Clock"] @@ -880,17 +1047,24 @@ pub struct SCU_CLK { } unsafe impl Send for SCU_CLK {} impl SCU_CLK { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_clk::RegisterBlock = 0x5000_4600 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_clk::RegisterBlock { - 0x5000_4600 as *const _ + Self::PTR } } impl Deref for SCU_CLK { type Target = scu_clk::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_CLK::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_CLK { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_CLK").finish() } } #[doc = "System Control Unit"] @@ -901,17 +1075,24 @@ pub struct SCU_OSC { } unsafe impl Send for SCU_OSC {} impl SCU_OSC { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_osc::RegisterBlock = 0x5000_4700 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_osc::RegisterBlock { - 0x5000_4700 as *const _ + Self::PTR } } impl Deref for SCU_OSC { type Target = scu_osc::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_OSC::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_OSC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_OSC").finish() } } #[doc = "System Control Unit"] @@ -922,17 +1103,24 @@ pub struct SCU_PLL { } unsafe impl Send for SCU_PLL {} impl SCU_PLL { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_pll::RegisterBlock = 0x5000_4710 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_pll::RegisterBlock { - 0x5000_4710 as *const _ + Self::PTR } } impl Deref for SCU_PLL { type Target = scu_pll::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_PLL::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_PLL { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_PLL").finish() } } #[doc = "System Control Unit"] @@ -943,17 +1131,24 @@ pub struct SCU_GENERAL { } unsafe impl Send for SCU_GENERAL {} impl SCU_GENERAL { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_general::RegisterBlock = 0x5000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_general::RegisterBlock { - 0x5000_4000 as *const _ + Self::PTR } } impl Deref for SCU_GENERAL { type Target = scu_general::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_GENERAL::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_GENERAL { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_GENERAL").finish() } } #[doc = "System Control Unit"] @@ -964,17 +1159,24 @@ pub struct SCU_INTERRUPT { } unsafe impl Send for SCU_INTERRUPT {} impl SCU_INTERRUPT { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_interrupt::RegisterBlock = 0x5000_4074 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_interrupt::RegisterBlock { - 0x5000_4074 as *const _ + Self::PTR } } impl Deref for SCU_INTERRUPT { type Target = scu_interrupt::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_INTERRUPT::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_INTERRUPT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_INTERRUPT").finish() } } #[doc = "System Control Unit"] @@ -985,17 +1187,24 @@ pub struct SCU_PARITY { } unsafe impl Send for SCU_PARITY {} impl SCU_PARITY { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_parity::RegisterBlock = 0x5000_413c as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_parity::RegisterBlock { - 0x5000_413c as *const _ + Self::PTR } } impl Deref for SCU_PARITY { type Target = scu_parity::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_PARITY::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_PARITY { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_PARITY").finish() } } #[doc = "System Control Unit"] @@ -1006,17 +1215,24 @@ pub struct SCU_TRAP { } unsafe impl Send for SCU_TRAP {} impl SCU_TRAP { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_trap::RegisterBlock = 0x5000_4160 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_trap::RegisterBlock { - 0x5000_4160 as *const _ + Self::PTR } } impl Deref for SCU_TRAP { type Target = scu_trap::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_TRAP::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_TRAP { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_TRAP").finish() } } #[doc = "System Control Unit"] @@ -1027,17 +1243,24 @@ pub struct SCU_HIBERNATE { } unsafe impl Send for SCU_HIBERNATE {} impl SCU_HIBERNATE { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_hibernate::RegisterBlock = 0x5000_4300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_hibernate::RegisterBlock { - 0x5000_4300 as *const _ + Self::PTR } } impl Deref for SCU_HIBERNATE { type Target = scu_hibernate::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_HIBERNATE::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_HIBERNATE { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_HIBERNATE").finish() } } #[doc = "System Control Unit"] @@ -1048,17 +1271,24 @@ pub struct SCU_POWER { } unsafe impl Send for SCU_POWER {} impl SCU_POWER { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_power::RegisterBlock = 0x5000_4200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_power::RegisterBlock { - 0x5000_4200 as *const _ + Self::PTR } } impl Deref for SCU_POWER { type Target = scu_power::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_POWER::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_POWER { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_POWER").finish() } } #[doc = "System Control Unit"] @@ -1069,17 +1299,24 @@ pub struct SCU_RESET { } unsafe impl Send for SCU_RESET {} impl SCU_RESET { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const scu_reset::RegisterBlock = 0x5000_4400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const scu_reset::RegisterBlock { - 0x5000_4400 as *const _ + Self::PTR } } impl Deref for SCU_RESET { type Target = scu_reset::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*SCU_RESET::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SCU_RESET { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SCU_RESET").finish() } } #[doc = "System Control Unit"] @@ -1090,17 +1327,24 @@ pub struct LEDTS0 { } unsafe impl Send for LEDTS0 {} impl LEDTS0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ledts0::RegisterBlock = 0x4801_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ledts0::RegisterBlock { - 0x4801_0000 as *const _ + Self::PTR } } impl Deref for LEDTS0 { type Target = ledts0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*LEDTS0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for LEDTS0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("LEDTS0").finish() } } #[doc = "LED and Touch Sense Unit 0"] @@ -1111,17 +1355,24 @@ pub struct USB0 { } unsafe impl Send for USB0 {} impl USB0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0::RegisterBlock = 0x5004_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0::RegisterBlock { - 0x5004_0000 as *const _ + Self::PTR } } impl Deref for USB0 { type Target = usb0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0").finish() } } #[doc = "Universal Serial Bus"] @@ -1132,17 +1383,24 @@ pub struct USB0_EP0 { } unsafe impl Send for USB0_EP0 {} impl USB0_EP0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep0::RegisterBlock = 0x5004_0900 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep0::RegisterBlock { - 0x5004_0900 as *const _ + Self::PTR } } impl Deref for USB0_EP0 { type Target = usb0_ep0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP0").finish() } } #[doc = "Universal Serial Bus"] @@ -1153,17 +1411,24 @@ pub struct USB0_EP1 { } unsafe impl Send for USB0_EP1 {} impl USB0_EP1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_0920 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_0920 as *const _ + Self::PTR } } impl Deref for USB0_EP1 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP1").finish() } } #[doc = "Universal Serial Bus"] @@ -1174,17 +1439,24 @@ pub struct USB0_EP2 { } unsafe impl Send for USB0_EP2 {} impl USB0_EP2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_0940 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_0940 as *const _ + Self::PTR } } impl Deref for USB0_EP2 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP2").finish() } } #[doc = "Universal Serial Bus"] @@ -1193,17 +1465,24 @@ pub struct USB0_EP3 { } unsafe impl Send for USB0_EP3 {} impl USB0_EP3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_0960 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_0960 as *const _ + Self::PTR } } impl Deref for USB0_EP3 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP3").finish() } } #[doc = "Universal Serial Bus"] @@ -1212,17 +1491,24 @@ pub struct USB0_EP4 { } unsafe impl Send for USB0_EP4 {} impl USB0_EP4 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_0980 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_0980 as *const _ + Self::PTR } } impl Deref for USB0_EP4 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP4::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP4").finish() } } #[doc = "Universal Serial Bus"] @@ -1231,17 +1517,24 @@ pub struct USB0_EP5 { } unsafe impl Send for USB0_EP5 {} impl USB0_EP5 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_09a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_09a0 as *const _ + Self::PTR } } impl Deref for USB0_EP5 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP5::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP5 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP5").finish() } } #[doc = "Universal Serial Bus"] @@ -1250,17 +1543,24 @@ pub struct USB0_EP6 { } unsafe impl Send for USB0_EP6 {} impl USB0_EP6 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usb0_ep1::RegisterBlock = 0x5004_09c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usb0_ep1::RegisterBlock { - 0x5004_09c0 as *const _ + Self::PTR } } impl Deref for USB0_EP6 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USB0_EP6::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USB0_EP6 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USB0_EP6").finish() } } #[doc = "Universal Serial Interface Controller 0"] @@ -1269,17 +1569,24 @@ pub struct USIC0 { } unsafe impl Send for USIC0 {} impl USIC0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0::RegisterBlock = 0x4003_0008 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0::RegisterBlock { - 0x4003_0008 as *const _ + Self::PTR } } impl Deref for USIC0 { type Target = usic0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC0").finish() } } #[doc = "Universal Serial Interface Controller 0"] @@ -1290,17 +1597,24 @@ pub struct USIC1 { } unsafe impl Send for USIC1 {} impl USIC1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0::RegisterBlock = 0x4802_0008 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0::RegisterBlock { - 0x4802_0008 as *const _ + Self::PTR } } impl Deref for USIC1 { type Target = usic0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC1").finish() } } #[doc = "Universal Serial Interface Controller 0"] @@ -1309,17 +1623,24 @@ pub struct USIC0_CH0 { } unsafe impl Send for USIC0_CH0 {} impl USIC0_CH0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0_ch0::RegisterBlock = 0x4003_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0_ch0::RegisterBlock { - 0x4003_0000 as *const _ + Self::PTR } } impl Deref for USIC0_CH0 { type Target = usic0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC0_CH0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC0_CH0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC0_CH0").finish() } } #[doc = "Universal Serial Interface Controller 0"] @@ -1330,17 +1651,24 @@ pub struct USIC0_CH1 { } unsafe impl Send for USIC0_CH1 {} impl USIC0_CH1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0_ch0::RegisterBlock = 0x4003_0200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0_ch0::RegisterBlock { - 0x4003_0200 as *const _ + Self::PTR } } impl Deref for USIC0_CH1 { type Target = usic0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC0_CH1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC0_CH1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC0_CH1").finish() } } #[doc = "Universal Serial Interface Controller 1"] @@ -1349,17 +1677,24 @@ pub struct USIC1_CH0 { } unsafe impl Send for USIC1_CH0 {} impl USIC1_CH0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0_ch0::RegisterBlock = 0x4802_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0_ch0::RegisterBlock { - 0x4802_0000 as *const _ + Self::PTR } } impl Deref for USIC1_CH0 { type Target = usic0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC1_CH0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC1_CH0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC1_CH0").finish() } } #[doc = "Universal Serial Interface Controller 1"] @@ -1368,17 +1703,24 @@ pub struct USIC1_CH1 { } unsafe impl Send for USIC1_CH1 {} impl USIC1_CH1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const usic0_ch0::RegisterBlock = 0x4802_0200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const usic0_ch0::RegisterBlock { - 0x4802_0200 as *const _ + Self::PTR } } impl Deref for USIC1_CH1 { type Target = usic0_ch0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*USIC1_CH1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for USIC1_CH1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("USIC1_CH1").finish() } } #[doc = "Controller Area Networks"] @@ -1387,17 +1729,24 @@ pub struct CAN { } unsafe impl Send for CAN {} impl CAN { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can::RegisterBlock = 0x4801_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can::RegisterBlock { - 0x4801_4000 as *const _ + Self::PTR } } impl Deref for CAN { type Target = can::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN").finish() } } #[doc = "Controller Area Networks"] @@ -1408,17 +1757,24 @@ pub struct CAN_NODE0 { } unsafe impl Send for CAN_NODE0 {} impl CAN_NODE0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_node0::RegisterBlock = 0x4801_4200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_node0::RegisterBlock { - 0x4801_4200 as *const _ + Self::PTR } } impl Deref for CAN_NODE0 { type Target = can_node0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_NODE0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_NODE0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_NODE0").finish() } } #[doc = "Controller Area Networks"] @@ -1429,17 +1785,24 @@ pub struct CAN_NODE1 { } unsafe impl Send for CAN_NODE1 {} impl CAN_NODE1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_node0::RegisterBlock = 0x4801_4300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_node0::RegisterBlock { - 0x4801_4300 as *const _ + Self::PTR } } impl Deref for CAN_NODE1 { type Target = can_node0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_NODE1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_NODE1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_NODE1").finish() } } #[doc = "Controller Area Networks"] @@ -1448,17 +1811,24 @@ pub struct CAN_MO0 { } unsafe impl Send for CAN_MO0 {} impl CAN_MO0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5000 as *const _ + Self::PTR } } impl Deref for CAN_MO0 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO0").finish() } } #[doc = "Controller Area Networks"] @@ -1469,17 +1839,24 @@ pub struct CAN_MO1 { } unsafe impl Send for CAN_MO1 {} impl CAN_MO1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5020 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5020 as *const _ + Self::PTR } } impl Deref for CAN_MO1 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO1").finish() } } #[doc = "Controller Area Networks"] @@ -1488,17 +1865,24 @@ pub struct CAN_MO2 { } unsafe impl Send for CAN_MO2 {} impl CAN_MO2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5040 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5040 as *const _ + Self::PTR } } impl Deref for CAN_MO2 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO2").finish() } } #[doc = "Controller Area Networks"] @@ -1507,17 +1891,24 @@ pub struct CAN_MO3 { } unsafe impl Send for CAN_MO3 {} impl CAN_MO3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5060 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5060 as *const _ + Self::PTR } } impl Deref for CAN_MO3 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO3").finish() } } #[doc = "Controller Area Networks"] @@ -1526,17 +1917,24 @@ pub struct CAN_MO4 { } unsafe impl Send for CAN_MO4 {} impl CAN_MO4 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5080 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5080 as *const _ + Self::PTR } } impl Deref for CAN_MO4 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO4::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO4").finish() } } #[doc = "Controller Area Networks"] @@ -1545,17 +1943,24 @@ pub struct CAN_MO5 { } unsafe impl Send for CAN_MO5 {} impl CAN_MO5 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_50a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_50a0 as *const _ + Self::PTR } } impl Deref for CAN_MO5 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO5::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO5 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO5").finish() } } #[doc = "Controller Area Networks"] @@ -1564,17 +1969,24 @@ pub struct CAN_MO6 { } unsafe impl Send for CAN_MO6 {} impl CAN_MO6 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_50c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_50c0 as *const _ + Self::PTR } } impl Deref for CAN_MO6 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO6::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO6 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO6").finish() } } #[doc = "Controller Area Networks"] @@ -1583,17 +1995,24 @@ pub struct CAN_MO7 { } unsafe impl Send for CAN_MO7 {} impl CAN_MO7 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_50e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_50e0 as *const _ + Self::PTR } } impl Deref for CAN_MO7 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO7::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO7 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO7").finish() } } #[doc = "Controller Area Networks"] @@ -1602,17 +2021,24 @@ pub struct CAN_MO8 { } unsafe impl Send for CAN_MO8 {} impl CAN_MO8 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5100 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5100 as *const _ + Self::PTR } } impl Deref for CAN_MO8 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO8::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO8 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO8").finish() } } #[doc = "Controller Area Networks"] @@ -1621,17 +2047,24 @@ pub struct CAN_MO9 { } unsafe impl Send for CAN_MO9 {} impl CAN_MO9 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5120 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5120 as *const _ + Self::PTR } } impl Deref for CAN_MO9 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO9::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO9 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO9").finish() } } #[doc = "Controller Area Networks"] @@ -1640,17 +2073,24 @@ pub struct CAN_MO10 { } unsafe impl Send for CAN_MO10 {} impl CAN_MO10 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5140 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5140 as *const _ + Self::PTR } } impl Deref for CAN_MO10 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO10::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO10 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO10").finish() } } #[doc = "Controller Area Networks"] @@ -1659,17 +2099,24 @@ pub struct CAN_MO11 { } unsafe impl Send for CAN_MO11 {} impl CAN_MO11 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5160 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5160 as *const _ + Self::PTR } } impl Deref for CAN_MO11 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO11::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO11 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO11").finish() } } #[doc = "Controller Area Networks"] @@ -1678,17 +2125,24 @@ pub struct CAN_MO12 { } unsafe impl Send for CAN_MO12 {} impl CAN_MO12 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5180 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5180 as *const _ + Self::PTR } } impl Deref for CAN_MO12 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO12::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO12 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO12").finish() } } #[doc = "Controller Area Networks"] @@ -1697,17 +2151,24 @@ pub struct CAN_MO13 { } unsafe impl Send for CAN_MO13 {} impl CAN_MO13 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_51a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_51a0 as *const _ + Self::PTR } } impl Deref for CAN_MO13 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO13::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO13 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO13").finish() } } #[doc = "Controller Area Networks"] @@ -1716,17 +2177,24 @@ pub struct CAN_MO14 { } unsafe impl Send for CAN_MO14 {} impl CAN_MO14 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_51c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_51c0 as *const _ + Self::PTR } } impl Deref for CAN_MO14 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO14::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO14 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO14").finish() } } #[doc = "Controller Area Networks"] @@ -1735,17 +2203,24 @@ pub struct CAN_MO15 { } unsafe impl Send for CAN_MO15 {} impl CAN_MO15 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_51e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_51e0 as *const _ + Self::PTR } } impl Deref for CAN_MO15 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO15::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO15 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO15").finish() } } #[doc = "Controller Area Networks"] @@ -1754,17 +2229,24 @@ pub struct CAN_MO16 { } unsafe impl Send for CAN_MO16 {} impl CAN_MO16 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5200 as *const _ + Self::PTR } } impl Deref for CAN_MO16 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO16::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO16 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO16").finish() } } #[doc = "Controller Area Networks"] @@ -1773,17 +2255,24 @@ pub struct CAN_MO17 { } unsafe impl Send for CAN_MO17 {} impl CAN_MO17 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5220 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5220 as *const _ + Self::PTR } } impl Deref for CAN_MO17 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO17::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO17 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO17").finish() } } #[doc = "Controller Area Networks"] @@ -1792,17 +2281,24 @@ pub struct CAN_MO18 { } unsafe impl Send for CAN_MO18 {} impl CAN_MO18 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5240 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5240 as *const _ + Self::PTR } } impl Deref for CAN_MO18 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO18::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO18 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO18").finish() } } #[doc = "Controller Area Networks"] @@ -1811,17 +2307,24 @@ pub struct CAN_MO19 { } unsafe impl Send for CAN_MO19 {} impl CAN_MO19 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5260 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5260 as *const _ + Self::PTR } } impl Deref for CAN_MO19 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO19::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO19 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO19").finish() } } #[doc = "Controller Area Networks"] @@ -1830,17 +2333,24 @@ pub struct CAN_MO20 { } unsafe impl Send for CAN_MO20 {} impl CAN_MO20 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5280 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5280 as *const _ + Self::PTR } } impl Deref for CAN_MO20 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO20::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO20 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO20").finish() } } #[doc = "Controller Area Networks"] @@ -1849,17 +2359,24 @@ pub struct CAN_MO21 { } unsafe impl Send for CAN_MO21 {} impl CAN_MO21 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_52a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_52a0 as *const _ + Self::PTR } } impl Deref for CAN_MO21 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO21::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO21 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO21").finish() } } #[doc = "Controller Area Networks"] @@ -1868,17 +2385,24 @@ pub struct CAN_MO22 { } unsafe impl Send for CAN_MO22 {} impl CAN_MO22 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_52c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_52c0 as *const _ + Self::PTR } } impl Deref for CAN_MO22 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO22::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO22 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO22").finish() } } #[doc = "Controller Area Networks"] @@ -1887,17 +2411,24 @@ pub struct CAN_MO23 { } unsafe impl Send for CAN_MO23 {} impl CAN_MO23 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_52e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_52e0 as *const _ + Self::PTR } } impl Deref for CAN_MO23 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO23::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO23 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO23").finish() } } #[doc = "Controller Area Networks"] @@ -1906,17 +2437,24 @@ pub struct CAN_MO24 { } unsafe impl Send for CAN_MO24 {} impl CAN_MO24 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5300 as *const _ + Self::PTR } } impl Deref for CAN_MO24 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO24::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO24 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO24").finish() } } #[doc = "Controller Area Networks"] @@ -1925,17 +2463,24 @@ pub struct CAN_MO25 { } unsafe impl Send for CAN_MO25 {} impl CAN_MO25 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5320 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5320 as *const _ + Self::PTR } } impl Deref for CAN_MO25 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO25::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO25 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO25").finish() } } #[doc = "Controller Area Networks"] @@ -1944,17 +2489,24 @@ pub struct CAN_MO26 { } unsafe impl Send for CAN_MO26 {} impl CAN_MO26 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5340 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5340 as *const _ + Self::PTR } } impl Deref for CAN_MO26 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO26::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO26 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO26").finish() } } #[doc = "Controller Area Networks"] @@ -1963,17 +2515,24 @@ pub struct CAN_MO27 { } unsafe impl Send for CAN_MO27 {} impl CAN_MO27 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5360 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5360 as *const _ + Self::PTR } } impl Deref for CAN_MO27 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO27::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO27 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO27").finish() } } #[doc = "Controller Area Networks"] @@ -1982,17 +2541,24 @@ pub struct CAN_MO28 { } unsafe impl Send for CAN_MO28 {} impl CAN_MO28 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5380 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5380 as *const _ + Self::PTR } } impl Deref for CAN_MO28 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO28::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO28 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO28").finish() } } #[doc = "Controller Area Networks"] @@ -2001,17 +2567,24 @@ pub struct CAN_MO29 { } unsafe impl Send for CAN_MO29 {} impl CAN_MO29 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_53a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_53a0 as *const _ + Self::PTR } } impl Deref for CAN_MO29 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO29::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO29 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO29").finish() } } #[doc = "Controller Area Networks"] @@ -2020,17 +2593,24 @@ pub struct CAN_MO30 { } unsafe impl Send for CAN_MO30 {} impl CAN_MO30 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_53c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_53c0 as *const _ + Self::PTR } } impl Deref for CAN_MO30 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO30::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO30 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO30").finish() } } #[doc = "Controller Area Networks"] @@ -2039,17 +2619,24 @@ pub struct CAN_MO31 { } unsafe impl Send for CAN_MO31 {} impl CAN_MO31 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_53e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_53e0 as *const _ + Self::PTR } } impl Deref for CAN_MO31 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO31::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO31 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO31").finish() } } #[doc = "Controller Area Networks"] @@ -2058,17 +2645,24 @@ pub struct CAN_MO32 { } unsafe impl Send for CAN_MO32 {} impl CAN_MO32 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5400 as *const _ + Self::PTR } } impl Deref for CAN_MO32 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO32::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO32 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO32").finish() } } #[doc = "Controller Area Networks"] @@ -2077,17 +2671,24 @@ pub struct CAN_MO33 { } unsafe impl Send for CAN_MO33 {} impl CAN_MO33 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5420 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5420 as *const _ + Self::PTR } } impl Deref for CAN_MO33 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO33::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO33 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO33").finish() } } #[doc = "Controller Area Networks"] @@ -2096,17 +2697,24 @@ pub struct CAN_MO34 { } unsafe impl Send for CAN_MO34 {} impl CAN_MO34 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5440 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5440 as *const _ + Self::PTR } } impl Deref for CAN_MO34 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO34::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO34 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO34").finish() } } #[doc = "Controller Area Networks"] @@ -2115,17 +2723,24 @@ pub struct CAN_MO35 { } unsafe impl Send for CAN_MO35 {} impl CAN_MO35 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5460 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5460 as *const _ + Self::PTR } } impl Deref for CAN_MO35 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO35::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO35 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO35").finish() } } #[doc = "Controller Area Networks"] @@ -2134,17 +2749,24 @@ pub struct CAN_MO36 { } unsafe impl Send for CAN_MO36 {} impl CAN_MO36 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5480 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5480 as *const _ + Self::PTR } } impl Deref for CAN_MO36 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO36::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO36 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO36").finish() } } #[doc = "Controller Area Networks"] @@ -2153,17 +2775,24 @@ pub struct CAN_MO37 { } unsafe impl Send for CAN_MO37 {} impl CAN_MO37 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_54a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_54a0 as *const _ + Self::PTR } } impl Deref for CAN_MO37 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO37::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO37 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO37").finish() } } #[doc = "Controller Area Networks"] @@ -2172,17 +2801,24 @@ pub struct CAN_MO38 { } unsafe impl Send for CAN_MO38 {} impl CAN_MO38 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_54c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_54c0 as *const _ + Self::PTR } } impl Deref for CAN_MO38 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO38::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO38 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO38").finish() } } #[doc = "Controller Area Networks"] @@ -2191,17 +2827,24 @@ pub struct CAN_MO39 { } unsafe impl Send for CAN_MO39 {} impl CAN_MO39 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_54e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_54e0 as *const _ + Self::PTR } } impl Deref for CAN_MO39 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO39::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO39 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO39").finish() } } #[doc = "Controller Area Networks"] @@ -2210,17 +2853,24 @@ pub struct CAN_MO40 { } unsafe impl Send for CAN_MO40 {} impl CAN_MO40 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5500 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5500 as *const _ + Self::PTR } } impl Deref for CAN_MO40 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO40::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO40 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO40").finish() } } #[doc = "Controller Area Networks"] @@ -2229,17 +2879,24 @@ pub struct CAN_MO41 { } unsafe impl Send for CAN_MO41 {} impl CAN_MO41 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5520 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5520 as *const _ + Self::PTR } } impl Deref for CAN_MO41 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO41::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO41 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO41").finish() } } #[doc = "Controller Area Networks"] @@ -2248,17 +2905,24 @@ pub struct CAN_MO42 { } unsafe impl Send for CAN_MO42 {} impl CAN_MO42 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5540 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5540 as *const _ + Self::PTR } } impl Deref for CAN_MO42 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO42::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO42 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO42").finish() } } #[doc = "Controller Area Networks"] @@ -2267,17 +2931,24 @@ pub struct CAN_MO43 { } unsafe impl Send for CAN_MO43 {} impl CAN_MO43 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5560 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5560 as *const _ + Self::PTR } } impl Deref for CAN_MO43 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO43::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO43 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO43").finish() } } #[doc = "Controller Area Networks"] @@ -2286,17 +2957,24 @@ pub struct CAN_MO44 { } unsafe impl Send for CAN_MO44 {} impl CAN_MO44 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5580 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5580 as *const _ + Self::PTR } } impl Deref for CAN_MO44 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO44::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO44 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO44").finish() } } #[doc = "Controller Area Networks"] @@ -2305,17 +2983,24 @@ pub struct CAN_MO45 { } unsafe impl Send for CAN_MO45 {} impl CAN_MO45 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_55a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_55a0 as *const _ + Self::PTR } } impl Deref for CAN_MO45 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO45::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO45 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO45").finish() } } #[doc = "Controller Area Networks"] @@ -2324,17 +3009,24 @@ pub struct CAN_MO46 { } unsafe impl Send for CAN_MO46 {} impl CAN_MO46 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_55c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_55c0 as *const _ + Self::PTR } } impl Deref for CAN_MO46 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO46::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO46 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO46").finish() } } #[doc = "Controller Area Networks"] @@ -2343,17 +3035,24 @@ pub struct CAN_MO47 { } unsafe impl Send for CAN_MO47 {} impl CAN_MO47 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_55e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_55e0 as *const _ + Self::PTR } } impl Deref for CAN_MO47 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO47::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO47 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO47").finish() } } #[doc = "Controller Area Networks"] @@ -2362,17 +3061,24 @@ pub struct CAN_MO48 { } unsafe impl Send for CAN_MO48 {} impl CAN_MO48 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5600 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5600 as *const _ + Self::PTR } } impl Deref for CAN_MO48 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO48::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO48 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO48").finish() } } #[doc = "Controller Area Networks"] @@ -2381,17 +3087,24 @@ pub struct CAN_MO49 { } unsafe impl Send for CAN_MO49 {} impl CAN_MO49 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5620 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5620 as *const _ + Self::PTR } } impl Deref for CAN_MO49 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO49::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO49 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO49").finish() } } #[doc = "Controller Area Networks"] @@ -2400,17 +3113,24 @@ pub struct CAN_MO50 { } unsafe impl Send for CAN_MO50 {} impl CAN_MO50 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5640 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5640 as *const _ + Self::PTR } } impl Deref for CAN_MO50 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO50::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO50 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO50").finish() } } #[doc = "Controller Area Networks"] @@ -2419,17 +3139,24 @@ pub struct CAN_MO51 { } unsafe impl Send for CAN_MO51 {} impl CAN_MO51 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5660 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5660 as *const _ + Self::PTR } } impl Deref for CAN_MO51 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO51::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO51 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO51").finish() } } #[doc = "Controller Area Networks"] @@ -2438,17 +3165,24 @@ pub struct CAN_MO52 { } unsafe impl Send for CAN_MO52 {} impl CAN_MO52 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5680 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5680 as *const _ + Self::PTR } } impl Deref for CAN_MO52 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO52::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO52 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO52").finish() } } #[doc = "Controller Area Networks"] @@ -2457,17 +3191,24 @@ pub struct CAN_MO53 { } unsafe impl Send for CAN_MO53 {} impl CAN_MO53 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_56a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_56a0 as *const _ + Self::PTR } } impl Deref for CAN_MO53 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO53::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO53 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO53").finish() } } #[doc = "Controller Area Networks"] @@ -2476,17 +3217,24 @@ pub struct CAN_MO54 { } unsafe impl Send for CAN_MO54 {} impl CAN_MO54 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_56c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_56c0 as *const _ + Self::PTR } } impl Deref for CAN_MO54 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO54::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO54 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO54").finish() } } #[doc = "Controller Area Networks"] @@ -2495,17 +3243,24 @@ pub struct CAN_MO55 { } unsafe impl Send for CAN_MO55 {} impl CAN_MO55 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_56e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_56e0 as *const _ + Self::PTR } } impl Deref for CAN_MO55 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO55::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO55 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO55").finish() } } #[doc = "Controller Area Networks"] @@ -2514,17 +3269,24 @@ pub struct CAN_MO56 { } unsafe impl Send for CAN_MO56 {} impl CAN_MO56 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5700 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5700 as *const _ + Self::PTR } } impl Deref for CAN_MO56 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO56::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO56 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO56").finish() } } #[doc = "Controller Area Networks"] @@ -2533,17 +3295,24 @@ pub struct CAN_MO57 { } unsafe impl Send for CAN_MO57 {} impl CAN_MO57 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5720 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5720 as *const _ + Self::PTR } } impl Deref for CAN_MO57 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO57::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO57 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO57").finish() } } #[doc = "Controller Area Networks"] @@ -2552,17 +3321,24 @@ pub struct CAN_MO58 { } unsafe impl Send for CAN_MO58 {} impl CAN_MO58 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5740 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5740 as *const _ + Self::PTR } } impl Deref for CAN_MO58 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO58::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO58 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO58").finish() } } #[doc = "Controller Area Networks"] @@ -2571,17 +3347,24 @@ pub struct CAN_MO59 { } unsafe impl Send for CAN_MO59 {} impl CAN_MO59 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5760 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5760 as *const _ + Self::PTR } } impl Deref for CAN_MO59 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO59::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO59 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO59").finish() } } #[doc = "Controller Area Networks"] @@ -2590,17 +3373,24 @@ pub struct CAN_MO60 { } unsafe impl Send for CAN_MO60 {} impl CAN_MO60 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_5780 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_5780 as *const _ + Self::PTR } } impl Deref for CAN_MO60 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO60::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO60 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO60").finish() } } #[doc = "Controller Area Networks"] @@ -2609,17 +3399,24 @@ pub struct CAN_MO61 { } unsafe impl Send for CAN_MO61 {} impl CAN_MO61 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_57a0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_57a0 as *const _ + Self::PTR } } impl Deref for CAN_MO61 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO61::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO61 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO61").finish() } } #[doc = "Controller Area Networks"] @@ -2628,17 +3425,24 @@ pub struct CAN_MO62 { } unsafe impl Send for CAN_MO62 {} impl CAN_MO62 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_57c0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_57c0 as *const _ + Self::PTR } } impl Deref for CAN_MO62 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO62::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO62 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO62").finish() } } #[doc = "Controller Area Networks"] @@ -2647,17 +3451,24 @@ pub struct CAN_MO63 { } unsafe impl Send for CAN_MO63 {} impl CAN_MO63 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const can_mo0::RegisterBlock = 0x4801_57e0 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const can_mo0::RegisterBlock { - 0x4801_57e0 as *const _ + Self::PTR } } impl Deref for CAN_MO63 { type Target = can_mo0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CAN_MO63::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CAN_MO63 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CAN_MO63").finish() } } #[doc = "Analog to Digital Converter"] @@ -2666,17 +3477,24 @@ pub struct VADC { } unsafe impl Send for VADC {} impl VADC { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const vadc::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const vadc::RegisterBlock { - 0x4000_4000 as *const _ + Self::PTR } } impl Deref for VADC { type Target = vadc::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*VADC::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for VADC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("VADC").finish() } } #[doc = "Analog to Digital Converter"] @@ -2687,17 +3505,24 @@ pub struct VADC_G0 { } unsafe impl Send for VADC_G0 {} impl VADC_G0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const vadc_g0::RegisterBlock = 0x4000_4400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const vadc_g0::RegisterBlock { - 0x4000_4400 as *const _ + Self::PTR } } impl Deref for VADC_G0 { type Target = vadc_g0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*VADC_G0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for VADC_G0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("VADC_G0").finish() } } #[doc = "Analog to Digital Converter"] @@ -2708,17 +3533,24 @@ pub struct VADC_G1 { } unsafe impl Send for VADC_G1 {} impl VADC_G1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const vadc_g0::RegisterBlock = 0x4000_4800 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const vadc_g0::RegisterBlock { - 0x4000_4800 as *const _ + Self::PTR } } impl Deref for VADC_G1 { type Target = vadc_g0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*VADC_G1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for VADC_G1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("VADC_G1").finish() } } #[doc = "Digital to Analog Converter"] @@ -2727,17 +3559,24 @@ pub struct DAC { } unsafe impl Send for DAC {} impl DAC { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const dac::RegisterBlock = 0x4801_8000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const dac::RegisterBlock { - 0x4801_8000 as *const _ + Self::PTR } } impl Deref for DAC { type Target = dac::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*DAC::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for DAC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("DAC").finish() } } #[doc = "Digital to Analog Converter"] @@ -2748,17 +3587,24 @@ pub struct CCU40 { } unsafe impl Send for CCU40 {} impl CCU40 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40::RegisterBlock = 0x4000_c000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40::RegisterBlock { - 0x4000_c000 as *const _ + Self::PTR } } impl Deref for CCU40 { type Target = ccu40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU40::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU40 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU40").finish() } } #[doc = "Capture Compare Unit 4 - Unit 0"] @@ -2769,17 +3615,24 @@ pub struct CCU41 { } unsafe impl Send for CCU41 {} impl CCU41 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40::RegisterBlock = 0x4001_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40::RegisterBlock { - 0x4001_0000 as *const _ + Self::PTR } } impl Deref for CCU41 { type Target = ccu40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU41::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU41 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU41").finish() } } #[doc = "Capture Compare Unit 4 - Unit 0"] @@ -2788,17 +3641,24 @@ pub struct CCU40_CC40 { } unsafe impl Send for CCU40_CC40 {} impl CCU40_CC40 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4000_c100 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4000_c100 as *const _ + Self::PTR } } impl Deref for CCU40_CC40 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU40_CC40::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU40_CC40 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU40_CC40").finish() } } #[doc = "Capture Compare Unit 4 - Unit 0"] @@ -2809,17 +3669,24 @@ pub struct CCU40_CC41 { } unsafe impl Send for CCU40_CC41 {} impl CCU40_CC41 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4000_c200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4000_c200 as *const _ + Self::PTR } } impl Deref for CCU40_CC41 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU40_CC41::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU40_CC41 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU40_CC41").finish() } } #[doc = "Capture Compare Unit 4 - Unit 0"] @@ -2828,17 +3695,24 @@ pub struct CCU40_CC42 { } unsafe impl Send for CCU40_CC42 {} impl CCU40_CC42 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4000_c300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4000_c300 as *const _ + Self::PTR } } impl Deref for CCU40_CC42 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU40_CC42::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU40_CC42 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU40_CC42").finish() } } #[doc = "Capture Compare Unit 4 - Unit 0"] @@ -2847,17 +3721,24 @@ pub struct CCU40_CC43 { } unsafe impl Send for CCU40_CC43 {} impl CCU40_CC43 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4000_c400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4000_c400 as *const _ + Self::PTR } } impl Deref for CCU40_CC43 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU40_CC43::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU40_CC43 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU40_CC43").finish() } } #[doc = "Capture Compare Unit 4 - Unit 1"] @@ -2866,17 +3747,24 @@ pub struct CCU41_CC40 { } unsafe impl Send for CCU41_CC40 {} impl CCU41_CC40 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4001_0100 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4001_0100 as *const _ + Self::PTR } } impl Deref for CCU41_CC40 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU41_CC40::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU41_CC40 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU41_CC40").finish() } } #[doc = "Capture Compare Unit 4 - Unit 1"] @@ -2885,17 +3773,24 @@ pub struct CCU41_CC41 { } unsafe impl Send for CCU41_CC41 {} impl CCU41_CC41 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4001_0200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4001_0200 as *const _ + Self::PTR } } impl Deref for CCU41_CC41 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU41_CC41::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU41_CC41 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU41_CC41").finish() } } #[doc = "Capture Compare Unit 4 - Unit 1"] @@ -2904,17 +3799,24 @@ pub struct CCU41_CC42 { } unsafe impl Send for CCU41_CC42 {} impl CCU41_CC42 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4001_0300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4001_0300 as *const _ + Self::PTR } } impl Deref for CCU41_CC42 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU41_CC42::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU41_CC42 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU41_CC42").finish() } } #[doc = "Capture Compare Unit 4 - Unit 1"] @@ -2923,17 +3825,24 @@ pub struct CCU41_CC43 { } unsafe impl Send for CCU41_CC43 {} impl CCU41_CC43 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu40_cc40::RegisterBlock = 0x4001_0400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { - 0x4001_0400 as *const _ + Self::PTR } } impl Deref for CCU41_CC43 { type Target = ccu40_cc40::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU41_CC43::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU41_CC43 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU41_CC43").finish() } } #[doc = "Capture Compare Unit 8 - Unit 0"] @@ -2942,17 +3851,24 @@ pub struct CCU80 { } unsafe impl Send for CCU80 {} impl CCU80 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu80::RegisterBlock = 0x4002_0000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu80::RegisterBlock { - 0x4002_0000 as *const _ + Self::PTR } } impl Deref for CCU80 { type Target = ccu80::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU80::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU80 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU80").finish() } } #[doc = "Capture Compare Unit 8 - Unit 0"] @@ -2963,17 +3879,24 @@ pub struct CCU80_CC80 { } unsafe impl Send for CCU80_CC80 {} impl CCU80_CC80 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu80_cc80::RegisterBlock = 0x4002_0100 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { - 0x4002_0100 as *const _ + Self::PTR } } impl Deref for CCU80_CC80 { type Target = ccu80_cc80::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU80_CC80::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU80_CC80 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU80_CC80").finish() } } #[doc = "Capture Compare Unit 8 - Unit 0"] @@ -2984,17 +3907,24 @@ pub struct CCU80_CC81 { } unsafe impl Send for CCU80_CC81 {} impl CCU80_CC81 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu80_cc80::RegisterBlock = 0x4002_0200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { - 0x4002_0200 as *const _ + Self::PTR } } impl Deref for CCU80_CC81 { type Target = ccu80_cc80::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU80_CC81::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU80_CC81 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU80_CC81").finish() } } #[doc = "Capture Compare Unit 8 - Unit 0"] @@ -3003,17 +3933,24 @@ pub struct CCU80_CC82 { } unsafe impl Send for CCU80_CC82 {} impl CCU80_CC82 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu80_cc80::RegisterBlock = 0x4002_0300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { - 0x4002_0300 as *const _ + Self::PTR } } impl Deref for CCU80_CC82 { type Target = ccu80_cc80::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU80_CC82::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU80_CC82 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU80_CC82").finish() } } #[doc = "Capture Compare Unit 8 - Unit 0"] @@ -3022,17 +3959,24 @@ pub struct CCU80_CC83 { } unsafe impl Send for CCU80_CC83 {} impl CCU80_CC83 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccu80_cc80::RegisterBlock = 0x4002_0400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { - 0x4002_0400 as *const _ + Self::PTR } } impl Deref for CCU80_CC83 { type Target = ccu80_cc80::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*CCU80_CC83::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCU80_CC83 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCU80_CC83").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3041,17 +3985,24 @@ pub struct HRPWM0 { } unsafe impl Send for HRPWM0 {} impl HRPWM0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0::RegisterBlock = 0x4002_0900 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0::RegisterBlock { - 0x4002_0900 as *const _ + Self::PTR } } impl Deref for HRPWM0 { type Target = hrpwm0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3062,17 +4013,24 @@ pub struct HRPWM0_CSG0 { } unsafe impl Send for HRPWM0_CSG0 {} impl HRPWM0_CSG0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_csg0::RegisterBlock = 0x4002_0a00 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { - 0x4002_0a00 as *const _ + Self::PTR } } impl Deref for HRPWM0_CSG0 { type Target = hrpwm0_csg0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_CSG0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_CSG0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_CSG0").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3083,17 +4041,24 @@ pub struct HRPWM0_CSG1 { } unsafe impl Send for HRPWM0_CSG1 {} impl HRPWM0_CSG1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_csg0::RegisterBlock = 0x4002_0b00 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { - 0x4002_0b00 as *const _ + Self::PTR } } impl Deref for HRPWM0_CSG1 { type Target = hrpwm0_csg0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_CSG1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_CSG1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_CSG1").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3102,17 +4067,24 @@ pub struct HRPWM0_CSG2 { } unsafe impl Send for HRPWM0_CSG2 {} impl HRPWM0_CSG2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_csg0::RegisterBlock = 0x4002_0c00 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { - 0x4002_0c00 as *const _ + Self::PTR } } impl Deref for HRPWM0_CSG2 { type Target = hrpwm0_csg0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_CSG2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_CSG2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_CSG2").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3121,17 +4093,24 @@ pub struct HRPWM0_HRC0 { } unsafe impl Send for HRPWM0_HRC0 {} impl HRPWM0_HRC0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_hrc0::RegisterBlock = 0x4002_1300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { - 0x4002_1300 as *const _ + Self::PTR } } impl Deref for HRPWM0_HRC0 { type Target = hrpwm0_hrc0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_HRC0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_HRC0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_HRC0").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3142,17 +4121,24 @@ pub struct HRPWM0_HRC1 { } unsafe impl Send for HRPWM0_HRC1 {} impl HRPWM0_HRC1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_hrc0::RegisterBlock = 0x4002_1400 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { - 0x4002_1400 as *const _ + Self::PTR } } impl Deref for HRPWM0_HRC1 { type Target = hrpwm0_hrc0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_HRC1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_HRC1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_HRC1").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3161,17 +4147,24 @@ pub struct HRPWM0_HRC2 { } unsafe impl Send for HRPWM0_HRC2 {} impl HRPWM0_HRC2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_hrc0::RegisterBlock = 0x4002_1500 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { - 0x4002_1500 as *const _ + Self::PTR } } impl Deref for HRPWM0_HRC2 { type Target = hrpwm0_hrc0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_HRC2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_HRC2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_HRC2").finish() } } #[doc = "High Resolution PWM Unit"] @@ -3180,17 +4173,24 @@ pub struct HRPWM0_HRC3 { } unsafe impl Send for HRPWM0_HRC3 {} impl HRPWM0_HRC3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const hrpwm0_hrc0::RegisterBlock = 0x4002_1600 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { - 0x4002_1600 as *const _ + Self::PTR } } impl Deref for HRPWM0_HRC3 { type Target = hrpwm0_hrc0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*HRPWM0_HRC3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for HRPWM0_HRC3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("HRPWM0_HRC3").finish() } } #[doc = "Position Interface 0"] @@ -3199,17 +4199,24 @@ pub struct POSIF0 { } unsafe impl Send for POSIF0 {} impl POSIF0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const posif0::RegisterBlock = 0x4002_8000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const posif0::RegisterBlock { - 0x4002_8000 as *const _ + Self::PTR } } impl Deref for POSIF0 { type Target = posif0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*POSIF0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for POSIF0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("POSIF0").finish() } } #[doc = "Position Interface 0"] @@ -3220,17 +4227,24 @@ pub struct PORT0 { } unsafe impl Send for PORT0 {} impl PORT0 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const port0::RegisterBlock = 0x4802_8000 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const port0::RegisterBlock { - 0x4802_8000 as *const _ + Self::PTR } } impl Deref for PORT0 { type Target = port0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PORT0::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PORT0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PORT0").finish() } } #[doc = "Port 0"] @@ -3241,17 +4255,24 @@ pub struct PORT1 { } unsafe impl Send for PORT1 {} impl PORT1 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const port1::RegisterBlock = 0x4802_8100 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const port1::RegisterBlock { - 0x4802_8100 as *const _ + Self::PTR } } impl Deref for PORT1 { type Target = port1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PORT1::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PORT1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PORT1").finish() } } #[doc = "Port 1"] @@ -3262,17 +4283,24 @@ pub struct PORT2 { } unsafe impl Send for PORT2 {} impl PORT2 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const port2::RegisterBlock = 0x4802_8200 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const port2::RegisterBlock { - 0x4802_8200 as *const _ + Self::PTR } } impl Deref for PORT2 { type Target = port2::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PORT2::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PORT2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PORT2").finish() } } #[doc = "Port 2"] @@ -3283,17 +4311,24 @@ pub struct PORT3 { } unsafe impl Send for PORT3 {} impl PORT3 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const port3::RegisterBlock = 0x4802_8300 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const port3::RegisterBlock { - 0x4802_8300 as *const _ + Self::PTR } } impl Deref for PORT3 { type Target = port3::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PORT3::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PORT3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PORT3").finish() } } #[doc = "Port 3"] @@ -3304,17 +4339,24 @@ pub struct PORT14 { } unsafe impl Send for PORT14 {} impl PORT14 { - #[doc = r"Returns a pointer to the register block"] + #[doc = r"Pointer to the register block"] + pub const PTR: *const port14::RegisterBlock = 0x4802_8e00 as *const _; + #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const port14::RegisterBlock { - 0x4802_8e00 as *const _ + Self::PTR } } impl Deref for PORT14 { type Target = port14::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { - unsafe { &*PORT14::ptr() } + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PORT14 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PORT14").finish() } } #[doc = "Port 14"] diff --git a/src/pba0.rs b/src/pba0.rs index 72a656b8..cf9e245e 100644 --- a/src/pba0.rs +++ b/src/pba0.rs @@ -2,27 +2,15 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Peripheral Bridge Status Register"] - pub sts: STS, + pub sts: crate::Reg, #[doc = "0x04 - PBA Write Error Address Register"] - pub waddr: WADDR, + pub waddr: crate::Reg, } -#[doc = "Peripheral Bridge Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sts](sts) module"] -pub type STS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STS; -#[doc = "`read()` method returns [sts::R](sts::R) reader structure"] -impl crate::Readable for STS {} -#[doc = "`write(|w| ..)` method takes [sts::W](sts::W) writer structure"] -impl crate::Writable for STS {} +#[doc = "STS register accessor: an alias for `Reg`"] +pub type STS = crate::Reg; #[doc = "Peripheral Bridge Status Register"] pub mod sts; -#[doc = "PBA Write Error Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [waddr](waddr) module"] -pub type WADDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WADDR; -#[doc = "`read()` method returns [waddr::R](waddr::R) reader structure"] -impl crate::Readable for WADDR {} +#[doc = "WADDR register accessor: an alias for `Reg`"] +pub type WADDR = crate::Reg; #[doc = "PBA Write Error Address Register"] pub mod waddr; diff --git a/src/pba0/sts.rs b/src/pba0/sts.rs index 8dfa79ca..cf759cf9 100644 --- a/src/pba0/sts.rs +++ b/src/pba0/sts.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register STS"] -pub type R = crate::R; -#[doc = "Writer for register STS"] -pub type W = crate::W; -#[doc = "Register STS `reset()`'s with value 0"] -impl crate::ResetValue for super::STS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `STS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Bufferable Write Access Error\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WERR`"] -pub type WERR_R = crate::R; +#[doc = "Field `WERR` reader - Bufferable Write Access Error"] +pub struct WERR_R(crate::FieldReader); impl WERR_R { + pub(crate) fn new(bits: bool) -> Self { + WERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WERR_A { @@ -38,15 +65,22 @@ impl WERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WERR_A::VALUE1 + **self == WERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WERR_A::VALUE2 + **self == WERR_A::VALUE2 + } +} +impl core::ops::Deref for WERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WERR`"] +#[doc = "Field `WERR` writer - Bufferable Write Access Error"] pub struct WERR_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> WERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no write error occurred."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> WERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn werr(&mut self) -> WERR_W { WERR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral Bridge Status Register\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 [sts](index.html) module"] +pub struct STS_SPEC; +impl crate::RegisterSpec for STS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sts::R](R) reader structure"] +impl crate::Readable for STS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sts::W](W) writer structure"] +impl crate::Writable for STS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STS to value 0"] +impl crate::Resettable for STS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/pba0/waddr.rs b/src/pba0/waddr.rs index 941df18d..700b6493 100644 --- a/src/pba0/waddr.rs +++ b/src/pba0/waddr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register WADDR"] -pub type R = crate::R; -#[doc = "Reader of field `WADDR`"] -pub type WADDR_R = crate::R; +#[doc = "Register `WADDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `WADDR` reader - Write Error Address"] +pub struct WADDR_R(crate::FieldReader); +impl WADDR_R { + pub(crate) fn new(bits: u32) -> Self { + WADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Write Error Address"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { WADDR_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "PBA Write Error Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [waddr](index.html) module"] +pub struct WADDR_SPEC; +impl crate::RegisterSpec for WADDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [waddr::R](R) reader structure"] +impl crate::Readable for WADDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets WADDR to value 0"] +impl crate::Resettable for WADDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pmu0.rs b/src/pmu0.rs index 48a22f56..5d005920 100644 --- a/src/pmu0.rs +++ b/src/pmu0.rs @@ -2,14 +2,9 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - PMU0 Identification Register"] - pub id: ID, + pub id: crate::Reg, } -#[doc = "PMU0 Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "PMU0 Identification Register"] pub mod id; diff --git a/src/pmu0/id.rs b/src/pmu0/id.rs index ad754b74..090d3a3f 100644 --- a/src/pmu0/id.rs +++ b/src/pmu0/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "PMU0 Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x009b_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x009b_c000 + } +} diff --git a/src/port0.rs b/src/port0.rs index 128c7877..507c2158 100644 --- a/src/port0.rs +++ b/src/port0.rs @@ -2,145 +2,74 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Port 0 Output Register"] - pub out: OUT, + pub out: crate::Reg, #[doc = "0x04 - Port 0 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 8usize], + pub omr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x10 - Port 0 Input/Output Control Register 0"] - pub iocr0: IOCR0, + pub iocr0: crate::Reg, #[doc = "0x14 - Port 0 Input/Output Control Register 4"] - pub iocr4: IOCR4, + pub iocr4: crate::Reg, #[doc = "0x18 - Port 0 Input/Output Control Register 8"] - pub iocr8: IOCR8, - _reserved5: [u8; 8usize], + pub iocr8: crate::Reg, + _reserved5: [u8; 0x08], #[doc = "0x24 - Port 0 Input Register"] - pub in_: IN, - _reserved6: [u8; 24usize], + pub in_: crate::Reg, + _reserved6: [u8; 0x18], #[doc = "0x40 - Port 0 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + pub pdr0: crate::Reg, #[doc = "0x44 - Port 0 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved8: [u8; 24usize], + pub pdr1: crate::Reg, + _reserved8: [u8; 0x18], #[doc = "0x60 - Port 0 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved9: [u8; 12usize], + pub pdisc: crate::Reg, + _reserved9: [u8; 0x0c], #[doc = "0x70 - Port 0 Pin Power Save Register"] - pub pps: PPS, + pub pps: crate::Reg, #[doc = "0x74 - Port 0 Pin Hardware Select Register"] - pub hwsel: HWSEL, + pub hwsel: crate::Reg, } -#[doc = "Port 0 Output Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](out) module"] -pub type OUT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUT; -#[doc = "`read()` method returns [out::R](out::R) reader structure"] -impl crate::Readable for OUT {} -#[doc = "`write(|w| ..)` method takes [out::W](out::W) writer structure"] -impl crate::Writable for OUT {} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; #[doc = "Port 0 Output Register"] pub mod out; -#[doc = "Port 0 Output Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](omr) module"] -pub type OMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OMR; -#[doc = "`write(|w| ..)` method takes [omr::W](omr::W) writer structure"] -impl crate::Writable for OMR {} +#[doc = "OMR register accessor: an alias for `Reg`"] +pub type OMR = crate::Reg; #[doc = "Port 0 Output Modification Register"] pub mod omr; -#[doc = "Port 0 Input/Output Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr0](iocr0) module"] -pub type IOCR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR0; -#[doc = "`read()` method returns [iocr0::R](iocr0::R) reader structure"] -impl crate::Readable for IOCR0 {} -#[doc = "`write(|w| ..)` method takes [iocr0::W](iocr0::W) writer structure"] -impl crate::Writable for IOCR0 {} +#[doc = "IOCR0 register accessor: an alias for `Reg`"] +pub type IOCR0 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "Port 0 Input/Output Control Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr4](iocr4) module"] -pub type IOCR4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR4; -#[doc = "`read()` method returns [iocr4::R](iocr4::R) reader structure"] -impl crate::Readable for IOCR4 {} -#[doc = "`write(|w| ..)` method takes [iocr4::W](iocr4::W) writer structure"] -impl crate::Writable for IOCR4 {} +#[doc = "IOCR4 register accessor: an alias for `Reg`"] +pub type IOCR4 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "Port 0 Input/Output Control Register 8\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr8](iocr8) module"] -pub type IOCR8 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR8; -#[doc = "`read()` method returns [iocr8::R](iocr8::R) reader structure"] -impl crate::Readable for IOCR8 {} -#[doc = "`write(|w| ..)` method takes [iocr8::W](iocr8::W) writer structure"] -impl crate::Writable for IOCR8 {} +#[doc = "IOCR8 register accessor: an alias for `Reg`"] +pub type IOCR8 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "Port 0 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`read()` method returns [in_::R](in_::R) reader structure"] -impl crate::Readable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Port 0 Input Register"] pub mod in_; -#[doc = "Port 0 Pad Driver Mode 0 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr0](pdr0) module"] -pub type PDR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR0; -#[doc = "`read()` method returns [pdr0::R](pdr0::R) reader structure"] -impl crate::Readable for PDR0 {} -#[doc = "`write(|w| ..)` method takes [pdr0::W](pdr0::W) writer structure"] -impl crate::Writable for PDR0 {} +#[doc = "PDR0 register accessor: an alias for `Reg`"] +pub type PDR0 = crate::Reg; #[doc = "Port 0 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "Port 0 Pad Driver Mode 1 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr1](pdr1) module"] -pub type PDR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR1; -#[doc = "`read()` method returns [pdr1::R](pdr1::R) reader structure"] -impl crate::Readable for PDR1 {} -#[doc = "`write(|w| ..)` method takes [pdr1::W](pdr1::W) writer structure"] -impl crate::Writable for PDR1 {} +#[doc = "PDR1 register accessor: an alias for `Reg`"] +pub type PDR1 = crate::Reg; #[doc = "Port 0 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "Port 0 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](pdisc) module"] -pub type PDISC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDISC; -#[doc = "`read()` method returns [pdisc::R](pdisc::R) reader structure"] -impl crate::Readable for PDISC {} +#[doc = "PDISC register accessor: an alias for `Reg`"] +pub type PDISC = crate::Reg; #[doc = "Port 0 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "Port 0 Pin Power Save Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pps](pps) module"] -pub type PPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PPS; -#[doc = "`read()` method returns [pps::R](pps::R) reader structure"] -impl crate::Readable for PPS {} -#[doc = "`write(|w| ..)` method takes [pps::W](pps::W) writer structure"] -impl crate::Writable for PPS {} +#[doc = "PPS register accessor: an alias for `Reg`"] +pub type PPS = crate::Reg; #[doc = "Port 0 Pin Power Save Register"] pub mod pps; -#[doc = "Port 0 Pin Hardware Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hwsel](hwsel) module"] -pub type HWSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HWSEL; -#[doc = "`read()` method returns [hwsel::R](hwsel::R) reader structure"] -impl crate::Readable for HWSEL {} -#[doc = "`write(|w| ..)` method takes [hwsel::W](hwsel::W) writer structure"] -impl crate::Writable for HWSEL {} +#[doc = "HWSEL register accessor: an alias for `Reg`"] +pub type HWSEL = crate::Reg; #[doc = "Port 0 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port0/hwsel.rs b/src/port0/hwsel.rs index 6b328f5a..55962397 100644 --- a/src/port0/hwsel.rs +++ b/src/port0/hwsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HWSEL"] -pub type R = crate::R; -#[doc = "Writer for register HWSEL"] -pub type W = crate::W; -#[doc = "Register HWSEL `reset()`'s with value 0x0001_4000"] -impl crate::ResetValue for super::HWSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0001_4000 +#[doc = "Register `HWSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HWSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW0`"] -pub type HW0_R = crate::R; +#[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] +pub struct HW0_R(crate::FieldReader); impl HW0_R { + pub(crate) fn new(bits: u8) -> Self { + HW0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW0_A::VALUE1), - 1 => Val(HW0_A::VALUE2), - 2 => Val(HW0_A::VALUE3), - i => Res(i), + 0 => Some(HW0_A::VALUE1), + 1 => Some(HW0_A::VALUE2), + 2 => Some(HW0_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW0_A::VALUE1 + **self == HW0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW0_A::VALUE2 + **self == HW0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW0_A::VALUE3 + **self == HW0_A::VALUE3 } } -#[doc = "Write proxy for field `HW0`"] +impl core::ops::Deref for HW0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] pub struct HW0_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> HW0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW1`"] -pub type HW1_R = crate::R; +#[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] +pub struct HW1_R(crate::FieldReader); impl HW1_R { + pub(crate) fn new(bits: u8) -> Self { + HW1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW1_A::VALUE1), - 1 => Val(HW1_A::VALUE2), - 2 => Val(HW1_A::VALUE3), - i => Res(i), + 0 => Some(HW1_A::VALUE1), + 1 => Some(HW1_A::VALUE2), + 2 => Some(HW1_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW1_A::VALUE1 + **self == HW1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW1_A::VALUE2 + **self == HW1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW1_A::VALUE3 + **self == HW1_A::VALUE3 + } +} +impl core::ops::Deref for HW1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW1`"] +#[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] pub struct HW1_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> HW1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW2`"] -pub type HW2_R = crate::R; +#[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] +pub struct HW2_R(crate::FieldReader); impl HW2_R { + pub(crate) fn new(bits: u8) -> Self { + HW2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW2_A::VALUE1), - 1 => Val(HW2_A::VALUE2), - 2 => Val(HW2_A::VALUE3), - i => Res(i), + 0 => Some(HW2_A::VALUE1), + 1 => Some(HW2_A::VALUE2), + 2 => Some(HW2_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW2_A::VALUE1 + **self == HW2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW2_A::VALUE2 + **self == HW2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW2_A::VALUE3 + **self == HW2_A::VALUE3 + } +} +impl core::ops::Deref for HW2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW2`"] +#[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] pub struct HW2_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> HW2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW3`"] -pub type HW3_R = crate::R; +#[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] +pub struct HW3_R(crate::FieldReader); impl HW3_R { + pub(crate) fn new(bits: u8) -> Self { + HW3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW3_A::VALUE1), - 1 => Val(HW3_A::VALUE2), - 2 => Val(HW3_A::VALUE3), - i => Res(i), + 0 => Some(HW3_A::VALUE1), + 1 => Some(HW3_A::VALUE2), + 2 => Some(HW3_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW3_A::VALUE1 + **self == HW3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW3_A::VALUE2 + **self == HW3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW3_A::VALUE3 + **self == HW3_A::VALUE3 } } -#[doc = "Write proxy for field `HW3`"] +impl core::ops::Deref for HW3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] pub struct HW3_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> HW3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -343,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW4`"] -pub type HW4_R = crate::R; +#[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] +pub struct HW4_R(crate::FieldReader); impl HW4_R { + pub(crate) fn new(bits: u8) -> Self { + HW4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW4_A::VALUE1), - 1 => Val(HW4_A::VALUE2), - 2 => Val(HW4_A::VALUE3), - i => Res(i), + 0 => Some(HW4_A::VALUE1), + 1 => Some(HW4_A::VALUE2), + 2 => Some(HW4_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW4_A::VALUE1 + **self == HW4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW4_A::VALUE2 + **self == HW4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW4_A::VALUE3 + **self == HW4_A::VALUE3 + } +} +impl core::ops::Deref for HW4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW4`"] +#[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] pub struct HW4_W<'a> { w: &'a mut W, } @@ -401,7 +470,7 @@ impl<'a> HW4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -422,37 +491,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW5`"] -pub type HW5_R = crate::R; +#[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] +pub struct HW5_R(crate::FieldReader); impl HW5_R { + pub(crate) fn new(bits: u8) -> Self { + HW5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW5_A::VALUE1), - 1 => Val(HW5_A::VALUE2), - 2 => Val(HW5_A::VALUE3), - i => Res(i), + 0 => Some(HW5_A::VALUE1), + 1 => Some(HW5_A::VALUE2), + 2 => Some(HW5_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW5_A::VALUE1 + **self == HW5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW5_A::VALUE2 + **self == HW5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW5_A::VALUE3 + **self == HW5_A::VALUE3 + } +} +impl core::ops::Deref for HW5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW5`"] +#[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] pub struct HW5_W<'a> { w: &'a mut W, } @@ -480,7 +558,7 @@ impl<'a> HW5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -501,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW6`"] -pub type HW6_R = crate::R; +#[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] +pub struct HW6_R(crate::FieldReader); impl HW6_R { + pub(crate) fn new(bits: u8) -> Self { + HW6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW6_A::VALUE1), - 1 => Val(HW6_A::VALUE2), - 2 => Val(HW6_A::VALUE3), - i => Res(i), + 0 => Some(HW6_A::VALUE1), + 1 => Some(HW6_A::VALUE2), + 2 => Some(HW6_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW6_A::VALUE1 + **self == HW6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW6_A::VALUE2 + **self == HW6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW6_A::VALUE3 + **self == HW6_A::VALUE3 } } -#[doc = "Write proxy for field `HW6`"] +impl core::ops::Deref for HW6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] pub struct HW6_W<'a> { w: &'a mut W, } @@ -559,7 +646,7 @@ impl<'a> HW6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -580,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW7`"] -pub type HW7_R = crate::R; +#[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] +pub struct HW7_R(crate::FieldReader); impl HW7_R { + pub(crate) fn new(bits: u8) -> Self { + HW7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW7_A::VALUE1), - 1 => Val(HW7_A::VALUE2), - 2 => Val(HW7_A::VALUE3), - i => Res(i), + 0 => Some(HW7_A::VALUE1), + 1 => Some(HW7_A::VALUE2), + 2 => Some(HW7_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW7_A::VALUE1 + **self == HW7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW7_A::VALUE2 + **self == HW7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW7_A::VALUE3 + **self == HW7_A::VALUE3 } } -#[doc = "Write proxy for field `HW7`"] +impl core::ops::Deref for HW7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] pub struct HW7_W<'a> { w: &'a mut W, } @@ -638,7 +734,7 @@ impl<'a> HW7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -659,37 +755,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW8`"] -pub type HW8_R = crate::R; +#[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] +pub struct HW8_R(crate::FieldReader); impl HW8_R { + pub(crate) fn new(bits: u8) -> Self { + HW8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW8_A::VALUE1), - 1 => Val(HW8_A::VALUE2), - 2 => Val(HW8_A::VALUE3), - i => Res(i), + 0 => Some(HW8_A::VALUE1), + 1 => Some(HW8_A::VALUE2), + 2 => Some(HW8_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW8_A::VALUE1 + **self == HW8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW8_A::VALUE2 + **self == HW8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW8_A::VALUE3 + **self == HW8_A::VALUE3 + } +} +impl core::ops::Deref for HW8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW8`"] +#[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] pub struct HW8_W<'a> { w: &'a mut W, } @@ -717,7 +822,7 @@ impl<'a> HW8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -738,37 +843,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW9`"] -pub type HW9_R = crate::R; +#[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] +pub struct HW9_R(crate::FieldReader); impl HW9_R { + pub(crate) fn new(bits: u8) -> Self { + HW9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW9_A::VALUE1), - 1 => Val(HW9_A::VALUE2), - 2 => Val(HW9_A::VALUE3), - i => Res(i), + 0 => Some(HW9_A::VALUE1), + 1 => Some(HW9_A::VALUE2), + 2 => Some(HW9_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW9_A::VALUE1 + **self == HW9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW9_A::VALUE2 + **self == HW9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW9_A::VALUE3 + **self == HW9_A::VALUE3 } } -#[doc = "Write proxy for field `HW9`"] +impl core::ops::Deref for HW9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] pub struct HW9_W<'a> { w: &'a mut W, } @@ -796,7 +910,7 @@ impl<'a> HW9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -817,37 +931,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW10`"] -pub type HW10_R = crate::R; +#[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] +pub struct HW10_R(crate::FieldReader); impl HW10_R { + pub(crate) fn new(bits: u8) -> Self { + HW10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW10_A::VALUE1), - 1 => Val(HW10_A::VALUE2), - 2 => Val(HW10_A::VALUE3), - i => Res(i), + 0 => Some(HW10_A::VALUE1), + 1 => Some(HW10_A::VALUE2), + 2 => Some(HW10_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW10_A::VALUE1 + **self == HW10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW10_A::VALUE2 + **self == HW10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW10_A::VALUE3 + **self == HW10_A::VALUE3 } } -#[doc = "Write proxy for field `HW10`"] +impl core::ops::Deref for HW10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] pub struct HW10_W<'a> { w: &'a mut W, } @@ -875,7 +998,7 @@ impl<'a> HW10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -896,37 +1019,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW11`"] -pub type HW11_R = crate::R; +#[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] +pub struct HW11_R(crate::FieldReader); impl HW11_R { + pub(crate) fn new(bits: u8) -> Self { + HW11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW11_A::VALUE1), - 1 => Val(HW11_A::VALUE2), - 2 => Val(HW11_A::VALUE3), - i => Res(i), + 0 => Some(HW11_A::VALUE1), + 1 => Some(HW11_A::VALUE2), + 2 => Some(HW11_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW11_A::VALUE1 + **self == HW11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW11_A::VALUE2 + **self == HW11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW11_A::VALUE3 + **self == HW11_A::VALUE3 } } -#[doc = "Write proxy for field `HW11`"] +impl core::ops::Deref for HW11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] pub struct HW11_W<'a> { w: &'a mut W, } @@ -954,7 +1086,7 @@ impl<'a> HW11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -975,37 +1107,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW12`"] -pub type HW12_R = crate::R; +#[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] +pub struct HW12_R(crate::FieldReader); impl HW12_R { + pub(crate) fn new(bits: u8) -> Self { + HW12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW12_A::VALUE1), - 1 => Val(HW12_A::VALUE2), - 2 => Val(HW12_A::VALUE3), - i => Res(i), + 0 => Some(HW12_A::VALUE1), + 1 => Some(HW12_A::VALUE2), + 2 => Some(HW12_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW12_A::VALUE1 + **self == HW12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW12_A::VALUE2 + **self == HW12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW12_A::VALUE3 + **self == HW12_A::VALUE3 + } +} +impl core::ops::Deref for HW12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW12`"] +#[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] pub struct HW12_W<'a> { w: &'a mut W, } @@ -1033,7 +1174,7 @@ impl<'a> HW12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1054,37 +1195,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW13`"] -pub type HW13_R = crate::R; +#[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] +pub struct HW13_R(crate::FieldReader); impl HW13_R { + pub(crate) fn new(bits: u8) -> Self { + HW13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW13_A::VALUE1), - 1 => Val(HW13_A::VALUE2), - 2 => Val(HW13_A::VALUE3), - i => Res(i), + 0 => Some(HW13_A::VALUE1), + 1 => Some(HW13_A::VALUE2), + 2 => Some(HW13_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW13_A::VALUE1 + **self == HW13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW13_A::VALUE2 + **self == HW13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW13_A::VALUE3 + **self == HW13_A::VALUE3 + } +} +impl core::ops::Deref for HW13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW13`"] +#[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] pub struct HW13_W<'a> { w: &'a mut W, } @@ -1112,7 +1262,7 @@ impl<'a> HW13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -1133,37 +1283,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW14`"] -pub type HW14_R = crate::R; +#[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] +pub struct HW14_R(crate::FieldReader); impl HW14_R { + pub(crate) fn new(bits: u8) -> Self { + HW14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW14_A::VALUE1), - 1 => Val(HW14_A::VALUE2), - 2 => Val(HW14_A::VALUE3), - i => Res(i), + 0 => Some(HW14_A::VALUE1), + 1 => Some(HW14_A::VALUE2), + 2 => Some(HW14_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW14_A::VALUE1 + **self == HW14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW14_A::VALUE2 + **self == HW14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW14_A::VALUE3 + **self == HW14_A::VALUE3 } } -#[doc = "Write proxy for field `HW14`"] +impl core::ops::Deref for HW14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] pub struct HW14_W<'a> { w: &'a mut W, } @@ -1191,7 +1350,7 @@ impl<'a> HW14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1212,37 +1371,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW15`"] -pub type HW15_R = crate::R; +#[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] +pub struct HW15_R(crate::FieldReader); impl HW15_R { + pub(crate) fn new(bits: u8) -> Self { + HW15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW15_A::VALUE1), - 1 => Val(HW15_A::VALUE2), - 2 => Val(HW15_A::VALUE3), - i => Res(i), + 0 => Some(HW15_A::VALUE1), + 1 => Some(HW15_A::VALUE2), + 2 => Some(HW15_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW15_A::VALUE1 + **self == HW15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW15_A::VALUE2 + **self == HW15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW15_A::VALUE3 + **self == HW15_A::VALUE3 } } -#[doc = "Write proxy for field `HW15`"] +impl core::ops::Deref for HW15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] pub struct HW15_W<'a> { w: &'a mut W, } @@ -1270,7 +1438,7 @@ impl<'a> HW15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -1437,4 +1605,30 @@ impl W { pub fn hw15(&mut self) -> HW15_W { HW15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Pin Hardware Select Register\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 [hwsel](index.html) module"] +pub struct HWSEL_SPEC; +impl crate::RegisterSpec for HWSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hwsel::R](R) reader structure"] +impl crate::Readable for HWSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hwsel::W](W) writer structure"] +impl crate::Writable for HWSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HWSEL to value 0x0001_4000"] +impl crate::Resettable for HWSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0001_4000 + } } diff --git a/src/port0/in_.rs b/src/port0/in_.rs index 344607dc..96519b39 100644 --- a/src/port0/in_.rs +++ b/src/port0/in_.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register IN"] -pub type R = crate::R; +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum P0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Input Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -28,12 +44,19 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 + } +} +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Input Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -64,12 +90,19 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 + } +} +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Input Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -100,12 +136,19 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Input Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -136,12 +182,19 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Input Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -172,12 +228,19 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Input Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -208,12 +274,19 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Input Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -244,12 +320,19 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 + } +} +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Input Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -280,12 +366,19 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 + } +} +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Input Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -316,12 +412,19 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 + } +} +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Input Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -352,12 +458,19 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Input Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -388,12 +504,19 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 + } +} +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Input Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -424,12 +550,19 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 + } +} +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Input Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -460,12 +596,19 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Input Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -496,12 +642,19 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 + } +} +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Input Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -532,12 +688,19 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 + } +} +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Input Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -568,12 +734,19 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 + } +} +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { P15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 0 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port0/iocr0.rs b/src/port0/iocr0.rs index ea51a257..e25c440e 100644 --- a/src/port0/iocr0.rs +++ b/src/port0/iocr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR0"] -pub type R = crate::R; -#[doc = "Writer for register IOCR0"] -pub type W = crate::W; -#[doc = "Register IOCR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC0`"] -pub type PC0_R = crate::R; +#[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC0_R(crate::FieldReader); impl PC0_R { + pub(crate) fn new(bits: u8) -> Self { + PC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC0_A::VALUE1), - 1 => Val(PC0_A::VALUE2), - 2 => Val(PC0_A::VALUE3), - 3 => Val(PC0_A::VALUE4), - 4 => Val(PC0_A::VALUE5), - 5 => Val(PC0_A::VALUE6), - 6 => Val(PC0_A::VALUE7), - 7 => Val(PC0_A::VALUE8), - 16 => Val(PC0_A::VALUE9), - 17 => Val(PC0_A::VALUE10), - 18 => Val(PC0_A::VALUE11), - 19 => Val(PC0_A::VALUE12), - 20 => Val(PC0_A::VALUE13), - 24 => Val(PC0_A::VALUE14), - 25 => Val(PC0_A::VALUE15), - 26 => Val(PC0_A::VALUE16), - 27 => Val(PC0_A::VALUE17), - 28 => Val(PC0_A::VALUE18), - i => Res(i), + 0 => Some(PC0_A::VALUE1), + 1 => Some(PC0_A::VALUE2), + 2 => Some(PC0_A::VALUE3), + 3 => Some(PC0_A::VALUE4), + 4 => Some(PC0_A::VALUE5), + 5 => Some(PC0_A::VALUE6), + 6 => Some(PC0_A::VALUE7), + 7 => Some(PC0_A::VALUE8), + 16 => Some(PC0_A::VALUE9), + 17 => Some(PC0_A::VALUE10), + 18 => Some(PC0_A::VALUE11), + 19 => Some(PC0_A::VALUE12), + 20 => Some(PC0_A::VALUE13), + 24 => Some(PC0_A::VALUE14), + 25 => Some(PC0_A::VALUE15), + 26 => Some(PC0_A::VALUE16), + 27 => Some(PC0_A::VALUE17), + 28 => Some(PC0_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC0_A::VALUE1 + **self == PC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC0_A::VALUE2 + **self == PC0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC0_A::VALUE3 + **self == PC0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC0_A::VALUE4 + **self == PC0_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC0_A::VALUE5 + **self == PC0_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC0_A::VALUE6 + **self == PC0_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC0_A::VALUE7 + **self == PC0_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC0_A::VALUE8 + **self == PC0_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC0_A::VALUE9 + **self == PC0_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC0_A::VALUE10 + **self == PC0_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC0_A::VALUE11 + **self == PC0_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC0_A::VALUE12 + **self == PC0_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC0_A::VALUE13 + **self == PC0_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC0_A::VALUE14 + **self == PC0_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC0_A::VALUE15 + **self == PC0_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC0_A::VALUE16 + **self == PC0_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC0_A::VALUE17 + **self == PC0_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC0_A::VALUE18 + **self == PC0_A::VALUE18 } } -#[doc = "Write proxy for field `PC0`"] +impl core::ops::Deref for PC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] pub struct PC0_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC1`"] -pub type PC1_R = crate::R; +#[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC1_R(crate::FieldReader); impl PC1_R { + pub(crate) fn new(bits: u8) -> Self { + PC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC1_A::VALUE1), - 1 => Val(PC1_A::VALUE2), - 2 => Val(PC1_A::VALUE3), - 3 => Val(PC1_A::VALUE4), - 4 => Val(PC1_A::VALUE5), - 5 => Val(PC1_A::VALUE6), - 6 => Val(PC1_A::VALUE7), - 7 => Val(PC1_A::VALUE8), - 16 => Val(PC1_A::VALUE9), - 17 => Val(PC1_A::VALUE10), - 18 => Val(PC1_A::VALUE11), - 19 => Val(PC1_A::VALUE12), - 20 => Val(PC1_A::VALUE13), - 24 => Val(PC1_A::VALUE14), - 25 => Val(PC1_A::VALUE15), - 26 => Val(PC1_A::VALUE16), - 27 => Val(PC1_A::VALUE17), - 28 => Val(PC1_A::VALUE18), - i => Res(i), + 0 => Some(PC1_A::VALUE1), + 1 => Some(PC1_A::VALUE2), + 2 => Some(PC1_A::VALUE3), + 3 => Some(PC1_A::VALUE4), + 4 => Some(PC1_A::VALUE5), + 5 => Some(PC1_A::VALUE6), + 6 => Some(PC1_A::VALUE7), + 7 => Some(PC1_A::VALUE8), + 16 => Some(PC1_A::VALUE9), + 17 => Some(PC1_A::VALUE10), + 18 => Some(PC1_A::VALUE11), + 19 => Some(PC1_A::VALUE12), + 20 => Some(PC1_A::VALUE13), + 24 => Some(PC1_A::VALUE14), + 25 => Some(PC1_A::VALUE15), + 26 => Some(PC1_A::VALUE16), + 27 => Some(PC1_A::VALUE17), + 28 => Some(PC1_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC1_A::VALUE1 + **self == PC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC1_A::VALUE2 + **self == PC1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC1_A::VALUE3 + **self == PC1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC1_A::VALUE4 + **self == PC1_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC1_A::VALUE5 + **self == PC1_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC1_A::VALUE6 + **self == PC1_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC1_A::VALUE7 + **self == PC1_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC1_A::VALUE8 + **self == PC1_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC1_A::VALUE9 + **self == PC1_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC1_A::VALUE10 + **self == PC1_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC1_A::VALUE11 + **self == PC1_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC1_A::VALUE12 + **self == PC1_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC1_A::VALUE13 + **self == PC1_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC1_A::VALUE14 + **self == PC1_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC1_A::VALUE15 + **self == PC1_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC1_A::VALUE16 + **self == PC1_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC1_A::VALUE17 + **self == PC1_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC1_A::VALUE18 + **self == PC1_A::VALUE18 } } -#[doc = "Write proxy for field `PC1`"] +impl core::ops::Deref for PC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] pub struct PC1_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC2`"] -pub type PC2_R = crate::R; +#[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC2_R(crate::FieldReader); impl PC2_R { + pub(crate) fn new(bits: u8) -> Self { + PC2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC2_A::VALUE1), - 1 => Val(PC2_A::VALUE2), - 2 => Val(PC2_A::VALUE3), - 3 => Val(PC2_A::VALUE4), - 4 => Val(PC2_A::VALUE5), - 5 => Val(PC2_A::VALUE6), - 6 => Val(PC2_A::VALUE7), - 7 => Val(PC2_A::VALUE8), - 16 => Val(PC2_A::VALUE9), - 17 => Val(PC2_A::VALUE10), - 18 => Val(PC2_A::VALUE11), - 19 => Val(PC2_A::VALUE12), - 20 => Val(PC2_A::VALUE13), - 24 => Val(PC2_A::VALUE14), - 25 => Val(PC2_A::VALUE15), - 26 => Val(PC2_A::VALUE16), - 27 => Val(PC2_A::VALUE17), - 28 => Val(PC2_A::VALUE18), - i => Res(i), + 0 => Some(PC2_A::VALUE1), + 1 => Some(PC2_A::VALUE2), + 2 => Some(PC2_A::VALUE3), + 3 => Some(PC2_A::VALUE4), + 4 => Some(PC2_A::VALUE5), + 5 => Some(PC2_A::VALUE6), + 6 => Some(PC2_A::VALUE7), + 7 => Some(PC2_A::VALUE8), + 16 => Some(PC2_A::VALUE9), + 17 => Some(PC2_A::VALUE10), + 18 => Some(PC2_A::VALUE11), + 19 => Some(PC2_A::VALUE12), + 20 => Some(PC2_A::VALUE13), + 24 => Some(PC2_A::VALUE14), + 25 => Some(PC2_A::VALUE15), + 26 => Some(PC2_A::VALUE16), + 27 => Some(PC2_A::VALUE17), + 28 => Some(PC2_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC2_A::VALUE1 + **self == PC2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC2_A::VALUE2 + **self == PC2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC2_A::VALUE3 + **self == PC2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC2_A::VALUE4 + **self == PC2_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC2_A::VALUE5 + **self == PC2_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC2_A::VALUE6 + **self == PC2_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC2_A::VALUE7 + **self == PC2_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC2_A::VALUE8 + **self == PC2_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC2_A::VALUE9 + **self == PC2_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC2_A::VALUE10 + **self == PC2_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC2_A::VALUE11 + **self == PC2_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC2_A::VALUE12 + **self == PC2_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC2_A::VALUE13 + **self == PC2_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC2_A::VALUE14 + **self == PC2_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC2_A::VALUE15 + **self == PC2_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC2_A::VALUE16 + **self == PC2_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC2_A::VALUE17 + **self == PC2_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC2_A::VALUE18 + **self == PC2_A::VALUE18 + } +} +impl core::ops::Deref for PC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC2`"] +#[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] pub struct PC2_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC3`"] -pub type PC3_R = crate::R; +#[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC3_R(crate::FieldReader); impl PC3_R { + pub(crate) fn new(bits: u8) -> Self { + PC3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC3_A::VALUE1), - 1 => Val(PC3_A::VALUE2), - 2 => Val(PC3_A::VALUE3), - 3 => Val(PC3_A::VALUE4), - 4 => Val(PC3_A::VALUE5), - 5 => Val(PC3_A::VALUE6), - 6 => Val(PC3_A::VALUE7), - 7 => Val(PC3_A::VALUE8), - 16 => Val(PC3_A::VALUE9), - 17 => Val(PC3_A::VALUE10), - 18 => Val(PC3_A::VALUE11), - 19 => Val(PC3_A::VALUE12), - 20 => Val(PC3_A::VALUE13), - 24 => Val(PC3_A::VALUE14), - 25 => Val(PC3_A::VALUE15), - 26 => Val(PC3_A::VALUE16), - 27 => Val(PC3_A::VALUE17), - 28 => Val(PC3_A::VALUE18), - i => Res(i), + 0 => Some(PC3_A::VALUE1), + 1 => Some(PC3_A::VALUE2), + 2 => Some(PC3_A::VALUE3), + 3 => Some(PC3_A::VALUE4), + 4 => Some(PC3_A::VALUE5), + 5 => Some(PC3_A::VALUE6), + 6 => Some(PC3_A::VALUE7), + 7 => Some(PC3_A::VALUE8), + 16 => Some(PC3_A::VALUE9), + 17 => Some(PC3_A::VALUE10), + 18 => Some(PC3_A::VALUE11), + 19 => Some(PC3_A::VALUE12), + 20 => Some(PC3_A::VALUE13), + 24 => Some(PC3_A::VALUE14), + 25 => Some(PC3_A::VALUE15), + 26 => Some(PC3_A::VALUE16), + 27 => Some(PC3_A::VALUE17), + 28 => Some(PC3_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC3_A::VALUE1 + **self == PC3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC3_A::VALUE2 + **self == PC3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC3_A::VALUE3 + **self == PC3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC3_A::VALUE4 + **self == PC3_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC3_A::VALUE5 + **self == PC3_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC3_A::VALUE6 + **self == PC3_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC3_A::VALUE7 + **self == PC3_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC3_A::VALUE8 + **self == PC3_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC3_A::VALUE9 + **self == PC3_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC3_A::VALUE10 + **self == PC3_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC3_A::VALUE11 + **self == PC3_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC3_A::VALUE12 + **self == PC3_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC3_A::VALUE13 + **self == PC3_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC3_A::VALUE14 + **self == PC3_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC3_A::VALUE15 + **self == PC3_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC3_A::VALUE16 + **self == PC3_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC3_A::VALUE17 + **self == PC3_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC3_A::VALUE18 + **self == PC3_A::VALUE18 + } +} +impl core::ops::Deref for PC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC3`"] +#[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] pub struct PC3_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc3(&mut self) -> PC3_W { PC3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Input/Output Control Register 0\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 [iocr0](index.html) module"] +pub struct IOCR0_SPEC; +impl crate::RegisterSpec for IOCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr0::R](R) reader structure"] +impl crate::Readable for IOCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr0::W](W) writer structure"] +impl crate::Writable for IOCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR0 to value 0"] +impl crate::Resettable for IOCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port0/iocr4.rs b/src/port0/iocr4.rs index d884a743..da5fdec4 100644 --- a/src/port0/iocr4.rs +++ b/src/port0/iocr4.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR4"] -pub type R = crate::R; -#[doc = "Writer for register IOCR4"] -pub type W = crate::W; -#[doc = "Register IOCR4 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR4 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC4`"] -pub type PC4_R = crate::R; +#[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC4_R(crate::FieldReader); impl PC4_R { + pub(crate) fn new(bits: u8) -> Self { + PC4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC4_A::VALUE1), - 1 => Val(PC4_A::VALUE2), - 2 => Val(PC4_A::VALUE3), - 3 => Val(PC4_A::VALUE4), - 4 => Val(PC4_A::VALUE5), - 5 => Val(PC4_A::VALUE6), - 6 => Val(PC4_A::VALUE7), - 7 => Val(PC4_A::VALUE8), - 16 => Val(PC4_A::VALUE9), - 17 => Val(PC4_A::VALUE10), - 18 => Val(PC4_A::VALUE11), - 19 => Val(PC4_A::VALUE12), - 20 => Val(PC4_A::VALUE13), - 24 => Val(PC4_A::VALUE14), - 25 => Val(PC4_A::VALUE15), - 26 => Val(PC4_A::VALUE16), - 27 => Val(PC4_A::VALUE17), - 28 => Val(PC4_A::VALUE18), - i => Res(i), + 0 => Some(PC4_A::VALUE1), + 1 => Some(PC4_A::VALUE2), + 2 => Some(PC4_A::VALUE3), + 3 => Some(PC4_A::VALUE4), + 4 => Some(PC4_A::VALUE5), + 5 => Some(PC4_A::VALUE6), + 6 => Some(PC4_A::VALUE7), + 7 => Some(PC4_A::VALUE8), + 16 => Some(PC4_A::VALUE9), + 17 => Some(PC4_A::VALUE10), + 18 => Some(PC4_A::VALUE11), + 19 => Some(PC4_A::VALUE12), + 20 => Some(PC4_A::VALUE13), + 24 => Some(PC4_A::VALUE14), + 25 => Some(PC4_A::VALUE15), + 26 => Some(PC4_A::VALUE16), + 27 => Some(PC4_A::VALUE17), + 28 => Some(PC4_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC4_A::VALUE1 + **self == PC4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC4_A::VALUE2 + **self == PC4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC4_A::VALUE3 + **self == PC4_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC4_A::VALUE4 + **self == PC4_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC4_A::VALUE5 + **self == PC4_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC4_A::VALUE6 + **self == PC4_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC4_A::VALUE7 + **self == PC4_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC4_A::VALUE8 + **self == PC4_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC4_A::VALUE9 + **self == PC4_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC4_A::VALUE10 + **self == PC4_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC4_A::VALUE11 + **self == PC4_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC4_A::VALUE12 + **self == PC4_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC4_A::VALUE13 + **self == PC4_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC4_A::VALUE14 + **self == PC4_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC4_A::VALUE15 + **self == PC4_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC4_A::VALUE16 + **self == PC4_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC4_A::VALUE17 + **self == PC4_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC4_A::VALUE18 + **self == PC4_A::VALUE18 } } -#[doc = "Write proxy for field `PC4`"] +impl core::ops::Deref for PC4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] pub struct PC4_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC5`"] -pub type PC5_R = crate::R; +#[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC5_R(crate::FieldReader); impl PC5_R { + pub(crate) fn new(bits: u8) -> Self { + PC5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC5_A::VALUE1), - 1 => Val(PC5_A::VALUE2), - 2 => Val(PC5_A::VALUE3), - 3 => Val(PC5_A::VALUE4), - 4 => Val(PC5_A::VALUE5), - 5 => Val(PC5_A::VALUE6), - 6 => Val(PC5_A::VALUE7), - 7 => Val(PC5_A::VALUE8), - 16 => Val(PC5_A::VALUE9), - 17 => Val(PC5_A::VALUE10), - 18 => Val(PC5_A::VALUE11), - 19 => Val(PC5_A::VALUE12), - 20 => Val(PC5_A::VALUE13), - 24 => Val(PC5_A::VALUE14), - 25 => Val(PC5_A::VALUE15), - 26 => Val(PC5_A::VALUE16), - 27 => Val(PC5_A::VALUE17), - 28 => Val(PC5_A::VALUE18), - i => Res(i), + 0 => Some(PC5_A::VALUE1), + 1 => Some(PC5_A::VALUE2), + 2 => Some(PC5_A::VALUE3), + 3 => Some(PC5_A::VALUE4), + 4 => Some(PC5_A::VALUE5), + 5 => Some(PC5_A::VALUE6), + 6 => Some(PC5_A::VALUE7), + 7 => Some(PC5_A::VALUE8), + 16 => Some(PC5_A::VALUE9), + 17 => Some(PC5_A::VALUE10), + 18 => Some(PC5_A::VALUE11), + 19 => Some(PC5_A::VALUE12), + 20 => Some(PC5_A::VALUE13), + 24 => Some(PC5_A::VALUE14), + 25 => Some(PC5_A::VALUE15), + 26 => Some(PC5_A::VALUE16), + 27 => Some(PC5_A::VALUE17), + 28 => Some(PC5_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC5_A::VALUE1 + **self == PC5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC5_A::VALUE2 + **self == PC5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC5_A::VALUE3 + **self == PC5_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC5_A::VALUE4 + **self == PC5_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC5_A::VALUE5 + **self == PC5_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC5_A::VALUE6 + **self == PC5_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC5_A::VALUE7 + **self == PC5_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC5_A::VALUE8 + **self == PC5_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC5_A::VALUE9 + **self == PC5_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC5_A::VALUE10 + **self == PC5_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC5_A::VALUE11 + **self == PC5_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC5_A::VALUE12 + **self == PC5_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC5_A::VALUE13 + **self == PC5_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC5_A::VALUE14 + **self == PC5_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC5_A::VALUE15 + **self == PC5_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC5_A::VALUE16 + **self == PC5_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC5_A::VALUE17 + **self == PC5_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC5_A::VALUE18 + **self == PC5_A::VALUE18 } } -#[doc = "Write proxy for field `PC5`"] +impl core::ops::Deref for PC5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] pub struct PC5_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC6`"] -pub type PC6_R = crate::R; +#[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC6_R(crate::FieldReader); impl PC6_R { + pub(crate) fn new(bits: u8) -> Self { + PC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC6_A::VALUE1), - 1 => Val(PC6_A::VALUE2), - 2 => Val(PC6_A::VALUE3), - 3 => Val(PC6_A::VALUE4), - 4 => Val(PC6_A::VALUE5), - 5 => Val(PC6_A::VALUE6), - 6 => Val(PC6_A::VALUE7), - 7 => Val(PC6_A::VALUE8), - 16 => Val(PC6_A::VALUE9), - 17 => Val(PC6_A::VALUE10), - 18 => Val(PC6_A::VALUE11), - 19 => Val(PC6_A::VALUE12), - 20 => Val(PC6_A::VALUE13), - 24 => Val(PC6_A::VALUE14), - 25 => Val(PC6_A::VALUE15), - 26 => Val(PC6_A::VALUE16), - 27 => Val(PC6_A::VALUE17), - 28 => Val(PC6_A::VALUE18), - i => Res(i), + 0 => Some(PC6_A::VALUE1), + 1 => Some(PC6_A::VALUE2), + 2 => Some(PC6_A::VALUE3), + 3 => Some(PC6_A::VALUE4), + 4 => Some(PC6_A::VALUE5), + 5 => Some(PC6_A::VALUE6), + 6 => Some(PC6_A::VALUE7), + 7 => Some(PC6_A::VALUE8), + 16 => Some(PC6_A::VALUE9), + 17 => Some(PC6_A::VALUE10), + 18 => Some(PC6_A::VALUE11), + 19 => Some(PC6_A::VALUE12), + 20 => Some(PC6_A::VALUE13), + 24 => Some(PC6_A::VALUE14), + 25 => Some(PC6_A::VALUE15), + 26 => Some(PC6_A::VALUE16), + 27 => Some(PC6_A::VALUE17), + 28 => Some(PC6_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC6_A::VALUE1 + **self == PC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC6_A::VALUE2 + **self == PC6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC6_A::VALUE3 + **self == PC6_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC6_A::VALUE4 + **self == PC6_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC6_A::VALUE5 + **self == PC6_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC6_A::VALUE6 + **self == PC6_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC6_A::VALUE7 + **self == PC6_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC6_A::VALUE8 + **self == PC6_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC6_A::VALUE9 + **self == PC6_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC6_A::VALUE10 + **self == PC6_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC6_A::VALUE11 + **self == PC6_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC6_A::VALUE12 + **self == PC6_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC6_A::VALUE13 + **self == PC6_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC6_A::VALUE14 + **self == PC6_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC6_A::VALUE15 + **self == PC6_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC6_A::VALUE16 + **self == PC6_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC6_A::VALUE17 + **self == PC6_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC6_A::VALUE18 + **self == PC6_A::VALUE18 + } +} +impl core::ops::Deref for PC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC6`"] +#[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] pub struct PC6_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC7`"] -pub type PC7_R = crate::R; +#[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC7_R(crate::FieldReader); impl PC7_R { + pub(crate) fn new(bits: u8) -> Self { + PC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC7_A::VALUE1), - 1 => Val(PC7_A::VALUE2), - 2 => Val(PC7_A::VALUE3), - 3 => Val(PC7_A::VALUE4), - 4 => Val(PC7_A::VALUE5), - 5 => Val(PC7_A::VALUE6), - 6 => Val(PC7_A::VALUE7), - 7 => Val(PC7_A::VALUE8), - 16 => Val(PC7_A::VALUE9), - 17 => Val(PC7_A::VALUE10), - 18 => Val(PC7_A::VALUE11), - 19 => Val(PC7_A::VALUE12), - 20 => Val(PC7_A::VALUE13), - 24 => Val(PC7_A::VALUE14), - 25 => Val(PC7_A::VALUE15), - 26 => Val(PC7_A::VALUE16), - 27 => Val(PC7_A::VALUE17), - 28 => Val(PC7_A::VALUE18), - i => Res(i), + 0 => Some(PC7_A::VALUE1), + 1 => Some(PC7_A::VALUE2), + 2 => Some(PC7_A::VALUE3), + 3 => Some(PC7_A::VALUE4), + 4 => Some(PC7_A::VALUE5), + 5 => Some(PC7_A::VALUE6), + 6 => Some(PC7_A::VALUE7), + 7 => Some(PC7_A::VALUE8), + 16 => Some(PC7_A::VALUE9), + 17 => Some(PC7_A::VALUE10), + 18 => Some(PC7_A::VALUE11), + 19 => Some(PC7_A::VALUE12), + 20 => Some(PC7_A::VALUE13), + 24 => Some(PC7_A::VALUE14), + 25 => Some(PC7_A::VALUE15), + 26 => Some(PC7_A::VALUE16), + 27 => Some(PC7_A::VALUE17), + 28 => Some(PC7_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC7_A::VALUE1 + **self == PC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC7_A::VALUE2 + **self == PC7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC7_A::VALUE3 + **self == PC7_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC7_A::VALUE4 + **self == PC7_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC7_A::VALUE5 + **self == PC7_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC7_A::VALUE6 + **self == PC7_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC7_A::VALUE7 + **self == PC7_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC7_A::VALUE8 + **self == PC7_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC7_A::VALUE9 + **self == PC7_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC7_A::VALUE10 + **self == PC7_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC7_A::VALUE11 + **self == PC7_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC7_A::VALUE12 + **self == PC7_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC7_A::VALUE13 + **self == PC7_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC7_A::VALUE14 + **self == PC7_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC7_A::VALUE15 + **self == PC7_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC7_A::VALUE16 + **self == PC7_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC7_A::VALUE17 + **self == PC7_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC7_A::VALUE18 + **self == PC7_A::VALUE18 + } +} +impl core::ops::Deref for PC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC7`"] +#[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] pub struct PC7_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc7(&mut self) -> PC7_W { PC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Input/Output Control Register 4\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 [iocr4](index.html) module"] +pub struct IOCR4_SPEC; +impl crate::RegisterSpec for IOCR4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr4::R](R) reader structure"] +impl crate::Readable for IOCR4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr4::W](W) writer structure"] +impl crate::Writable for IOCR4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR4 to value 0"] +impl crate::Resettable for IOCR4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port0/iocr8.rs b/src/port0/iocr8.rs index 00d96809..10a3c5d4 100644 --- a/src/port0/iocr8.rs +++ b/src/port0/iocr8.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR8"] -pub type R = crate::R; -#[doc = "Writer for register IOCR8"] -pub type W = crate::W; -#[doc = "Register IOCR8 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR8 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR8` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR8` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC8`"] -pub type PC8_R = crate::R; +#[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC8_R(crate::FieldReader); impl PC8_R { + pub(crate) fn new(bits: u8) -> Self { + PC8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC8_A::VALUE1), - 1 => Val(PC8_A::VALUE2), - 2 => Val(PC8_A::VALUE3), - 3 => Val(PC8_A::VALUE4), - 4 => Val(PC8_A::VALUE5), - 5 => Val(PC8_A::VALUE6), - 6 => Val(PC8_A::VALUE7), - 7 => Val(PC8_A::VALUE8), - 16 => Val(PC8_A::VALUE9), - 17 => Val(PC8_A::VALUE10), - 18 => Val(PC8_A::VALUE11), - 19 => Val(PC8_A::VALUE12), - 20 => Val(PC8_A::VALUE13), - 24 => Val(PC8_A::VALUE14), - 25 => Val(PC8_A::VALUE15), - 26 => Val(PC8_A::VALUE16), - 27 => Val(PC8_A::VALUE17), - 28 => Val(PC8_A::VALUE18), - i => Res(i), + 0 => Some(PC8_A::VALUE1), + 1 => Some(PC8_A::VALUE2), + 2 => Some(PC8_A::VALUE3), + 3 => Some(PC8_A::VALUE4), + 4 => Some(PC8_A::VALUE5), + 5 => Some(PC8_A::VALUE6), + 6 => Some(PC8_A::VALUE7), + 7 => Some(PC8_A::VALUE8), + 16 => Some(PC8_A::VALUE9), + 17 => Some(PC8_A::VALUE10), + 18 => Some(PC8_A::VALUE11), + 19 => Some(PC8_A::VALUE12), + 20 => Some(PC8_A::VALUE13), + 24 => Some(PC8_A::VALUE14), + 25 => Some(PC8_A::VALUE15), + 26 => Some(PC8_A::VALUE16), + 27 => Some(PC8_A::VALUE17), + 28 => Some(PC8_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC8_A::VALUE1 + **self == PC8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC8_A::VALUE2 + **self == PC8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC8_A::VALUE3 + **self == PC8_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC8_A::VALUE4 + **self == PC8_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC8_A::VALUE5 + **self == PC8_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC8_A::VALUE6 + **self == PC8_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC8_A::VALUE7 + **self == PC8_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC8_A::VALUE8 + **self == PC8_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC8_A::VALUE9 + **self == PC8_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC8_A::VALUE10 + **self == PC8_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC8_A::VALUE11 + **self == PC8_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC8_A::VALUE12 + **self == PC8_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC8_A::VALUE13 + **self == PC8_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC8_A::VALUE14 + **self == PC8_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC8_A::VALUE15 + **self == PC8_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC8_A::VALUE16 + **self == PC8_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC8_A::VALUE17 + **self == PC8_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC8_A::VALUE18 + **self == PC8_A::VALUE18 } } -#[doc = "Write proxy for field `PC8`"] +impl core::ops::Deref for PC8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] pub struct PC8_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC9`"] -pub type PC9_R = crate::R; +#[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC9_R(crate::FieldReader); impl PC9_R { + pub(crate) fn new(bits: u8) -> Self { + PC9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC9_A::VALUE1), - 1 => Val(PC9_A::VALUE2), - 2 => Val(PC9_A::VALUE3), - 3 => Val(PC9_A::VALUE4), - 4 => Val(PC9_A::VALUE5), - 5 => Val(PC9_A::VALUE6), - 6 => Val(PC9_A::VALUE7), - 7 => Val(PC9_A::VALUE8), - 16 => Val(PC9_A::VALUE9), - 17 => Val(PC9_A::VALUE10), - 18 => Val(PC9_A::VALUE11), - 19 => Val(PC9_A::VALUE12), - 20 => Val(PC9_A::VALUE13), - 24 => Val(PC9_A::VALUE14), - 25 => Val(PC9_A::VALUE15), - 26 => Val(PC9_A::VALUE16), - 27 => Val(PC9_A::VALUE17), - 28 => Val(PC9_A::VALUE18), - i => Res(i), + 0 => Some(PC9_A::VALUE1), + 1 => Some(PC9_A::VALUE2), + 2 => Some(PC9_A::VALUE3), + 3 => Some(PC9_A::VALUE4), + 4 => Some(PC9_A::VALUE5), + 5 => Some(PC9_A::VALUE6), + 6 => Some(PC9_A::VALUE7), + 7 => Some(PC9_A::VALUE8), + 16 => Some(PC9_A::VALUE9), + 17 => Some(PC9_A::VALUE10), + 18 => Some(PC9_A::VALUE11), + 19 => Some(PC9_A::VALUE12), + 20 => Some(PC9_A::VALUE13), + 24 => Some(PC9_A::VALUE14), + 25 => Some(PC9_A::VALUE15), + 26 => Some(PC9_A::VALUE16), + 27 => Some(PC9_A::VALUE17), + 28 => Some(PC9_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC9_A::VALUE1 + **self == PC9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC9_A::VALUE2 + **self == PC9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC9_A::VALUE3 + **self == PC9_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC9_A::VALUE4 + **self == PC9_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC9_A::VALUE5 + **self == PC9_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC9_A::VALUE6 + **self == PC9_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC9_A::VALUE7 + **self == PC9_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC9_A::VALUE8 + **self == PC9_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC9_A::VALUE9 + **self == PC9_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC9_A::VALUE10 + **self == PC9_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC9_A::VALUE11 + **self == PC9_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC9_A::VALUE12 + **self == PC9_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC9_A::VALUE13 + **self == PC9_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC9_A::VALUE14 + **self == PC9_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC9_A::VALUE15 + **self == PC9_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC9_A::VALUE16 + **self == PC9_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC9_A::VALUE17 + **self == PC9_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC9_A::VALUE18 + **self == PC9_A::VALUE18 } } -#[doc = "Write proxy for field `PC9`"] +impl core::ops::Deref for PC9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] pub struct PC9_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC10`"] -pub type PC10_R = crate::R; +#[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC10_R(crate::FieldReader); impl PC10_R { + pub(crate) fn new(bits: u8) -> Self { + PC10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC10_A::VALUE1), - 1 => Val(PC10_A::VALUE2), - 2 => Val(PC10_A::VALUE3), - 3 => Val(PC10_A::VALUE4), - 4 => Val(PC10_A::VALUE5), - 5 => Val(PC10_A::VALUE6), - 6 => Val(PC10_A::VALUE7), - 7 => Val(PC10_A::VALUE8), - 16 => Val(PC10_A::VALUE9), - 17 => Val(PC10_A::VALUE10), - 18 => Val(PC10_A::VALUE11), - 19 => Val(PC10_A::VALUE12), - 20 => Val(PC10_A::VALUE13), - 24 => Val(PC10_A::VALUE14), - 25 => Val(PC10_A::VALUE15), - 26 => Val(PC10_A::VALUE16), - 27 => Val(PC10_A::VALUE17), - 28 => Val(PC10_A::VALUE18), - i => Res(i), + 0 => Some(PC10_A::VALUE1), + 1 => Some(PC10_A::VALUE2), + 2 => Some(PC10_A::VALUE3), + 3 => Some(PC10_A::VALUE4), + 4 => Some(PC10_A::VALUE5), + 5 => Some(PC10_A::VALUE6), + 6 => Some(PC10_A::VALUE7), + 7 => Some(PC10_A::VALUE8), + 16 => Some(PC10_A::VALUE9), + 17 => Some(PC10_A::VALUE10), + 18 => Some(PC10_A::VALUE11), + 19 => Some(PC10_A::VALUE12), + 20 => Some(PC10_A::VALUE13), + 24 => Some(PC10_A::VALUE14), + 25 => Some(PC10_A::VALUE15), + 26 => Some(PC10_A::VALUE16), + 27 => Some(PC10_A::VALUE17), + 28 => Some(PC10_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC10_A::VALUE1 + **self == PC10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC10_A::VALUE2 + **self == PC10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC10_A::VALUE3 + **self == PC10_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC10_A::VALUE4 + **self == PC10_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC10_A::VALUE5 + **self == PC10_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC10_A::VALUE6 + **self == PC10_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC10_A::VALUE7 + **self == PC10_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC10_A::VALUE8 + **self == PC10_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC10_A::VALUE9 + **self == PC10_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC10_A::VALUE10 + **self == PC10_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC10_A::VALUE11 + **self == PC10_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC10_A::VALUE12 + **self == PC10_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC10_A::VALUE13 + **self == PC10_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC10_A::VALUE14 + **self == PC10_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC10_A::VALUE15 + **self == PC10_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC10_A::VALUE16 + **self == PC10_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC10_A::VALUE17 + **self == PC10_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC10_A::VALUE18 + **self == PC10_A::VALUE18 + } +} +impl core::ops::Deref for PC10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC10`"] +#[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] pub struct PC10_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC11`"] -pub type PC11_R = crate::R; +#[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC11_R(crate::FieldReader); impl PC11_R { + pub(crate) fn new(bits: u8) -> Self { + PC11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC11_A::VALUE1), - 1 => Val(PC11_A::VALUE2), - 2 => Val(PC11_A::VALUE3), - 3 => Val(PC11_A::VALUE4), - 4 => Val(PC11_A::VALUE5), - 5 => Val(PC11_A::VALUE6), - 6 => Val(PC11_A::VALUE7), - 7 => Val(PC11_A::VALUE8), - 16 => Val(PC11_A::VALUE9), - 17 => Val(PC11_A::VALUE10), - 18 => Val(PC11_A::VALUE11), - 19 => Val(PC11_A::VALUE12), - 20 => Val(PC11_A::VALUE13), - 24 => Val(PC11_A::VALUE14), - 25 => Val(PC11_A::VALUE15), - 26 => Val(PC11_A::VALUE16), - 27 => Val(PC11_A::VALUE17), - 28 => Val(PC11_A::VALUE18), - i => Res(i), + 0 => Some(PC11_A::VALUE1), + 1 => Some(PC11_A::VALUE2), + 2 => Some(PC11_A::VALUE3), + 3 => Some(PC11_A::VALUE4), + 4 => Some(PC11_A::VALUE5), + 5 => Some(PC11_A::VALUE6), + 6 => Some(PC11_A::VALUE7), + 7 => Some(PC11_A::VALUE8), + 16 => Some(PC11_A::VALUE9), + 17 => Some(PC11_A::VALUE10), + 18 => Some(PC11_A::VALUE11), + 19 => Some(PC11_A::VALUE12), + 20 => Some(PC11_A::VALUE13), + 24 => Some(PC11_A::VALUE14), + 25 => Some(PC11_A::VALUE15), + 26 => Some(PC11_A::VALUE16), + 27 => Some(PC11_A::VALUE17), + 28 => Some(PC11_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC11_A::VALUE1 + **self == PC11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC11_A::VALUE2 + **self == PC11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC11_A::VALUE3 + **self == PC11_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC11_A::VALUE4 + **self == PC11_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC11_A::VALUE5 + **self == PC11_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC11_A::VALUE6 + **self == PC11_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC11_A::VALUE7 + **self == PC11_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC11_A::VALUE8 + **self == PC11_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC11_A::VALUE9 + **self == PC11_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC11_A::VALUE10 + **self == PC11_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC11_A::VALUE11 + **self == PC11_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC11_A::VALUE12 + **self == PC11_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC11_A::VALUE13 + **self == PC11_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC11_A::VALUE14 + **self == PC11_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC11_A::VALUE15 + **self == PC11_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC11_A::VALUE16 + **self == PC11_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC11_A::VALUE17 + **self == PC11_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC11_A::VALUE18 + **self == PC11_A::VALUE18 + } +} +impl core::ops::Deref for PC11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC11`"] +#[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] pub struct PC11_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc11(&mut self) -> PC11_W { PC11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Input/Output Control Register 8\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 [iocr8](index.html) module"] +pub struct IOCR8_SPEC; +impl crate::RegisterSpec for IOCR8_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr8::R](R) reader structure"] +impl crate::Readable for IOCR8_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr8::W](W) writer structure"] +impl crate::Writable for IOCR8_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR8 to value 0"] +impl crate::Resettable for IOCR8_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port0/omr.rs b/src/port0/omr.rs index c8c458f2..f08386eb 100644 --- a/src/port0/omr.rs +++ b/src/port0/omr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OMR"] -pub type W = crate::W; -#[doc = "Register OMR `reset()`'s with value 0"] -impl crate::ResetValue for super::OMR { - type Type = u32; +#[doc = "Register `OMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `PS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PS0` writer - Port n Set Bit 0"] pub struct PS0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> PS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `PS1`"] +#[doc = "Field `PS1` writer - Port n Set Bit 1"] pub struct PS1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> PS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS2`"] +#[doc = "Field `PS2` writer - Port n Set Bit 2"] pub struct PS2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS3`"] +#[doc = "Field `PS3` writer - Port n Set Bit 3"] pub struct PS3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS4`"] +#[doc = "Field `PS4` writer - Port n Set Bit 4"] pub struct PS4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PS5`"] +#[doc = "Field `PS5` writer - Port n Set Bit 5"] pub struct PS5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `PS6`"] +#[doc = "Field `PS6` writer - Port n Set Bit 6"] pub struct PS6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> PS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `PS7`"] +#[doc = "Field `PS7` writer - Port n Set Bit 7"] pub struct PS7_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `PS8`"] +#[doc = "Field `PS8` writer - Port n Set Bit 8"] pub struct PS8_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PS9`"] +#[doc = "Field `PS9` writer - Port n Set Bit 9"] pub struct PS9_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS10`"] +#[doc = "Field `PS10` writer - Port n Set Bit 10"] pub struct PS10_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> PS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS11`"] +#[doc = "Field `PS11` writer - Port n Set Bit 11"] pub struct PS11_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> PS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS12`"] +#[doc = "Field `PS12` writer - Port n Set Bit 12"] pub struct PS12_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `PS13`"] +#[doc = "Field `PS13` writer - Port n Set Bit 13"] pub struct PS13_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `PS14`"] +#[doc = "Field `PS14` writer - Port n Set Bit 14"] pub struct PS14_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> PS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `PS15`"] +#[doc = "Field `PS15` writer - Port n Set Bit 15"] pub struct PS15_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> PS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Write proxy for field `PR0`"] +#[doc = "Field `PR0` writer - Port n Reset Bit 0"] pub struct PR0_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> PR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `PR1`"] +#[doc = "Field `PR1` writer - Port n Reset Bit 1"] pub struct PR1_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> PR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PR2`"] +#[doc = "Field `PR2` writer - Port n Reset Bit 2"] pub struct PR2_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> PR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PR3`"] +#[doc = "Field `PR3` writer - Port n Reset Bit 3"] pub struct PR3_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> PR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PR4`"] +#[doc = "Field `PR4` writer - Port n Reset Bit 4"] pub struct PR4_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> PR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `PR5`"] +#[doc = "Field `PR5` writer - Port n Reset Bit 5"] pub struct PR5_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> PR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `PR6`"] +#[doc = "Field `PR6` writer - Port n Reset Bit 6"] pub struct PR6_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> PR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `PR7`"] +#[doc = "Field `PR7` writer - Port n Reset Bit 7"] pub struct PR7_W<'a> { w: &'a mut W, } @@ -532,11 +543,11 @@ impl<'a> PR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `PR8`"] +#[doc = "Field `PR8` writer - Port n Reset Bit 8"] pub struct PR8_W<'a> { w: &'a mut W, } @@ -554,11 +565,11 @@ impl<'a> PR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `PR9`"] +#[doc = "Field `PR9` writer - Port n Reset Bit 9"] pub struct PR9_W<'a> { w: &'a mut W, } @@ -576,11 +587,11 @@ impl<'a> PR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `PR10`"] +#[doc = "Field `PR10` writer - Port n Reset Bit 10"] pub struct PR10_W<'a> { w: &'a mut W, } @@ -598,11 +609,11 @@ impl<'a> PR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `PR11`"] +#[doc = "Field `PR11` writer - Port n Reset Bit 11"] pub struct PR11_W<'a> { w: &'a mut W, } @@ -620,11 +631,11 @@ impl<'a> PR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `PR12`"] +#[doc = "Field `PR12` writer - Port n Reset Bit 12"] pub struct PR12_W<'a> { w: &'a mut W, } @@ -642,11 +653,11 @@ impl<'a> PR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `PR13`"] +#[doc = "Field `PR13` writer - Port n Reset Bit 13"] pub struct PR13_W<'a> { w: &'a mut W, } @@ -664,11 +675,11 @@ impl<'a> PR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Write proxy for field `PR14`"] +#[doc = "Field `PR14` writer - Port n Reset Bit 14"] pub struct PR14_W<'a> { w: &'a mut W, } @@ -686,11 +697,11 @@ impl<'a> PR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Write proxy for field `PR15`"] +#[doc = "Field `PR15` writer - Port n Reset Bit 15"] pub struct PR15_W<'a> { w: &'a mut W, } @@ -708,7 +719,7 @@ impl<'a> PR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -873,4 +884,26 @@ impl W { pub fn pr15(&mut self) -> PR15_W { PR15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Output Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](index.html) module"] +pub struct OMR_SPEC; +impl crate::RegisterSpec for OMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +impl crate::Writable for OMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OMR to value 0"] +impl crate::Resettable for OMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port0/out.rs b/src/port0/out.rs index 234afddb..c6e1f52d 100644 --- a/src/port0/out.rs +++ b/src/port0/out.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OUT"] -pub type R = crate::R; -#[doc = "Writer for register OUT"] -pub type W = crate::W; -#[doc = "Register OUT `reset()`'s with value 0"] -impl crate::ResetValue for super::OUT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Output Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -38,15 +65,22 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 } } -#[doc = "Write proxy for field `P0`"] +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P0` writer - Port n Output Bit 0"] pub struct P0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Output Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -113,15 +148,22 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 } } -#[doc = "Write proxy for field `P1`"] +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P1` writer - Port n Output Bit 1"] pub struct P1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Output Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -188,15 +231,22 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P2`"] +#[doc = "Field `P2` writer - Port n Output Bit 2"] pub struct P2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Output Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -263,15 +314,22 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P3`"] +#[doc = "Field `P3` writer - Port n Output Bit 3"] pub struct P3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Output Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -338,15 +397,22 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P4`"] +#[doc = "Field `P4` writer - Port n Output Bit 4"] pub struct P4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Output Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -413,15 +480,22 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P5`"] +#[doc = "Field `P5` writer - Port n Output Bit 5"] pub struct P5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Output Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -488,15 +563,22 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 } } -#[doc = "Write proxy for field `P6`"] +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P6` writer - Port n Output Bit 6"] pub struct P6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Output Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -563,15 +646,22 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 } } -#[doc = "Write proxy for field `P7`"] +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P7` writer - Port n Output Bit 7"] pub struct P7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Output Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -638,15 +729,22 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 } } -#[doc = "Write proxy for field `P8`"] +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P8` writer - Port n Output Bit 8"] pub struct P8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Output Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -713,15 +812,22 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P9`"] +#[doc = "Field `P9` writer - Port n Output Bit 9"] pub struct P9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Output Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -788,15 +895,22 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 } } -#[doc = "Write proxy for field `P10`"] +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P10` writer - Port n Output Bit 10"] pub struct P10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Output Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -863,15 +978,22 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 } } -#[doc = "Write proxy for field `P11`"] +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P11` writer - Port n Output Bit 11"] pub struct P11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Output Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -938,15 +1061,22 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P12`"] +#[doc = "Field `P12` writer - Port n Output Bit 12"] pub struct P12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Output Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -1013,15 +1144,22 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 } } -#[doc = "Write proxy for field `P13`"] +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P13` writer - Port n Output Bit 13"] pub struct P13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Output Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -1088,15 +1227,22 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 } } -#[doc = "Write proxy for field `P14`"] +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P14` writer - Port n Output Bit 14"] pub struct P14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Output Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -1163,15 +1310,22 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 } } -#[doc = "Write proxy for field `P15`"] +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P15` writer - Port n Output Bit 15"] pub struct P15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn p15(&mut self) -> P15_W { P15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Output Register\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 [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port0/pdisc.rs b/src/port0/pdisc.rs index dad72964..770b981c 100644 --- a/src/port0/pdisc.rs +++ b/src/port0/pdisc.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PDISC"] -pub type R = crate::R; +#[doc = "Register `PDISC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PDIS0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS0`"] -pub type PDIS0_R = crate::R; +#[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] +pub struct PDIS0_R(crate::FieldReader); impl PDIS0_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS0_A { @@ -28,12 +44,19 @@ impl PDIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS0_A::VALUE1 + **self == PDIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS0_A::VALUE2 + **self == PDIS0_A::VALUE2 + } +} +impl core::ops::Deref for PDIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS1`"] -pub type PDIS1_R = crate::R; +#[doc = "Field `PDIS1` reader - Pad Disable for Port n Pin 1"] +pub struct PDIS1_R(crate::FieldReader); impl PDIS1_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS1_A { @@ -64,12 +90,19 @@ impl PDIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS1_A::VALUE1 + **self == PDIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS1_A::VALUE2 + **self == PDIS1_A::VALUE2 + } +} +impl core::ops::Deref for PDIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS2`"] -pub type PDIS2_R = crate::R; +#[doc = "Field `PDIS2` reader - Pad Disable for Port n Pin 2"] +pub struct PDIS2_R(crate::FieldReader); impl PDIS2_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS2_A { @@ -100,12 +136,19 @@ impl PDIS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS2_A::VALUE1 + **self == PDIS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS2_A::VALUE2 + **self == PDIS2_A::VALUE2 + } +} +impl core::ops::Deref for PDIS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS3`"] -pub type PDIS3_R = crate::R; +#[doc = "Field `PDIS3` reader - Pad Disable for Port n Pin 3"] +pub struct PDIS3_R(crate::FieldReader); impl PDIS3_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS3_A { @@ -136,12 +182,19 @@ impl PDIS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS3_A::VALUE1 + **self == PDIS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS3_A::VALUE2 + **self == PDIS3_A::VALUE2 + } +} +impl core::ops::Deref for PDIS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS4`"] -pub type PDIS4_R = crate::R; +#[doc = "Field `PDIS4` reader - Pad Disable for Port n Pin 4"] +pub struct PDIS4_R(crate::FieldReader); impl PDIS4_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS4_A { @@ -172,12 +228,19 @@ impl PDIS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS4_A::VALUE1 + **self == PDIS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS4_A::VALUE2 + **self == PDIS4_A::VALUE2 + } +} +impl core::ops::Deref for PDIS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS5`"] -pub type PDIS5_R = crate::R; +#[doc = "Field `PDIS5` reader - Pad Disable for Port n Pin 5"] +pub struct PDIS5_R(crate::FieldReader); impl PDIS5_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS5_A { @@ -208,12 +274,19 @@ impl PDIS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS5_A::VALUE1 + **self == PDIS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS5_A::VALUE2 + **self == PDIS5_A::VALUE2 + } +} +impl core::ops::Deref for PDIS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS6`"] -pub type PDIS6_R = crate::R; +#[doc = "Field `PDIS6` reader - Pad Disable for Port n Pin 6"] +pub struct PDIS6_R(crate::FieldReader); impl PDIS6_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS6_A { @@ -244,12 +320,19 @@ impl PDIS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS6_A::VALUE1 + **self == PDIS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS6_A::VALUE2 + **self == PDIS6_A::VALUE2 + } +} +impl core::ops::Deref for PDIS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS7`"] -pub type PDIS7_R = crate::R; +#[doc = "Field `PDIS7` reader - Pad Disable for Port n Pin 7"] +pub struct PDIS7_R(crate::FieldReader); impl PDIS7_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS7_A { @@ -280,12 +366,19 @@ impl PDIS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS7_A::VALUE1 + **self == PDIS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS7_A::VALUE2 + **self == PDIS7_A::VALUE2 + } +} +impl core::ops::Deref for PDIS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS8`"] -pub type PDIS8_R = crate::R; +#[doc = "Field `PDIS8` reader - Pad Disable for Port n Pin 8"] +pub struct PDIS8_R(crate::FieldReader); impl PDIS8_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS8_A { @@ -316,12 +412,19 @@ impl PDIS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS8_A::VALUE1 + **self == PDIS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS8_A::VALUE2 + **self == PDIS8_A::VALUE2 + } +} +impl core::ops::Deref for PDIS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS9`"] -pub type PDIS9_R = crate::R; +#[doc = "Field `PDIS9` reader - Pad Disable for Port n Pin 9"] +pub struct PDIS9_R(crate::FieldReader); impl PDIS9_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS9_A { @@ -352,12 +458,19 @@ impl PDIS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS9_A::VALUE1 + **self == PDIS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS9_A::VALUE2 + **self == PDIS9_A::VALUE2 + } +} +impl core::ops::Deref for PDIS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS10`"] -pub type PDIS10_R = crate::R; +#[doc = "Field `PDIS10` reader - Pad Disable for Port n Pin 10"] +pub struct PDIS10_R(crate::FieldReader); impl PDIS10_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS10_A { @@ -388,12 +504,19 @@ impl PDIS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS10_A::VALUE1 + **self == PDIS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS10_A::VALUE2 + **self == PDIS10_A::VALUE2 + } +} +impl core::ops::Deref for PDIS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS11`"] -pub type PDIS11_R = crate::R; +#[doc = "Field `PDIS11` reader - Pad Disable for Port n Pin 11"] +pub struct PDIS11_R(crate::FieldReader); impl PDIS11_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS11_A { @@ -424,12 +550,19 @@ impl PDIS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS11_A::VALUE1 + **self == PDIS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS11_A::VALUE2 + **self == PDIS11_A::VALUE2 + } +} +impl core::ops::Deref for PDIS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS12`"] -pub type PDIS12_R = crate::R; +#[doc = "Field `PDIS12` reader - Pad Disable for Port n Pin 12"] +pub struct PDIS12_R(crate::FieldReader); impl PDIS12_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS12_A { @@ -460,12 +596,19 @@ impl PDIS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS12_A::VALUE1 + **self == PDIS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS12_A::VALUE2 + **self == PDIS12_A::VALUE2 + } +} +impl core::ops::Deref for PDIS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS13`"] -pub type PDIS13_R = crate::R; +#[doc = "Field `PDIS13` reader - Pad Disable for Port n Pin 13"] +pub struct PDIS13_R(crate::FieldReader); impl PDIS13_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS13_A { @@ -496,12 +642,19 @@ impl PDIS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS13_A::VALUE1 + **self == PDIS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS13_A::VALUE2 + **self == PDIS13_A::VALUE2 + } +} +impl core::ops::Deref for PDIS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS14`"] -pub type PDIS14_R = crate::R; +#[doc = "Field `PDIS14` reader - Pad Disable for Port n Pin 14"] +pub struct PDIS14_R(crate::FieldReader); impl PDIS14_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS14_A { @@ -532,12 +688,19 @@ impl PDIS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS14_A::VALUE1 + **self == PDIS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS14_A::VALUE2 + **self == PDIS14_A::VALUE2 + } +} +impl core::ops::Deref for PDIS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS15`"] -pub type PDIS15_R = crate::R; +#[doc = "Field `PDIS15` reader - Pad Disable for Port n Pin 15"] +pub struct PDIS15_R(crate::FieldReader); impl PDIS15_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS15_A { @@ -568,12 +734,19 @@ impl PDIS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS15_A::VALUE1 + **self == PDIS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS15_A::VALUE2 + **self == PDIS15_A::VALUE2 + } +} +impl core::ops::Deref for PDIS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 0 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](index.html) module"] +pub struct PDISC_SPEC; +impl crate::RegisterSpec for PDISC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdisc::R](R) reader structure"] +impl crate::Readable for PDISC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PDISC to value 0"] +impl crate::Resettable for PDISC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port0/pdr0.rs b/src/port0/pdr0.rs index 0923fc4a..de61cf93 100644 --- a/src/port0/pdr0.rs +++ b/src/port0/pdr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR0"] -pub type R = crate::R; -#[doc = "Writer for register PDR0"] -pub type W = crate::W; -#[doc = "Register PDR0 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] +pub struct PD0_R(crate::FieldReader); +impl PD0_R { + pub(crate) fn new(bits: u8) -> Self { + PD0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD0`"] -pub type PD0_R = crate::R; -#[doc = "Write proxy for field `PD0`"] +impl core::ops::Deref for PD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] pub struct PD0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD1`"] -pub type PD1_R = crate::R; -#[doc = "Write proxy for field `PD1`"] +#[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] +pub struct PD1_R(crate::FieldReader); +impl PD1_R { + pub(crate) fn new(bits: u8) -> Self { + PD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] pub struct PD1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD2`"] -pub type PD2_R = crate::R; -#[doc = "Write proxy for field `PD2`"] +#[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] +pub struct PD2_R(crate::FieldReader); +impl PD2_R { + pub(crate) fn new(bits: u8) -> Self { + PD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] pub struct PD2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD3`"] -pub type PD3_R = crate::R; -#[doc = "Write proxy for field `PD3`"] +#[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] +pub struct PD3_R(crate::FieldReader); +impl PD3_R { + pub(crate) fn new(bits: u8) -> Self { + PD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] pub struct PD3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD4`"] -pub type PD4_R = crate::R; -#[doc = "Write proxy for field `PD4`"] +#[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] +pub struct PD4_R(crate::FieldReader); +impl PD4_R { + pub(crate) fn new(bits: u8) -> Self { + PD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] pub struct PD4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD5`"] -pub type PD5_R = crate::R; -#[doc = "Write proxy for field `PD5`"] +#[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] +pub struct PD5_R(crate::FieldReader); +impl PD5_R { + pub(crate) fn new(bits: u8) -> Self { + PD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] pub struct PD5_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD6`"] -pub type PD6_R = crate::R; -#[doc = "Write proxy for field `PD6`"] +#[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] +pub struct PD6_R(crate::FieldReader); +impl PD6_R { + pub(crate) fn new(bits: u8) -> Self { + PD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] pub struct PD6_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD7`"] -pub type PD7_R = crate::R; -#[doc = "Write proxy for field `PD7`"] +#[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] +pub struct PD7_R(crate::FieldReader); +impl PD7_R { + pub(crate) fn new(bits: u8) -> Self { + PD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] pub struct PD7_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd7(&mut self) -> PD7_W { PD7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Pad Driver Mode 0 Register\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 [pdr0](index.html) module"] +pub struct PDR0_SPEC; +impl crate::RegisterSpec for PDR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr0::R](R) reader structure"] +impl crate::Readable for PDR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr0::W](W) writer structure"] +impl crate::Writable for PDR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR0 to value 0x2222_2222"] +impl crate::Resettable for PDR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port0/pdr1.rs b/src/port0/pdr1.rs index 2587bf70..aef6314d 100644 --- a/src/port0/pdr1.rs +++ b/src/port0/pdr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR1"] -pub type R = crate::R; -#[doc = "Writer for register PDR1"] -pub type W = crate::W; -#[doc = "Register PDR1 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] +pub struct PD8_R(crate::FieldReader); +impl PD8_R { + pub(crate) fn new(bits: u8) -> Self { + PD8_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD8`"] -pub type PD8_R = crate::R; -#[doc = "Write proxy for field `PD8`"] +impl core::ops::Deref for PD8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] pub struct PD8_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD9`"] -pub type PD9_R = crate::R; -#[doc = "Write proxy for field `PD9`"] +#[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] +pub struct PD9_R(crate::FieldReader); +impl PD9_R { + pub(crate) fn new(bits: u8) -> Self { + PD9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] pub struct PD9_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD10`"] -pub type PD10_R = crate::R; -#[doc = "Write proxy for field `PD10`"] +#[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] +pub struct PD10_R(crate::FieldReader); +impl PD10_R { + pub(crate) fn new(bits: u8) -> Self { + PD10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] pub struct PD10_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD11`"] -pub type PD11_R = crate::R; -#[doc = "Write proxy for field `PD11`"] +#[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] +pub struct PD11_R(crate::FieldReader); +impl PD11_R { + pub(crate) fn new(bits: u8) -> Self { + PD11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] pub struct PD11_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD12`"] -pub type PD12_R = crate::R; -#[doc = "Write proxy for field `PD12`"] +#[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] +pub struct PD12_R(crate::FieldReader); +impl PD12_R { + pub(crate) fn new(bits: u8) -> Self { + PD12_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] pub struct PD12_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD13`"] -pub type PD13_R = crate::R; -#[doc = "Write proxy for field `PD13`"] +#[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] +pub struct PD13_R(crate::FieldReader); +impl PD13_R { + pub(crate) fn new(bits: u8) -> Self { + PD13_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] pub struct PD13_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD14`"] -pub type PD14_R = crate::R; -#[doc = "Write proxy for field `PD14`"] +#[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] +pub struct PD14_R(crate::FieldReader); +impl PD14_R { + pub(crate) fn new(bits: u8) -> Self { + PD14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] pub struct PD14_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD15`"] -pub type PD15_R = crate::R; -#[doc = "Write proxy for field `PD15`"] +#[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] +pub struct PD15_R(crate::FieldReader); +impl PD15_R { + pub(crate) fn new(bits: u8) -> Self { + PD15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] pub struct PD15_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd15(&mut self) -> PD15_W { PD15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Pad Driver Mode 1 Register\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 [pdr1](index.html) module"] +pub struct PDR1_SPEC; +impl crate::RegisterSpec for PDR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr1::R](R) reader structure"] +impl crate::Readable for PDR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr1::W](W) writer structure"] +impl crate::Writable for PDR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR1 to value 0x2222_2222"] +impl crate::Resettable for PDR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port0/pps.rs b/src/port0/pps.rs index b45c5930..05f1dc70 100644 --- a/src/port0/pps.rs +++ b/src/port0/pps.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PPS"] -pub type R = crate::R; -#[doc = "Writer for register PPS"] -pub type W = crate::W; -#[doc = "Register PPS `reset()`'s with value 0"] -impl crate::ResetValue for super::PPS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS0`"] -pub type PPS0_R = crate::R; +#[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] +pub struct PPS0_R(crate::FieldReader); impl PPS0_R { + pub(crate) fn new(bits: bool) -> Self { + PPS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS0_A { @@ -38,15 +65,22 @@ impl PPS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS0_A::VALUE1 + **self == PPS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS0_A::VALUE2 + **self == PPS0_A::VALUE2 } } -#[doc = "Write proxy for field `PPS0`"] +impl core::ops::Deref for PPS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] pub struct PPS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS1`"] -pub type PPS1_R = crate::R; +#[doc = "Field `PPS1` reader - Port n Pin Power Save Bit 1"] +pub struct PPS1_R(crate::FieldReader); impl PPS1_R { + pub(crate) fn new(bits: bool) -> Self { + PPS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS1_A { @@ -113,15 +148,22 @@ impl PPS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS1_A::VALUE1 + **self == PPS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS1_A::VALUE2 + **self == PPS1_A::VALUE2 } } -#[doc = "Write proxy for field `PPS1`"] +impl core::ops::Deref for PPS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] pub struct PPS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS2`"] -pub type PPS2_R = crate::R; +#[doc = "Field `PPS2` reader - Port n Pin Power Save Bit 2"] +pub struct PPS2_R(crate::FieldReader); impl PPS2_R { + pub(crate) fn new(bits: bool) -> Self { + PPS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS2_A { @@ -188,15 +231,22 @@ impl PPS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS2_A::VALUE1 + **self == PPS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS2_A::VALUE2 + **self == PPS2_A::VALUE2 + } +} +impl core::ops::Deref for PPS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS2`"] +#[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] pub struct PPS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS3`"] -pub type PPS3_R = crate::R; +#[doc = "Field `PPS3` reader - Port n Pin Power Save Bit 3"] +pub struct PPS3_R(crate::FieldReader); impl PPS3_R { + pub(crate) fn new(bits: bool) -> Self { + PPS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS3_A { @@ -263,15 +314,22 @@ impl PPS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS3_A::VALUE1 + **self == PPS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS3_A::VALUE2 + **self == PPS3_A::VALUE2 + } +} +impl core::ops::Deref for PPS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS3`"] +#[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] pub struct PPS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS4`"] -pub type PPS4_R = crate::R; +#[doc = "Field `PPS4` reader - Port n Pin Power Save Bit 4"] +pub struct PPS4_R(crate::FieldReader); impl PPS4_R { + pub(crate) fn new(bits: bool) -> Self { + PPS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS4_A { @@ -338,15 +397,22 @@ impl PPS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS4_A::VALUE1 + **self == PPS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS4_A::VALUE2 + **self == PPS4_A::VALUE2 + } +} +impl core::ops::Deref for PPS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS4`"] +#[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] pub struct PPS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS5`"] -pub type PPS5_R = crate::R; +#[doc = "Field `PPS5` reader - Port n Pin Power Save Bit 5"] +pub struct PPS5_R(crate::FieldReader); impl PPS5_R { + pub(crate) fn new(bits: bool) -> Self { + PPS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS5_A { @@ -413,15 +480,22 @@ impl PPS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS5_A::VALUE1 + **self == PPS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS5_A::VALUE2 + **self == PPS5_A::VALUE2 + } +} +impl core::ops::Deref for PPS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS5`"] +#[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] pub struct PPS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS6`"] -pub type PPS6_R = crate::R; +#[doc = "Field `PPS6` reader - Port n Pin Power Save Bit 6"] +pub struct PPS6_R(crate::FieldReader); impl PPS6_R { + pub(crate) fn new(bits: bool) -> Self { + PPS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS6_A { @@ -488,15 +563,22 @@ impl PPS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS6_A::VALUE1 + **self == PPS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS6_A::VALUE2 + **self == PPS6_A::VALUE2 } } -#[doc = "Write proxy for field `PPS6`"] +impl core::ops::Deref for PPS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] pub struct PPS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS7`"] -pub type PPS7_R = crate::R; +#[doc = "Field `PPS7` reader - Port n Pin Power Save Bit 7"] +pub struct PPS7_R(crate::FieldReader); impl PPS7_R { + pub(crate) fn new(bits: bool) -> Self { + PPS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS7_A { @@ -563,15 +646,22 @@ impl PPS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS7_A::VALUE1 + **self == PPS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS7_A::VALUE2 + **self == PPS7_A::VALUE2 } } -#[doc = "Write proxy for field `PPS7`"] +impl core::ops::Deref for PPS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] pub struct PPS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS8`"] -pub type PPS8_R = crate::R; +#[doc = "Field `PPS8` reader - Port n Pin Power Save Bit 8"] +pub struct PPS8_R(crate::FieldReader); impl PPS8_R { + pub(crate) fn new(bits: bool) -> Self { + PPS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS8_A { @@ -638,15 +729,22 @@ impl PPS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS8_A::VALUE1 + **self == PPS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS8_A::VALUE2 + **self == PPS8_A::VALUE2 } } -#[doc = "Write proxy for field `PPS8`"] +impl core::ops::Deref for PPS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] pub struct PPS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS9`"] -pub type PPS9_R = crate::R; +#[doc = "Field `PPS9` reader - Port n Pin Power Save Bit 9"] +pub struct PPS9_R(crate::FieldReader); impl PPS9_R { + pub(crate) fn new(bits: bool) -> Self { + PPS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS9_A { @@ -713,15 +812,22 @@ impl PPS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS9_A::VALUE1 + **self == PPS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS9_A::VALUE2 + **self == PPS9_A::VALUE2 + } +} +impl core::ops::Deref for PPS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS9`"] +#[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] pub struct PPS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS10`"] -pub type PPS10_R = crate::R; +#[doc = "Field `PPS10` reader - Port n Pin Power Save Bit 10"] +pub struct PPS10_R(crate::FieldReader); impl PPS10_R { + pub(crate) fn new(bits: bool) -> Self { + PPS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS10_A { @@ -788,15 +895,22 @@ impl PPS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS10_A::VALUE1 + **self == PPS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS10_A::VALUE2 + **self == PPS10_A::VALUE2 } } -#[doc = "Write proxy for field `PPS10`"] +impl core::ops::Deref for PPS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] pub struct PPS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS11`"] -pub type PPS11_R = crate::R; +#[doc = "Field `PPS11` reader - Port n Pin Power Save Bit 11"] +pub struct PPS11_R(crate::FieldReader); impl PPS11_R { + pub(crate) fn new(bits: bool) -> Self { + PPS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS11_A { @@ -863,15 +978,22 @@ impl PPS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS11_A::VALUE1 + **self == PPS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS11_A::VALUE2 + **self == PPS11_A::VALUE2 } } -#[doc = "Write proxy for field `PPS11`"] +impl core::ops::Deref for PPS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] pub struct PPS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS12`"] -pub type PPS12_R = crate::R; +#[doc = "Field `PPS12` reader - Port n Pin Power Save Bit 12"] +pub struct PPS12_R(crate::FieldReader); impl PPS12_R { + pub(crate) fn new(bits: bool) -> Self { + PPS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS12_A { @@ -938,15 +1061,22 @@ impl PPS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS12_A::VALUE1 + **self == PPS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS12_A::VALUE2 + **self == PPS12_A::VALUE2 + } +} +impl core::ops::Deref for PPS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS12`"] +#[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] pub struct PPS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS13`"] -pub type PPS13_R = crate::R; +#[doc = "Field `PPS13` reader - Port n Pin Power Save Bit 13"] +pub struct PPS13_R(crate::FieldReader); impl PPS13_R { + pub(crate) fn new(bits: bool) -> Self { + PPS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS13_A { @@ -1013,15 +1144,22 @@ impl PPS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS13_A::VALUE1 + **self == PPS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS13_A::VALUE2 + **self == PPS13_A::VALUE2 } } -#[doc = "Write proxy for field `PPS13`"] +impl core::ops::Deref for PPS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] pub struct PPS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS14`"] -pub type PPS14_R = crate::R; +#[doc = "Field `PPS14` reader - Port n Pin Power Save Bit 14"] +pub struct PPS14_R(crate::FieldReader); impl PPS14_R { + pub(crate) fn new(bits: bool) -> Self { + PPS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS14_A { @@ -1088,15 +1227,22 @@ impl PPS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS14_A::VALUE1 + **self == PPS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS14_A::VALUE2 + **self == PPS14_A::VALUE2 } } -#[doc = "Write proxy for field `PPS14`"] +impl core::ops::Deref for PPS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] pub struct PPS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS15`"] -pub type PPS15_R = crate::R; +#[doc = "Field `PPS15` reader - Port n Pin Power Save Bit 15"] +pub struct PPS15_R(crate::FieldReader); impl PPS15_R { + pub(crate) fn new(bits: bool) -> Self { + PPS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS15_A { @@ -1163,15 +1310,22 @@ impl PPS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS15_A::VALUE1 + **self == PPS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS15_A::VALUE2 + **self == PPS15_A::VALUE2 } } -#[doc = "Write proxy for field `PPS15`"] +impl core::ops::Deref for PPS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] pub struct PPS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pps15(&mut self) -> PPS15_W { PPS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 0 Pin Power Save Register\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 [pps](index.html) module"] +pub struct PPS_SPEC; +impl crate::RegisterSpec for PPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pps::R](R) reader structure"] +impl crate::Readable for PPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pps::W](W) writer structure"] +impl crate::Writable for PPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PPS to value 0"] +impl crate::Resettable for PPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1.rs b/src/port1.rs index d0b7f92a..617c453f 100644 --- a/src/port1.rs +++ b/src/port1.rs @@ -2,158 +2,80 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Port 1 Output Register"] - pub out: OUT, + pub out: crate::Reg, #[doc = "0x04 - Port 1 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 8usize], + pub omr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x10 - Port 1 Input/Output Control Register 0"] - pub iocr0: IOCR0, + pub iocr0: crate::Reg, #[doc = "0x14 - Port 1 Input/Output Control Register 4"] - pub iocr4: IOCR4, + pub iocr4: crate::Reg, #[doc = "0x18 - Port 1 Input/Output Control Register 8"] - pub iocr8: IOCR8, + pub iocr8: crate::Reg, #[doc = "0x1c - Port 1 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 4usize], + pub iocr12: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0x24 - Port 1 Input Register"] - pub in_: IN, - _reserved7: [u8; 24usize], + pub in_: crate::Reg, + _reserved7: [u8; 0x18], #[doc = "0x40 - Port 1 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + pub pdr0: crate::Reg, #[doc = "0x44 - Port 1 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved9: [u8; 24usize], + pub pdr1: crate::Reg, + _reserved9: [u8; 0x18], #[doc = "0x60 - Port 1 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved10: [u8; 12usize], + pub pdisc: crate::Reg, + _reserved10: [u8; 0x0c], #[doc = "0x70 - Port 1 Pin Power Save Register"] - pub pps: PPS, + pub pps: crate::Reg, #[doc = "0x74 - Port 1 Pin Hardware Select Register"] - pub hwsel: HWSEL, + pub hwsel: crate::Reg, } -#[doc = "Port 1 Output Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](out) module"] -pub type OUT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUT; -#[doc = "`read()` method returns [out::R](out::R) reader structure"] -impl crate::Readable for OUT {} -#[doc = "`write(|w| ..)` method takes [out::W](out::W) writer structure"] -impl crate::Writable for OUT {} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; #[doc = "Port 1 Output Register"] pub mod out; -#[doc = "Port 1 Output Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](omr) module"] -pub type OMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OMR; -#[doc = "`write(|w| ..)` method takes [omr::W](omr::W) writer structure"] -impl crate::Writable for OMR {} +#[doc = "OMR register accessor: an alias for `Reg`"] +pub type OMR = crate::Reg; #[doc = "Port 1 Output Modification Register"] pub mod omr; -#[doc = "Port 1 Input/Output Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr0](iocr0) module"] -pub type IOCR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR0; -#[doc = "`read()` method returns [iocr0::R](iocr0::R) reader structure"] -impl crate::Readable for IOCR0 {} -#[doc = "`write(|w| ..)` method takes [iocr0::W](iocr0::W) writer structure"] -impl crate::Writable for IOCR0 {} +#[doc = "IOCR0 register accessor: an alias for `Reg`"] +pub type IOCR0 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "Port 1 Input/Output Control Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr4](iocr4) module"] -pub type IOCR4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR4; -#[doc = "`read()` method returns [iocr4::R](iocr4::R) reader structure"] -impl crate::Readable for IOCR4 {} -#[doc = "`write(|w| ..)` method takes [iocr4::W](iocr4::W) writer structure"] -impl crate::Writable for IOCR4 {} +#[doc = "IOCR4 register accessor: an alias for `Reg`"] +pub type IOCR4 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "Port 1 Input/Output Control Register 8\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr8](iocr8) module"] -pub type IOCR8 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR8; -#[doc = "`read()` method returns [iocr8::R](iocr8::R) reader structure"] -impl crate::Readable for IOCR8 {} -#[doc = "`write(|w| ..)` method takes [iocr8::W](iocr8::W) writer structure"] -impl crate::Writable for IOCR8 {} +#[doc = "IOCR8 register accessor: an alias for `Reg`"] +pub type IOCR8 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "Port 1 Input/Output Control Register 12\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr12](iocr12) module"] -pub type IOCR12 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR12; -#[doc = "`read()` method returns [iocr12::R](iocr12::R) reader structure"] -impl crate::Readable for IOCR12 {} -#[doc = "`write(|w| ..)` method takes [iocr12::W](iocr12::W) writer structure"] -impl crate::Writable for IOCR12 {} +#[doc = "IOCR12 register accessor: an alias for `Reg`"] +pub type IOCR12 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "Port 1 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`read()` method returns [in_::R](in_::R) reader structure"] -impl crate::Readable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Port 1 Input Register"] pub mod in_; -#[doc = "Port 1 Pad Driver Mode 0 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr0](pdr0) module"] -pub type PDR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR0; -#[doc = "`read()` method returns [pdr0::R](pdr0::R) reader structure"] -impl crate::Readable for PDR0 {} -#[doc = "`write(|w| ..)` method takes [pdr0::W](pdr0::W) writer structure"] -impl crate::Writable for PDR0 {} +#[doc = "PDR0 register accessor: an alias for `Reg`"] +pub type PDR0 = crate::Reg; #[doc = "Port 1 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "Port 1 Pad Driver Mode 1 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr1](pdr1) module"] -pub type PDR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR1; -#[doc = "`read()` method returns [pdr1::R](pdr1::R) reader structure"] -impl crate::Readable for PDR1 {} -#[doc = "`write(|w| ..)` method takes [pdr1::W](pdr1::W) writer structure"] -impl crate::Writable for PDR1 {} +#[doc = "PDR1 register accessor: an alias for `Reg`"] +pub type PDR1 = crate::Reg; #[doc = "Port 1 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "Port 1 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](pdisc) module"] -pub type PDISC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDISC; -#[doc = "`read()` method returns [pdisc::R](pdisc::R) reader structure"] -impl crate::Readable for PDISC {} +#[doc = "PDISC register accessor: an alias for `Reg`"] +pub type PDISC = crate::Reg; #[doc = "Port 1 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "Port 1 Pin Power Save Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pps](pps) module"] -pub type PPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PPS; -#[doc = "`read()` method returns [pps::R](pps::R) reader structure"] -impl crate::Readable for PPS {} -#[doc = "`write(|w| ..)` method takes [pps::W](pps::W) writer structure"] -impl crate::Writable for PPS {} +#[doc = "PPS register accessor: an alias for `Reg`"] +pub type PPS = crate::Reg; #[doc = "Port 1 Pin Power Save Register"] pub mod pps; -#[doc = "Port 1 Pin Hardware Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hwsel](hwsel) module"] -pub type HWSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HWSEL; -#[doc = "`read()` method returns [hwsel::R](hwsel::R) reader structure"] -impl crate::Readable for HWSEL {} -#[doc = "`write(|w| ..)` method takes [hwsel::W](hwsel::W) writer structure"] -impl crate::Writable for HWSEL {} +#[doc = "HWSEL register accessor: an alias for `Reg`"] +pub type HWSEL = crate::Reg; #[doc = "Port 1 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port1/hwsel.rs b/src/port1/hwsel.rs index 0190c06c..ddae14f0 100644 --- a/src/port1/hwsel.rs +++ b/src/port1/hwsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HWSEL"] -pub type R = crate::R; -#[doc = "Writer for register HWSEL"] -pub type W = crate::W; -#[doc = "Register HWSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::HWSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HWSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HWSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW0`"] -pub type HW0_R = crate::R; +#[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] +pub struct HW0_R(crate::FieldReader); impl HW0_R { + pub(crate) fn new(bits: u8) -> Self { + HW0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW0_A::VALUE1), - 1 => Val(HW0_A::VALUE2), - 2 => Val(HW0_A::VALUE3), - i => Res(i), + 0 => Some(HW0_A::VALUE1), + 1 => Some(HW0_A::VALUE2), + 2 => Some(HW0_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW0_A::VALUE1 + **self == HW0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW0_A::VALUE2 + **self == HW0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW0_A::VALUE3 + **self == HW0_A::VALUE3 } } -#[doc = "Write proxy for field `HW0`"] +impl core::ops::Deref for HW0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] pub struct HW0_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> HW0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW1`"] -pub type HW1_R = crate::R; +#[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] +pub struct HW1_R(crate::FieldReader); impl HW1_R { + pub(crate) fn new(bits: u8) -> Self { + HW1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW1_A::VALUE1), - 1 => Val(HW1_A::VALUE2), - 2 => Val(HW1_A::VALUE3), - i => Res(i), + 0 => Some(HW1_A::VALUE1), + 1 => Some(HW1_A::VALUE2), + 2 => Some(HW1_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW1_A::VALUE1 + **self == HW1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW1_A::VALUE2 + **self == HW1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW1_A::VALUE3 + **self == HW1_A::VALUE3 + } +} +impl core::ops::Deref for HW1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW1`"] +#[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] pub struct HW1_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> HW1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW2`"] -pub type HW2_R = crate::R; +#[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] +pub struct HW2_R(crate::FieldReader); impl HW2_R { + pub(crate) fn new(bits: u8) -> Self { + HW2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW2_A::VALUE1), - 1 => Val(HW2_A::VALUE2), - 2 => Val(HW2_A::VALUE3), - i => Res(i), + 0 => Some(HW2_A::VALUE1), + 1 => Some(HW2_A::VALUE2), + 2 => Some(HW2_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW2_A::VALUE1 + **self == HW2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW2_A::VALUE2 + **self == HW2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW2_A::VALUE3 + **self == HW2_A::VALUE3 + } +} +impl core::ops::Deref for HW2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW2`"] +#[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] pub struct HW2_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> HW2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW3`"] -pub type HW3_R = crate::R; +#[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] +pub struct HW3_R(crate::FieldReader); impl HW3_R { + pub(crate) fn new(bits: u8) -> Self { + HW3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW3_A::VALUE1), - 1 => Val(HW3_A::VALUE2), - 2 => Val(HW3_A::VALUE3), - i => Res(i), + 0 => Some(HW3_A::VALUE1), + 1 => Some(HW3_A::VALUE2), + 2 => Some(HW3_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW3_A::VALUE1 + **self == HW3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW3_A::VALUE2 + **self == HW3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW3_A::VALUE3 + **self == HW3_A::VALUE3 } } -#[doc = "Write proxy for field `HW3`"] +impl core::ops::Deref for HW3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] pub struct HW3_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> HW3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -343,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW4`"] -pub type HW4_R = crate::R; +#[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] +pub struct HW4_R(crate::FieldReader); impl HW4_R { + pub(crate) fn new(bits: u8) -> Self { + HW4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW4_A::VALUE1), - 1 => Val(HW4_A::VALUE2), - 2 => Val(HW4_A::VALUE3), - i => Res(i), + 0 => Some(HW4_A::VALUE1), + 1 => Some(HW4_A::VALUE2), + 2 => Some(HW4_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW4_A::VALUE1 + **self == HW4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW4_A::VALUE2 + **self == HW4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW4_A::VALUE3 + **self == HW4_A::VALUE3 + } +} +impl core::ops::Deref for HW4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW4`"] +#[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] pub struct HW4_W<'a> { w: &'a mut W, } @@ -401,7 +470,7 @@ impl<'a> HW4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -422,37 +491,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW5`"] -pub type HW5_R = crate::R; +#[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] +pub struct HW5_R(crate::FieldReader); impl HW5_R { + pub(crate) fn new(bits: u8) -> Self { + HW5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW5_A::VALUE1), - 1 => Val(HW5_A::VALUE2), - 2 => Val(HW5_A::VALUE3), - i => Res(i), + 0 => Some(HW5_A::VALUE1), + 1 => Some(HW5_A::VALUE2), + 2 => Some(HW5_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW5_A::VALUE1 + **self == HW5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW5_A::VALUE2 + **self == HW5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW5_A::VALUE3 + **self == HW5_A::VALUE3 + } +} +impl core::ops::Deref for HW5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW5`"] +#[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] pub struct HW5_W<'a> { w: &'a mut W, } @@ -480,7 +558,7 @@ impl<'a> HW5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -501,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW6`"] -pub type HW6_R = crate::R; +#[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] +pub struct HW6_R(crate::FieldReader); impl HW6_R { + pub(crate) fn new(bits: u8) -> Self { + HW6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW6_A::VALUE1), - 1 => Val(HW6_A::VALUE2), - 2 => Val(HW6_A::VALUE3), - i => Res(i), + 0 => Some(HW6_A::VALUE1), + 1 => Some(HW6_A::VALUE2), + 2 => Some(HW6_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW6_A::VALUE1 + **self == HW6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW6_A::VALUE2 + **self == HW6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW6_A::VALUE3 + **self == HW6_A::VALUE3 } } -#[doc = "Write proxy for field `HW6`"] +impl core::ops::Deref for HW6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] pub struct HW6_W<'a> { w: &'a mut W, } @@ -559,7 +646,7 @@ impl<'a> HW6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -580,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW7`"] -pub type HW7_R = crate::R; +#[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] +pub struct HW7_R(crate::FieldReader); impl HW7_R { + pub(crate) fn new(bits: u8) -> Self { + HW7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW7_A::VALUE1), - 1 => Val(HW7_A::VALUE2), - 2 => Val(HW7_A::VALUE3), - i => Res(i), + 0 => Some(HW7_A::VALUE1), + 1 => Some(HW7_A::VALUE2), + 2 => Some(HW7_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW7_A::VALUE1 + **self == HW7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW7_A::VALUE2 + **self == HW7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW7_A::VALUE3 + **self == HW7_A::VALUE3 } } -#[doc = "Write proxy for field `HW7`"] +impl core::ops::Deref for HW7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] pub struct HW7_W<'a> { w: &'a mut W, } @@ -638,7 +734,7 @@ impl<'a> HW7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -659,37 +755,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW8`"] -pub type HW8_R = crate::R; +#[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] +pub struct HW8_R(crate::FieldReader); impl HW8_R { + pub(crate) fn new(bits: u8) -> Self { + HW8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW8_A::VALUE1), - 1 => Val(HW8_A::VALUE2), - 2 => Val(HW8_A::VALUE3), - i => Res(i), + 0 => Some(HW8_A::VALUE1), + 1 => Some(HW8_A::VALUE2), + 2 => Some(HW8_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW8_A::VALUE1 + **self == HW8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW8_A::VALUE2 + **self == HW8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW8_A::VALUE3 + **self == HW8_A::VALUE3 + } +} +impl core::ops::Deref for HW8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW8`"] +#[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] pub struct HW8_W<'a> { w: &'a mut W, } @@ -717,7 +822,7 @@ impl<'a> HW8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -738,37 +843,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW9`"] -pub type HW9_R = crate::R; +#[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] +pub struct HW9_R(crate::FieldReader); impl HW9_R { + pub(crate) fn new(bits: u8) -> Self { + HW9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW9_A::VALUE1), - 1 => Val(HW9_A::VALUE2), - 2 => Val(HW9_A::VALUE3), - i => Res(i), + 0 => Some(HW9_A::VALUE1), + 1 => Some(HW9_A::VALUE2), + 2 => Some(HW9_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW9_A::VALUE1 + **self == HW9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW9_A::VALUE2 + **self == HW9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW9_A::VALUE3 + **self == HW9_A::VALUE3 } } -#[doc = "Write proxy for field `HW9`"] +impl core::ops::Deref for HW9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] pub struct HW9_W<'a> { w: &'a mut W, } @@ -796,7 +910,7 @@ impl<'a> HW9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -817,37 +931,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW10`"] -pub type HW10_R = crate::R; +#[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] +pub struct HW10_R(crate::FieldReader); impl HW10_R { + pub(crate) fn new(bits: u8) -> Self { + HW10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW10_A::VALUE1), - 1 => Val(HW10_A::VALUE2), - 2 => Val(HW10_A::VALUE3), - i => Res(i), + 0 => Some(HW10_A::VALUE1), + 1 => Some(HW10_A::VALUE2), + 2 => Some(HW10_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW10_A::VALUE1 + **self == HW10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW10_A::VALUE2 + **self == HW10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW10_A::VALUE3 + **self == HW10_A::VALUE3 } } -#[doc = "Write proxy for field `HW10`"] +impl core::ops::Deref for HW10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] pub struct HW10_W<'a> { w: &'a mut W, } @@ -875,7 +998,7 @@ impl<'a> HW10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -896,37 +1019,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW11`"] -pub type HW11_R = crate::R; +#[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] +pub struct HW11_R(crate::FieldReader); impl HW11_R { + pub(crate) fn new(bits: u8) -> Self { + HW11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW11_A::VALUE1), - 1 => Val(HW11_A::VALUE2), - 2 => Val(HW11_A::VALUE3), - i => Res(i), + 0 => Some(HW11_A::VALUE1), + 1 => Some(HW11_A::VALUE2), + 2 => Some(HW11_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW11_A::VALUE1 + **self == HW11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW11_A::VALUE2 + **self == HW11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW11_A::VALUE3 + **self == HW11_A::VALUE3 } } -#[doc = "Write proxy for field `HW11`"] +impl core::ops::Deref for HW11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] pub struct HW11_W<'a> { w: &'a mut W, } @@ -954,7 +1086,7 @@ impl<'a> HW11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -975,37 +1107,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW12`"] -pub type HW12_R = crate::R; +#[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] +pub struct HW12_R(crate::FieldReader); impl HW12_R { + pub(crate) fn new(bits: u8) -> Self { + HW12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW12_A::VALUE1), - 1 => Val(HW12_A::VALUE2), - 2 => Val(HW12_A::VALUE3), - i => Res(i), + 0 => Some(HW12_A::VALUE1), + 1 => Some(HW12_A::VALUE2), + 2 => Some(HW12_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW12_A::VALUE1 + **self == HW12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW12_A::VALUE2 + **self == HW12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW12_A::VALUE3 + **self == HW12_A::VALUE3 + } +} +impl core::ops::Deref for HW12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW12`"] +#[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] pub struct HW12_W<'a> { w: &'a mut W, } @@ -1033,7 +1174,7 @@ impl<'a> HW12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1054,37 +1195,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW13`"] -pub type HW13_R = crate::R; +#[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] +pub struct HW13_R(crate::FieldReader); impl HW13_R { + pub(crate) fn new(bits: u8) -> Self { + HW13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW13_A::VALUE1), - 1 => Val(HW13_A::VALUE2), - 2 => Val(HW13_A::VALUE3), - i => Res(i), + 0 => Some(HW13_A::VALUE1), + 1 => Some(HW13_A::VALUE2), + 2 => Some(HW13_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW13_A::VALUE1 + **self == HW13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW13_A::VALUE2 + **self == HW13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW13_A::VALUE3 + **self == HW13_A::VALUE3 + } +} +impl core::ops::Deref for HW13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW13`"] +#[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] pub struct HW13_W<'a> { w: &'a mut W, } @@ -1112,7 +1262,7 @@ impl<'a> HW13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -1133,37 +1283,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW14`"] -pub type HW14_R = crate::R; +#[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] +pub struct HW14_R(crate::FieldReader); impl HW14_R { + pub(crate) fn new(bits: u8) -> Self { + HW14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW14_A::VALUE1), - 1 => Val(HW14_A::VALUE2), - 2 => Val(HW14_A::VALUE3), - i => Res(i), + 0 => Some(HW14_A::VALUE1), + 1 => Some(HW14_A::VALUE2), + 2 => Some(HW14_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW14_A::VALUE1 + **self == HW14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW14_A::VALUE2 + **self == HW14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW14_A::VALUE3 + **self == HW14_A::VALUE3 } } -#[doc = "Write proxy for field `HW14`"] +impl core::ops::Deref for HW14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] pub struct HW14_W<'a> { w: &'a mut W, } @@ -1191,7 +1350,7 @@ impl<'a> HW14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1212,37 +1371,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW15`"] -pub type HW15_R = crate::R; +#[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] +pub struct HW15_R(crate::FieldReader); impl HW15_R { + pub(crate) fn new(bits: u8) -> Self { + HW15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW15_A::VALUE1), - 1 => Val(HW15_A::VALUE2), - 2 => Val(HW15_A::VALUE3), - i => Res(i), + 0 => Some(HW15_A::VALUE1), + 1 => Some(HW15_A::VALUE2), + 2 => Some(HW15_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW15_A::VALUE1 + **self == HW15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW15_A::VALUE2 + **self == HW15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW15_A::VALUE3 + **self == HW15_A::VALUE3 } } -#[doc = "Write proxy for field `HW15`"] +impl core::ops::Deref for HW15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] pub struct HW15_W<'a> { w: &'a mut W, } @@ -1270,7 +1438,7 @@ impl<'a> HW15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -1437,4 +1605,30 @@ impl W { pub fn hw15(&mut self) -> HW15_W { HW15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Pin Hardware Select Register\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 [hwsel](index.html) module"] +pub struct HWSEL_SPEC; +impl crate::RegisterSpec for HWSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hwsel::R](R) reader structure"] +impl crate::Readable for HWSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hwsel::W](W) writer structure"] +impl crate::Writable for HWSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HWSEL to value 0"] +impl crate::Resettable for HWSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/in_.rs b/src/port1/in_.rs index 344607dc..b2b6a875 100644 --- a/src/port1/in_.rs +++ b/src/port1/in_.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register IN"] -pub type R = crate::R; +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum P0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Input Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -28,12 +44,19 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 + } +} +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Input Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -64,12 +90,19 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 + } +} +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Input Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -100,12 +136,19 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Input Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -136,12 +182,19 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Input Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -172,12 +228,19 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Input Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -208,12 +274,19 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Input Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -244,12 +320,19 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 + } +} +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Input Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -280,12 +366,19 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 + } +} +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Input Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -316,12 +412,19 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 + } +} +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Input Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -352,12 +458,19 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Input Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -388,12 +504,19 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 + } +} +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Input Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -424,12 +550,19 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 + } +} +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Input Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -460,12 +596,19 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Input Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -496,12 +642,19 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 + } +} +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Input Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -532,12 +688,19 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 + } +} +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Input Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -568,12 +734,19 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 + } +} +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { P15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 1 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port1/iocr0.rs b/src/port1/iocr0.rs index ea51a257..128437bd 100644 --- a/src/port1/iocr0.rs +++ b/src/port1/iocr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR0"] -pub type R = crate::R; -#[doc = "Writer for register IOCR0"] -pub type W = crate::W; -#[doc = "Register IOCR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC0`"] -pub type PC0_R = crate::R; +#[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC0_R(crate::FieldReader); impl PC0_R { + pub(crate) fn new(bits: u8) -> Self { + PC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC0_A::VALUE1), - 1 => Val(PC0_A::VALUE2), - 2 => Val(PC0_A::VALUE3), - 3 => Val(PC0_A::VALUE4), - 4 => Val(PC0_A::VALUE5), - 5 => Val(PC0_A::VALUE6), - 6 => Val(PC0_A::VALUE7), - 7 => Val(PC0_A::VALUE8), - 16 => Val(PC0_A::VALUE9), - 17 => Val(PC0_A::VALUE10), - 18 => Val(PC0_A::VALUE11), - 19 => Val(PC0_A::VALUE12), - 20 => Val(PC0_A::VALUE13), - 24 => Val(PC0_A::VALUE14), - 25 => Val(PC0_A::VALUE15), - 26 => Val(PC0_A::VALUE16), - 27 => Val(PC0_A::VALUE17), - 28 => Val(PC0_A::VALUE18), - i => Res(i), + 0 => Some(PC0_A::VALUE1), + 1 => Some(PC0_A::VALUE2), + 2 => Some(PC0_A::VALUE3), + 3 => Some(PC0_A::VALUE4), + 4 => Some(PC0_A::VALUE5), + 5 => Some(PC0_A::VALUE6), + 6 => Some(PC0_A::VALUE7), + 7 => Some(PC0_A::VALUE8), + 16 => Some(PC0_A::VALUE9), + 17 => Some(PC0_A::VALUE10), + 18 => Some(PC0_A::VALUE11), + 19 => Some(PC0_A::VALUE12), + 20 => Some(PC0_A::VALUE13), + 24 => Some(PC0_A::VALUE14), + 25 => Some(PC0_A::VALUE15), + 26 => Some(PC0_A::VALUE16), + 27 => Some(PC0_A::VALUE17), + 28 => Some(PC0_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC0_A::VALUE1 + **self == PC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC0_A::VALUE2 + **self == PC0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC0_A::VALUE3 + **self == PC0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC0_A::VALUE4 + **self == PC0_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC0_A::VALUE5 + **self == PC0_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC0_A::VALUE6 + **self == PC0_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC0_A::VALUE7 + **self == PC0_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC0_A::VALUE8 + **self == PC0_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC0_A::VALUE9 + **self == PC0_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC0_A::VALUE10 + **self == PC0_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC0_A::VALUE11 + **self == PC0_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC0_A::VALUE12 + **self == PC0_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC0_A::VALUE13 + **self == PC0_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC0_A::VALUE14 + **self == PC0_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC0_A::VALUE15 + **self == PC0_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC0_A::VALUE16 + **self == PC0_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC0_A::VALUE17 + **self == PC0_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC0_A::VALUE18 + **self == PC0_A::VALUE18 } } -#[doc = "Write proxy for field `PC0`"] +impl core::ops::Deref for PC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] pub struct PC0_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC1`"] -pub type PC1_R = crate::R; +#[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC1_R(crate::FieldReader); impl PC1_R { + pub(crate) fn new(bits: u8) -> Self { + PC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC1_A::VALUE1), - 1 => Val(PC1_A::VALUE2), - 2 => Val(PC1_A::VALUE3), - 3 => Val(PC1_A::VALUE4), - 4 => Val(PC1_A::VALUE5), - 5 => Val(PC1_A::VALUE6), - 6 => Val(PC1_A::VALUE7), - 7 => Val(PC1_A::VALUE8), - 16 => Val(PC1_A::VALUE9), - 17 => Val(PC1_A::VALUE10), - 18 => Val(PC1_A::VALUE11), - 19 => Val(PC1_A::VALUE12), - 20 => Val(PC1_A::VALUE13), - 24 => Val(PC1_A::VALUE14), - 25 => Val(PC1_A::VALUE15), - 26 => Val(PC1_A::VALUE16), - 27 => Val(PC1_A::VALUE17), - 28 => Val(PC1_A::VALUE18), - i => Res(i), + 0 => Some(PC1_A::VALUE1), + 1 => Some(PC1_A::VALUE2), + 2 => Some(PC1_A::VALUE3), + 3 => Some(PC1_A::VALUE4), + 4 => Some(PC1_A::VALUE5), + 5 => Some(PC1_A::VALUE6), + 6 => Some(PC1_A::VALUE7), + 7 => Some(PC1_A::VALUE8), + 16 => Some(PC1_A::VALUE9), + 17 => Some(PC1_A::VALUE10), + 18 => Some(PC1_A::VALUE11), + 19 => Some(PC1_A::VALUE12), + 20 => Some(PC1_A::VALUE13), + 24 => Some(PC1_A::VALUE14), + 25 => Some(PC1_A::VALUE15), + 26 => Some(PC1_A::VALUE16), + 27 => Some(PC1_A::VALUE17), + 28 => Some(PC1_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC1_A::VALUE1 + **self == PC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC1_A::VALUE2 + **self == PC1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC1_A::VALUE3 + **self == PC1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC1_A::VALUE4 + **self == PC1_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC1_A::VALUE5 + **self == PC1_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC1_A::VALUE6 + **self == PC1_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC1_A::VALUE7 + **self == PC1_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC1_A::VALUE8 + **self == PC1_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC1_A::VALUE9 + **self == PC1_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC1_A::VALUE10 + **self == PC1_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC1_A::VALUE11 + **self == PC1_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC1_A::VALUE12 + **self == PC1_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC1_A::VALUE13 + **self == PC1_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC1_A::VALUE14 + **self == PC1_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC1_A::VALUE15 + **self == PC1_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC1_A::VALUE16 + **self == PC1_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC1_A::VALUE17 + **self == PC1_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC1_A::VALUE18 + **self == PC1_A::VALUE18 } } -#[doc = "Write proxy for field `PC1`"] +impl core::ops::Deref for PC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] pub struct PC1_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC2`"] -pub type PC2_R = crate::R; +#[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC2_R(crate::FieldReader); impl PC2_R { + pub(crate) fn new(bits: u8) -> Self { + PC2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC2_A::VALUE1), - 1 => Val(PC2_A::VALUE2), - 2 => Val(PC2_A::VALUE3), - 3 => Val(PC2_A::VALUE4), - 4 => Val(PC2_A::VALUE5), - 5 => Val(PC2_A::VALUE6), - 6 => Val(PC2_A::VALUE7), - 7 => Val(PC2_A::VALUE8), - 16 => Val(PC2_A::VALUE9), - 17 => Val(PC2_A::VALUE10), - 18 => Val(PC2_A::VALUE11), - 19 => Val(PC2_A::VALUE12), - 20 => Val(PC2_A::VALUE13), - 24 => Val(PC2_A::VALUE14), - 25 => Val(PC2_A::VALUE15), - 26 => Val(PC2_A::VALUE16), - 27 => Val(PC2_A::VALUE17), - 28 => Val(PC2_A::VALUE18), - i => Res(i), + 0 => Some(PC2_A::VALUE1), + 1 => Some(PC2_A::VALUE2), + 2 => Some(PC2_A::VALUE3), + 3 => Some(PC2_A::VALUE4), + 4 => Some(PC2_A::VALUE5), + 5 => Some(PC2_A::VALUE6), + 6 => Some(PC2_A::VALUE7), + 7 => Some(PC2_A::VALUE8), + 16 => Some(PC2_A::VALUE9), + 17 => Some(PC2_A::VALUE10), + 18 => Some(PC2_A::VALUE11), + 19 => Some(PC2_A::VALUE12), + 20 => Some(PC2_A::VALUE13), + 24 => Some(PC2_A::VALUE14), + 25 => Some(PC2_A::VALUE15), + 26 => Some(PC2_A::VALUE16), + 27 => Some(PC2_A::VALUE17), + 28 => Some(PC2_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC2_A::VALUE1 + **self == PC2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC2_A::VALUE2 + **self == PC2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC2_A::VALUE3 + **self == PC2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC2_A::VALUE4 + **self == PC2_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC2_A::VALUE5 + **self == PC2_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC2_A::VALUE6 + **self == PC2_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC2_A::VALUE7 + **self == PC2_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC2_A::VALUE8 + **self == PC2_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC2_A::VALUE9 + **self == PC2_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC2_A::VALUE10 + **self == PC2_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC2_A::VALUE11 + **self == PC2_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC2_A::VALUE12 + **self == PC2_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC2_A::VALUE13 + **self == PC2_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC2_A::VALUE14 + **self == PC2_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC2_A::VALUE15 + **self == PC2_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC2_A::VALUE16 + **self == PC2_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC2_A::VALUE17 + **self == PC2_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC2_A::VALUE18 + **self == PC2_A::VALUE18 + } +} +impl core::ops::Deref for PC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC2`"] +#[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] pub struct PC2_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC3`"] -pub type PC3_R = crate::R; +#[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC3_R(crate::FieldReader); impl PC3_R { + pub(crate) fn new(bits: u8) -> Self { + PC3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC3_A::VALUE1), - 1 => Val(PC3_A::VALUE2), - 2 => Val(PC3_A::VALUE3), - 3 => Val(PC3_A::VALUE4), - 4 => Val(PC3_A::VALUE5), - 5 => Val(PC3_A::VALUE6), - 6 => Val(PC3_A::VALUE7), - 7 => Val(PC3_A::VALUE8), - 16 => Val(PC3_A::VALUE9), - 17 => Val(PC3_A::VALUE10), - 18 => Val(PC3_A::VALUE11), - 19 => Val(PC3_A::VALUE12), - 20 => Val(PC3_A::VALUE13), - 24 => Val(PC3_A::VALUE14), - 25 => Val(PC3_A::VALUE15), - 26 => Val(PC3_A::VALUE16), - 27 => Val(PC3_A::VALUE17), - 28 => Val(PC3_A::VALUE18), - i => Res(i), + 0 => Some(PC3_A::VALUE1), + 1 => Some(PC3_A::VALUE2), + 2 => Some(PC3_A::VALUE3), + 3 => Some(PC3_A::VALUE4), + 4 => Some(PC3_A::VALUE5), + 5 => Some(PC3_A::VALUE6), + 6 => Some(PC3_A::VALUE7), + 7 => Some(PC3_A::VALUE8), + 16 => Some(PC3_A::VALUE9), + 17 => Some(PC3_A::VALUE10), + 18 => Some(PC3_A::VALUE11), + 19 => Some(PC3_A::VALUE12), + 20 => Some(PC3_A::VALUE13), + 24 => Some(PC3_A::VALUE14), + 25 => Some(PC3_A::VALUE15), + 26 => Some(PC3_A::VALUE16), + 27 => Some(PC3_A::VALUE17), + 28 => Some(PC3_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC3_A::VALUE1 + **self == PC3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC3_A::VALUE2 + **self == PC3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC3_A::VALUE3 + **self == PC3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC3_A::VALUE4 + **self == PC3_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC3_A::VALUE5 + **self == PC3_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC3_A::VALUE6 + **self == PC3_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC3_A::VALUE7 + **self == PC3_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC3_A::VALUE8 + **self == PC3_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC3_A::VALUE9 + **self == PC3_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC3_A::VALUE10 + **self == PC3_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC3_A::VALUE11 + **self == PC3_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC3_A::VALUE12 + **self == PC3_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC3_A::VALUE13 + **self == PC3_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC3_A::VALUE14 + **self == PC3_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC3_A::VALUE15 + **self == PC3_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC3_A::VALUE16 + **self == PC3_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC3_A::VALUE17 + **self == PC3_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC3_A::VALUE18 + **self == PC3_A::VALUE18 + } +} +impl core::ops::Deref for PC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC3`"] +#[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] pub struct PC3_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc3(&mut self) -> PC3_W { PC3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Input/Output Control Register 0\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 [iocr0](index.html) module"] +pub struct IOCR0_SPEC; +impl crate::RegisterSpec for IOCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr0::R](R) reader structure"] +impl crate::Readable for IOCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr0::W](W) writer structure"] +impl crate::Writable for IOCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR0 to value 0"] +impl crate::Resettable for IOCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/iocr12.rs b/src/port1/iocr12.rs index b1edc33d..0729fd71 100644 --- a/src/port1/iocr12.rs +++ b/src/port1/iocr12.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR12"] -pub type R = crate::R; -#[doc = "Writer for register IOCR12"] -pub type W = crate::W; -#[doc = "Register IOCR12 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR12 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR12` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR12` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC12`"] -pub type PC12_R = crate::R; +#[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC12_R(crate::FieldReader); impl PC12_R { + pub(crate) fn new(bits: u8) -> Self { + PC12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC12_A::VALUE1), - 1 => Val(PC12_A::VALUE2), - 2 => Val(PC12_A::VALUE3), - 3 => Val(PC12_A::VALUE4), - 4 => Val(PC12_A::VALUE5), - 5 => Val(PC12_A::VALUE6), - 6 => Val(PC12_A::VALUE7), - 7 => Val(PC12_A::VALUE8), - 16 => Val(PC12_A::VALUE9), - 17 => Val(PC12_A::VALUE10), - 18 => Val(PC12_A::VALUE11), - 19 => Val(PC12_A::VALUE12), - 20 => Val(PC12_A::VALUE13), - 24 => Val(PC12_A::VALUE14), - 25 => Val(PC12_A::VALUE15), - 26 => Val(PC12_A::VALUE16), - 27 => Val(PC12_A::VALUE17), - 28 => Val(PC12_A::VALUE18), - i => Res(i), + 0 => Some(PC12_A::VALUE1), + 1 => Some(PC12_A::VALUE2), + 2 => Some(PC12_A::VALUE3), + 3 => Some(PC12_A::VALUE4), + 4 => Some(PC12_A::VALUE5), + 5 => Some(PC12_A::VALUE6), + 6 => Some(PC12_A::VALUE7), + 7 => Some(PC12_A::VALUE8), + 16 => Some(PC12_A::VALUE9), + 17 => Some(PC12_A::VALUE10), + 18 => Some(PC12_A::VALUE11), + 19 => Some(PC12_A::VALUE12), + 20 => Some(PC12_A::VALUE13), + 24 => Some(PC12_A::VALUE14), + 25 => Some(PC12_A::VALUE15), + 26 => Some(PC12_A::VALUE16), + 27 => Some(PC12_A::VALUE17), + 28 => Some(PC12_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC12_A::VALUE1 + **self == PC12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC12_A::VALUE2 + **self == PC12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC12_A::VALUE3 + **self == PC12_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC12_A::VALUE4 + **self == PC12_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC12_A::VALUE5 + **self == PC12_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC12_A::VALUE6 + **self == PC12_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC12_A::VALUE7 + **self == PC12_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC12_A::VALUE8 + **self == PC12_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC12_A::VALUE9 + **self == PC12_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC12_A::VALUE10 + **self == PC12_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC12_A::VALUE11 + **self == PC12_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC12_A::VALUE12 + **self == PC12_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC12_A::VALUE13 + **self == PC12_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC12_A::VALUE14 + **self == PC12_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC12_A::VALUE15 + **self == PC12_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC12_A::VALUE16 + **self == PC12_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC12_A::VALUE17 + **self == PC12_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC12_A::VALUE18 + **self == PC12_A::VALUE18 } } -#[doc = "Write proxy for field `PC12`"] +impl core::ops::Deref for PC12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] pub struct PC12_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC13`"] -pub type PC13_R = crate::R; +#[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC13_R(crate::FieldReader); impl PC13_R { + pub(crate) fn new(bits: u8) -> Self { + PC13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC13_A::VALUE1), - 1 => Val(PC13_A::VALUE2), - 2 => Val(PC13_A::VALUE3), - 3 => Val(PC13_A::VALUE4), - 4 => Val(PC13_A::VALUE5), - 5 => Val(PC13_A::VALUE6), - 6 => Val(PC13_A::VALUE7), - 7 => Val(PC13_A::VALUE8), - 16 => Val(PC13_A::VALUE9), - 17 => Val(PC13_A::VALUE10), - 18 => Val(PC13_A::VALUE11), - 19 => Val(PC13_A::VALUE12), - 20 => Val(PC13_A::VALUE13), - 24 => Val(PC13_A::VALUE14), - 25 => Val(PC13_A::VALUE15), - 26 => Val(PC13_A::VALUE16), - 27 => Val(PC13_A::VALUE17), - 28 => Val(PC13_A::VALUE18), - i => Res(i), + 0 => Some(PC13_A::VALUE1), + 1 => Some(PC13_A::VALUE2), + 2 => Some(PC13_A::VALUE3), + 3 => Some(PC13_A::VALUE4), + 4 => Some(PC13_A::VALUE5), + 5 => Some(PC13_A::VALUE6), + 6 => Some(PC13_A::VALUE7), + 7 => Some(PC13_A::VALUE8), + 16 => Some(PC13_A::VALUE9), + 17 => Some(PC13_A::VALUE10), + 18 => Some(PC13_A::VALUE11), + 19 => Some(PC13_A::VALUE12), + 20 => Some(PC13_A::VALUE13), + 24 => Some(PC13_A::VALUE14), + 25 => Some(PC13_A::VALUE15), + 26 => Some(PC13_A::VALUE16), + 27 => Some(PC13_A::VALUE17), + 28 => Some(PC13_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC13_A::VALUE1 + **self == PC13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC13_A::VALUE2 + **self == PC13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC13_A::VALUE3 + **self == PC13_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC13_A::VALUE4 + **self == PC13_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC13_A::VALUE5 + **self == PC13_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC13_A::VALUE6 + **self == PC13_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC13_A::VALUE7 + **self == PC13_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC13_A::VALUE8 + **self == PC13_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC13_A::VALUE9 + **self == PC13_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC13_A::VALUE10 + **self == PC13_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC13_A::VALUE11 + **self == PC13_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC13_A::VALUE12 + **self == PC13_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC13_A::VALUE13 + **self == PC13_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC13_A::VALUE14 + **self == PC13_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC13_A::VALUE15 + **self == PC13_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC13_A::VALUE16 + **self == PC13_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC13_A::VALUE17 + **self == PC13_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC13_A::VALUE18 + **self == PC13_A::VALUE18 } } -#[doc = "Write proxy for field `PC13`"] +impl core::ops::Deref for PC13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] pub struct PC13_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC14`"] -pub type PC14_R = crate::R; +#[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC14_R(crate::FieldReader); impl PC14_R { + pub(crate) fn new(bits: u8) -> Self { + PC14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC14_A::VALUE1), - 1 => Val(PC14_A::VALUE2), - 2 => Val(PC14_A::VALUE3), - 3 => Val(PC14_A::VALUE4), - 4 => Val(PC14_A::VALUE5), - 5 => Val(PC14_A::VALUE6), - 6 => Val(PC14_A::VALUE7), - 7 => Val(PC14_A::VALUE8), - 16 => Val(PC14_A::VALUE9), - 17 => Val(PC14_A::VALUE10), - 18 => Val(PC14_A::VALUE11), - 19 => Val(PC14_A::VALUE12), - 20 => Val(PC14_A::VALUE13), - 24 => Val(PC14_A::VALUE14), - 25 => Val(PC14_A::VALUE15), - 26 => Val(PC14_A::VALUE16), - 27 => Val(PC14_A::VALUE17), - 28 => Val(PC14_A::VALUE18), - i => Res(i), + 0 => Some(PC14_A::VALUE1), + 1 => Some(PC14_A::VALUE2), + 2 => Some(PC14_A::VALUE3), + 3 => Some(PC14_A::VALUE4), + 4 => Some(PC14_A::VALUE5), + 5 => Some(PC14_A::VALUE6), + 6 => Some(PC14_A::VALUE7), + 7 => Some(PC14_A::VALUE8), + 16 => Some(PC14_A::VALUE9), + 17 => Some(PC14_A::VALUE10), + 18 => Some(PC14_A::VALUE11), + 19 => Some(PC14_A::VALUE12), + 20 => Some(PC14_A::VALUE13), + 24 => Some(PC14_A::VALUE14), + 25 => Some(PC14_A::VALUE15), + 26 => Some(PC14_A::VALUE16), + 27 => Some(PC14_A::VALUE17), + 28 => Some(PC14_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC14_A::VALUE1 + **self == PC14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC14_A::VALUE2 + **self == PC14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC14_A::VALUE3 + **self == PC14_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC14_A::VALUE4 + **self == PC14_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC14_A::VALUE5 + **self == PC14_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC14_A::VALUE6 + **self == PC14_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC14_A::VALUE7 + **self == PC14_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC14_A::VALUE8 + **self == PC14_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC14_A::VALUE9 + **self == PC14_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC14_A::VALUE10 + **self == PC14_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC14_A::VALUE11 + **self == PC14_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC14_A::VALUE12 + **self == PC14_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC14_A::VALUE13 + **self == PC14_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC14_A::VALUE14 + **self == PC14_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC14_A::VALUE15 + **self == PC14_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC14_A::VALUE16 + **self == PC14_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC14_A::VALUE17 + **self == PC14_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC14_A::VALUE18 + **self == PC14_A::VALUE18 + } +} +impl core::ops::Deref for PC14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC14`"] +#[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] pub struct PC14_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC15`"] -pub type PC15_R = crate::R; +#[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC15_R(crate::FieldReader); impl PC15_R { + pub(crate) fn new(bits: u8) -> Self { + PC15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC15_A::VALUE1), - 1 => Val(PC15_A::VALUE2), - 2 => Val(PC15_A::VALUE3), - 3 => Val(PC15_A::VALUE4), - 4 => Val(PC15_A::VALUE5), - 5 => Val(PC15_A::VALUE6), - 6 => Val(PC15_A::VALUE7), - 7 => Val(PC15_A::VALUE8), - 16 => Val(PC15_A::VALUE9), - 17 => Val(PC15_A::VALUE10), - 18 => Val(PC15_A::VALUE11), - 19 => Val(PC15_A::VALUE12), - 20 => Val(PC15_A::VALUE13), - 24 => Val(PC15_A::VALUE14), - 25 => Val(PC15_A::VALUE15), - 26 => Val(PC15_A::VALUE16), - 27 => Val(PC15_A::VALUE17), - 28 => Val(PC15_A::VALUE18), - i => Res(i), + 0 => Some(PC15_A::VALUE1), + 1 => Some(PC15_A::VALUE2), + 2 => Some(PC15_A::VALUE3), + 3 => Some(PC15_A::VALUE4), + 4 => Some(PC15_A::VALUE5), + 5 => Some(PC15_A::VALUE6), + 6 => Some(PC15_A::VALUE7), + 7 => Some(PC15_A::VALUE8), + 16 => Some(PC15_A::VALUE9), + 17 => Some(PC15_A::VALUE10), + 18 => Some(PC15_A::VALUE11), + 19 => Some(PC15_A::VALUE12), + 20 => Some(PC15_A::VALUE13), + 24 => Some(PC15_A::VALUE14), + 25 => Some(PC15_A::VALUE15), + 26 => Some(PC15_A::VALUE16), + 27 => Some(PC15_A::VALUE17), + 28 => Some(PC15_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC15_A::VALUE1 + **self == PC15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC15_A::VALUE2 + **self == PC15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC15_A::VALUE3 + **self == PC15_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC15_A::VALUE4 + **self == PC15_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC15_A::VALUE5 + **self == PC15_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC15_A::VALUE6 + **self == PC15_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC15_A::VALUE7 + **self == PC15_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC15_A::VALUE8 + **self == PC15_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC15_A::VALUE9 + **self == PC15_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC15_A::VALUE10 + **self == PC15_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC15_A::VALUE11 + **self == PC15_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC15_A::VALUE12 + **self == PC15_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC15_A::VALUE13 + **self == PC15_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC15_A::VALUE14 + **self == PC15_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC15_A::VALUE15 + **self == PC15_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC15_A::VALUE16 + **self == PC15_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC15_A::VALUE17 + **self == PC15_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC15_A::VALUE18 + **self == PC15_A::VALUE18 + } +} +impl core::ops::Deref for PC15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC15`"] +#[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] pub struct PC15_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc15(&mut self) -> PC15_W { PC15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Input/Output Control Register 12\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 [iocr12](index.html) module"] +pub struct IOCR12_SPEC; +impl crate::RegisterSpec for IOCR12_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr12::R](R) reader structure"] +impl crate::Readable for IOCR12_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr12::W](W) writer structure"] +impl crate::Writable for IOCR12_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR12 to value 0"] +impl crate::Resettable for IOCR12_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/iocr4.rs b/src/port1/iocr4.rs index d884a743..5fedb6b9 100644 --- a/src/port1/iocr4.rs +++ b/src/port1/iocr4.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR4"] -pub type R = crate::R; -#[doc = "Writer for register IOCR4"] -pub type W = crate::W; -#[doc = "Register IOCR4 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR4 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC4`"] -pub type PC4_R = crate::R; +#[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC4_R(crate::FieldReader); impl PC4_R { + pub(crate) fn new(bits: u8) -> Self { + PC4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC4_A::VALUE1), - 1 => Val(PC4_A::VALUE2), - 2 => Val(PC4_A::VALUE3), - 3 => Val(PC4_A::VALUE4), - 4 => Val(PC4_A::VALUE5), - 5 => Val(PC4_A::VALUE6), - 6 => Val(PC4_A::VALUE7), - 7 => Val(PC4_A::VALUE8), - 16 => Val(PC4_A::VALUE9), - 17 => Val(PC4_A::VALUE10), - 18 => Val(PC4_A::VALUE11), - 19 => Val(PC4_A::VALUE12), - 20 => Val(PC4_A::VALUE13), - 24 => Val(PC4_A::VALUE14), - 25 => Val(PC4_A::VALUE15), - 26 => Val(PC4_A::VALUE16), - 27 => Val(PC4_A::VALUE17), - 28 => Val(PC4_A::VALUE18), - i => Res(i), + 0 => Some(PC4_A::VALUE1), + 1 => Some(PC4_A::VALUE2), + 2 => Some(PC4_A::VALUE3), + 3 => Some(PC4_A::VALUE4), + 4 => Some(PC4_A::VALUE5), + 5 => Some(PC4_A::VALUE6), + 6 => Some(PC4_A::VALUE7), + 7 => Some(PC4_A::VALUE8), + 16 => Some(PC4_A::VALUE9), + 17 => Some(PC4_A::VALUE10), + 18 => Some(PC4_A::VALUE11), + 19 => Some(PC4_A::VALUE12), + 20 => Some(PC4_A::VALUE13), + 24 => Some(PC4_A::VALUE14), + 25 => Some(PC4_A::VALUE15), + 26 => Some(PC4_A::VALUE16), + 27 => Some(PC4_A::VALUE17), + 28 => Some(PC4_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC4_A::VALUE1 + **self == PC4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC4_A::VALUE2 + **self == PC4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC4_A::VALUE3 + **self == PC4_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC4_A::VALUE4 + **self == PC4_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC4_A::VALUE5 + **self == PC4_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC4_A::VALUE6 + **self == PC4_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC4_A::VALUE7 + **self == PC4_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC4_A::VALUE8 + **self == PC4_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC4_A::VALUE9 + **self == PC4_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC4_A::VALUE10 + **self == PC4_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC4_A::VALUE11 + **self == PC4_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC4_A::VALUE12 + **self == PC4_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC4_A::VALUE13 + **self == PC4_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC4_A::VALUE14 + **self == PC4_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC4_A::VALUE15 + **self == PC4_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC4_A::VALUE16 + **self == PC4_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC4_A::VALUE17 + **self == PC4_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC4_A::VALUE18 + **self == PC4_A::VALUE18 } } -#[doc = "Write proxy for field `PC4`"] +impl core::ops::Deref for PC4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] pub struct PC4_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC5`"] -pub type PC5_R = crate::R; +#[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC5_R(crate::FieldReader); impl PC5_R { + pub(crate) fn new(bits: u8) -> Self { + PC5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC5_A::VALUE1), - 1 => Val(PC5_A::VALUE2), - 2 => Val(PC5_A::VALUE3), - 3 => Val(PC5_A::VALUE4), - 4 => Val(PC5_A::VALUE5), - 5 => Val(PC5_A::VALUE6), - 6 => Val(PC5_A::VALUE7), - 7 => Val(PC5_A::VALUE8), - 16 => Val(PC5_A::VALUE9), - 17 => Val(PC5_A::VALUE10), - 18 => Val(PC5_A::VALUE11), - 19 => Val(PC5_A::VALUE12), - 20 => Val(PC5_A::VALUE13), - 24 => Val(PC5_A::VALUE14), - 25 => Val(PC5_A::VALUE15), - 26 => Val(PC5_A::VALUE16), - 27 => Val(PC5_A::VALUE17), - 28 => Val(PC5_A::VALUE18), - i => Res(i), + 0 => Some(PC5_A::VALUE1), + 1 => Some(PC5_A::VALUE2), + 2 => Some(PC5_A::VALUE3), + 3 => Some(PC5_A::VALUE4), + 4 => Some(PC5_A::VALUE5), + 5 => Some(PC5_A::VALUE6), + 6 => Some(PC5_A::VALUE7), + 7 => Some(PC5_A::VALUE8), + 16 => Some(PC5_A::VALUE9), + 17 => Some(PC5_A::VALUE10), + 18 => Some(PC5_A::VALUE11), + 19 => Some(PC5_A::VALUE12), + 20 => Some(PC5_A::VALUE13), + 24 => Some(PC5_A::VALUE14), + 25 => Some(PC5_A::VALUE15), + 26 => Some(PC5_A::VALUE16), + 27 => Some(PC5_A::VALUE17), + 28 => Some(PC5_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC5_A::VALUE1 + **self == PC5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC5_A::VALUE2 + **self == PC5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC5_A::VALUE3 + **self == PC5_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC5_A::VALUE4 + **self == PC5_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC5_A::VALUE5 + **self == PC5_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC5_A::VALUE6 + **self == PC5_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC5_A::VALUE7 + **self == PC5_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC5_A::VALUE8 + **self == PC5_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC5_A::VALUE9 + **self == PC5_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC5_A::VALUE10 + **self == PC5_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC5_A::VALUE11 + **self == PC5_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC5_A::VALUE12 + **self == PC5_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC5_A::VALUE13 + **self == PC5_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC5_A::VALUE14 + **self == PC5_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC5_A::VALUE15 + **self == PC5_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC5_A::VALUE16 + **self == PC5_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC5_A::VALUE17 + **self == PC5_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC5_A::VALUE18 + **self == PC5_A::VALUE18 } } -#[doc = "Write proxy for field `PC5`"] +impl core::ops::Deref for PC5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] pub struct PC5_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC6`"] -pub type PC6_R = crate::R; +#[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC6_R(crate::FieldReader); impl PC6_R { + pub(crate) fn new(bits: u8) -> Self { + PC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC6_A::VALUE1), - 1 => Val(PC6_A::VALUE2), - 2 => Val(PC6_A::VALUE3), - 3 => Val(PC6_A::VALUE4), - 4 => Val(PC6_A::VALUE5), - 5 => Val(PC6_A::VALUE6), - 6 => Val(PC6_A::VALUE7), - 7 => Val(PC6_A::VALUE8), - 16 => Val(PC6_A::VALUE9), - 17 => Val(PC6_A::VALUE10), - 18 => Val(PC6_A::VALUE11), - 19 => Val(PC6_A::VALUE12), - 20 => Val(PC6_A::VALUE13), - 24 => Val(PC6_A::VALUE14), - 25 => Val(PC6_A::VALUE15), - 26 => Val(PC6_A::VALUE16), - 27 => Val(PC6_A::VALUE17), - 28 => Val(PC6_A::VALUE18), - i => Res(i), + 0 => Some(PC6_A::VALUE1), + 1 => Some(PC6_A::VALUE2), + 2 => Some(PC6_A::VALUE3), + 3 => Some(PC6_A::VALUE4), + 4 => Some(PC6_A::VALUE5), + 5 => Some(PC6_A::VALUE6), + 6 => Some(PC6_A::VALUE7), + 7 => Some(PC6_A::VALUE8), + 16 => Some(PC6_A::VALUE9), + 17 => Some(PC6_A::VALUE10), + 18 => Some(PC6_A::VALUE11), + 19 => Some(PC6_A::VALUE12), + 20 => Some(PC6_A::VALUE13), + 24 => Some(PC6_A::VALUE14), + 25 => Some(PC6_A::VALUE15), + 26 => Some(PC6_A::VALUE16), + 27 => Some(PC6_A::VALUE17), + 28 => Some(PC6_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC6_A::VALUE1 + **self == PC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC6_A::VALUE2 + **self == PC6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC6_A::VALUE3 + **self == PC6_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC6_A::VALUE4 + **self == PC6_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC6_A::VALUE5 + **self == PC6_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC6_A::VALUE6 + **self == PC6_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC6_A::VALUE7 + **self == PC6_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC6_A::VALUE8 + **self == PC6_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC6_A::VALUE9 + **self == PC6_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC6_A::VALUE10 + **self == PC6_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC6_A::VALUE11 + **self == PC6_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC6_A::VALUE12 + **self == PC6_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC6_A::VALUE13 + **self == PC6_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC6_A::VALUE14 + **self == PC6_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC6_A::VALUE15 + **self == PC6_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC6_A::VALUE16 + **self == PC6_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC6_A::VALUE17 + **self == PC6_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC6_A::VALUE18 + **self == PC6_A::VALUE18 + } +} +impl core::ops::Deref for PC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC6`"] +#[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] pub struct PC6_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC7`"] -pub type PC7_R = crate::R; +#[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC7_R(crate::FieldReader); impl PC7_R { + pub(crate) fn new(bits: u8) -> Self { + PC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC7_A::VALUE1), - 1 => Val(PC7_A::VALUE2), - 2 => Val(PC7_A::VALUE3), - 3 => Val(PC7_A::VALUE4), - 4 => Val(PC7_A::VALUE5), - 5 => Val(PC7_A::VALUE6), - 6 => Val(PC7_A::VALUE7), - 7 => Val(PC7_A::VALUE8), - 16 => Val(PC7_A::VALUE9), - 17 => Val(PC7_A::VALUE10), - 18 => Val(PC7_A::VALUE11), - 19 => Val(PC7_A::VALUE12), - 20 => Val(PC7_A::VALUE13), - 24 => Val(PC7_A::VALUE14), - 25 => Val(PC7_A::VALUE15), - 26 => Val(PC7_A::VALUE16), - 27 => Val(PC7_A::VALUE17), - 28 => Val(PC7_A::VALUE18), - i => Res(i), + 0 => Some(PC7_A::VALUE1), + 1 => Some(PC7_A::VALUE2), + 2 => Some(PC7_A::VALUE3), + 3 => Some(PC7_A::VALUE4), + 4 => Some(PC7_A::VALUE5), + 5 => Some(PC7_A::VALUE6), + 6 => Some(PC7_A::VALUE7), + 7 => Some(PC7_A::VALUE8), + 16 => Some(PC7_A::VALUE9), + 17 => Some(PC7_A::VALUE10), + 18 => Some(PC7_A::VALUE11), + 19 => Some(PC7_A::VALUE12), + 20 => Some(PC7_A::VALUE13), + 24 => Some(PC7_A::VALUE14), + 25 => Some(PC7_A::VALUE15), + 26 => Some(PC7_A::VALUE16), + 27 => Some(PC7_A::VALUE17), + 28 => Some(PC7_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC7_A::VALUE1 + **self == PC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC7_A::VALUE2 + **self == PC7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC7_A::VALUE3 + **self == PC7_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC7_A::VALUE4 + **self == PC7_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC7_A::VALUE5 + **self == PC7_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC7_A::VALUE6 + **self == PC7_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC7_A::VALUE7 + **self == PC7_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC7_A::VALUE8 + **self == PC7_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC7_A::VALUE9 + **self == PC7_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC7_A::VALUE10 + **self == PC7_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC7_A::VALUE11 + **self == PC7_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC7_A::VALUE12 + **self == PC7_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC7_A::VALUE13 + **self == PC7_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC7_A::VALUE14 + **self == PC7_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC7_A::VALUE15 + **self == PC7_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC7_A::VALUE16 + **self == PC7_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC7_A::VALUE17 + **self == PC7_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC7_A::VALUE18 + **self == PC7_A::VALUE18 + } +} +impl core::ops::Deref for PC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC7`"] +#[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] pub struct PC7_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc7(&mut self) -> PC7_W { PC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Input/Output Control Register 4\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 [iocr4](index.html) module"] +pub struct IOCR4_SPEC; +impl crate::RegisterSpec for IOCR4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr4::R](R) reader structure"] +impl crate::Readable for IOCR4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr4::W](W) writer structure"] +impl crate::Writable for IOCR4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR4 to value 0"] +impl crate::Resettable for IOCR4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/iocr8.rs b/src/port1/iocr8.rs index 00d96809..b0ea689e 100644 --- a/src/port1/iocr8.rs +++ b/src/port1/iocr8.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR8"] -pub type R = crate::R; -#[doc = "Writer for register IOCR8"] -pub type W = crate::W; -#[doc = "Register IOCR8 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR8 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR8` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR8` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC8`"] -pub type PC8_R = crate::R; +#[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC8_R(crate::FieldReader); impl PC8_R { + pub(crate) fn new(bits: u8) -> Self { + PC8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC8_A::VALUE1), - 1 => Val(PC8_A::VALUE2), - 2 => Val(PC8_A::VALUE3), - 3 => Val(PC8_A::VALUE4), - 4 => Val(PC8_A::VALUE5), - 5 => Val(PC8_A::VALUE6), - 6 => Val(PC8_A::VALUE7), - 7 => Val(PC8_A::VALUE8), - 16 => Val(PC8_A::VALUE9), - 17 => Val(PC8_A::VALUE10), - 18 => Val(PC8_A::VALUE11), - 19 => Val(PC8_A::VALUE12), - 20 => Val(PC8_A::VALUE13), - 24 => Val(PC8_A::VALUE14), - 25 => Val(PC8_A::VALUE15), - 26 => Val(PC8_A::VALUE16), - 27 => Val(PC8_A::VALUE17), - 28 => Val(PC8_A::VALUE18), - i => Res(i), + 0 => Some(PC8_A::VALUE1), + 1 => Some(PC8_A::VALUE2), + 2 => Some(PC8_A::VALUE3), + 3 => Some(PC8_A::VALUE4), + 4 => Some(PC8_A::VALUE5), + 5 => Some(PC8_A::VALUE6), + 6 => Some(PC8_A::VALUE7), + 7 => Some(PC8_A::VALUE8), + 16 => Some(PC8_A::VALUE9), + 17 => Some(PC8_A::VALUE10), + 18 => Some(PC8_A::VALUE11), + 19 => Some(PC8_A::VALUE12), + 20 => Some(PC8_A::VALUE13), + 24 => Some(PC8_A::VALUE14), + 25 => Some(PC8_A::VALUE15), + 26 => Some(PC8_A::VALUE16), + 27 => Some(PC8_A::VALUE17), + 28 => Some(PC8_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC8_A::VALUE1 + **self == PC8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC8_A::VALUE2 + **self == PC8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC8_A::VALUE3 + **self == PC8_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC8_A::VALUE4 + **self == PC8_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC8_A::VALUE5 + **self == PC8_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC8_A::VALUE6 + **self == PC8_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC8_A::VALUE7 + **self == PC8_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC8_A::VALUE8 + **self == PC8_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC8_A::VALUE9 + **self == PC8_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC8_A::VALUE10 + **self == PC8_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC8_A::VALUE11 + **self == PC8_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC8_A::VALUE12 + **self == PC8_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC8_A::VALUE13 + **self == PC8_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC8_A::VALUE14 + **self == PC8_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC8_A::VALUE15 + **self == PC8_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC8_A::VALUE16 + **self == PC8_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC8_A::VALUE17 + **self == PC8_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC8_A::VALUE18 + **self == PC8_A::VALUE18 } } -#[doc = "Write proxy for field `PC8`"] +impl core::ops::Deref for PC8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] pub struct PC8_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC9`"] -pub type PC9_R = crate::R; +#[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC9_R(crate::FieldReader); impl PC9_R { + pub(crate) fn new(bits: u8) -> Self { + PC9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC9_A::VALUE1), - 1 => Val(PC9_A::VALUE2), - 2 => Val(PC9_A::VALUE3), - 3 => Val(PC9_A::VALUE4), - 4 => Val(PC9_A::VALUE5), - 5 => Val(PC9_A::VALUE6), - 6 => Val(PC9_A::VALUE7), - 7 => Val(PC9_A::VALUE8), - 16 => Val(PC9_A::VALUE9), - 17 => Val(PC9_A::VALUE10), - 18 => Val(PC9_A::VALUE11), - 19 => Val(PC9_A::VALUE12), - 20 => Val(PC9_A::VALUE13), - 24 => Val(PC9_A::VALUE14), - 25 => Val(PC9_A::VALUE15), - 26 => Val(PC9_A::VALUE16), - 27 => Val(PC9_A::VALUE17), - 28 => Val(PC9_A::VALUE18), - i => Res(i), + 0 => Some(PC9_A::VALUE1), + 1 => Some(PC9_A::VALUE2), + 2 => Some(PC9_A::VALUE3), + 3 => Some(PC9_A::VALUE4), + 4 => Some(PC9_A::VALUE5), + 5 => Some(PC9_A::VALUE6), + 6 => Some(PC9_A::VALUE7), + 7 => Some(PC9_A::VALUE8), + 16 => Some(PC9_A::VALUE9), + 17 => Some(PC9_A::VALUE10), + 18 => Some(PC9_A::VALUE11), + 19 => Some(PC9_A::VALUE12), + 20 => Some(PC9_A::VALUE13), + 24 => Some(PC9_A::VALUE14), + 25 => Some(PC9_A::VALUE15), + 26 => Some(PC9_A::VALUE16), + 27 => Some(PC9_A::VALUE17), + 28 => Some(PC9_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC9_A::VALUE1 + **self == PC9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC9_A::VALUE2 + **self == PC9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC9_A::VALUE3 + **self == PC9_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC9_A::VALUE4 + **self == PC9_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC9_A::VALUE5 + **self == PC9_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC9_A::VALUE6 + **self == PC9_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC9_A::VALUE7 + **self == PC9_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC9_A::VALUE8 + **self == PC9_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC9_A::VALUE9 + **self == PC9_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC9_A::VALUE10 + **self == PC9_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC9_A::VALUE11 + **self == PC9_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC9_A::VALUE12 + **self == PC9_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC9_A::VALUE13 + **self == PC9_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC9_A::VALUE14 + **self == PC9_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC9_A::VALUE15 + **self == PC9_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC9_A::VALUE16 + **self == PC9_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC9_A::VALUE17 + **self == PC9_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC9_A::VALUE18 + **self == PC9_A::VALUE18 } } -#[doc = "Write proxy for field `PC9`"] +impl core::ops::Deref for PC9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] pub struct PC9_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC10`"] -pub type PC10_R = crate::R; +#[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC10_R(crate::FieldReader); impl PC10_R { + pub(crate) fn new(bits: u8) -> Self { + PC10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC10_A::VALUE1), - 1 => Val(PC10_A::VALUE2), - 2 => Val(PC10_A::VALUE3), - 3 => Val(PC10_A::VALUE4), - 4 => Val(PC10_A::VALUE5), - 5 => Val(PC10_A::VALUE6), - 6 => Val(PC10_A::VALUE7), - 7 => Val(PC10_A::VALUE8), - 16 => Val(PC10_A::VALUE9), - 17 => Val(PC10_A::VALUE10), - 18 => Val(PC10_A::VALUE11), - 19 => Val(PC10_A::VALUE12), - 20 => Val(PC10_A::VALUE13), - 24 => Val(PC10_A::VALUE14), - 25 => Val(PC10_A::VALUE15), - 26 => Val(PC10_A::VALUE16), - 27 => Val(PC10_A::VALUE17), - 28 => Val(PC10_A::VALUE18), - i => Res(i), + 0 => Some(PC10_A::VALUE1), + 1 => Some(PC10_A::VALUE2), + 2 => Some(PC10_A::VALUE3), + 3 => Some(PC10_A::VALUE4), + 4 => Some(PC10_A::VALUE5), + 5 => Some(PC10_A::VALUE6), + 6 => Some(PC10_A::VALUE7), + 7 => Some(PC10_A::VALUE8), + 16 => Some(PC10_A::VALUE9), + 17 => Some(PC10_A::VALUE10), + 18 => Some(PC10_A::VALUE11), + 19 => Some(PC10_A::VALUE12), + 20 => Some(PC10_A::VALUE13), + 24 => Some(PC10_A::VALUE14), + 25 => Some(PC10_A::VALUE15), + 26 => Some(PC10_A::VALUE16), + 27 => Some(PC10_A::VALUE17), + 28 => Some(PC10_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC10_A::VALUE1 + **self == PC10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC10_A::VALUE2 + **self == PC10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC10_A::VALUE3 + **self == PC10_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC10_A::VALUE4 + **self == PC10_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC10_A::VALUE5 + **self == PC10_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC10_A::VALUE6 + **self == PC10_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC10_A::VALUE7 + **self == PC10_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC10_A::VALUE8 + **self == PC10_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC10_A::VALUE9 + **self == PC10_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC10_A::VALUE10 + **self == PC10_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC10_A::VALUE11 + **self == PC10_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC10_A::VALUE12 + **self == PC10_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC10_A::VALUE13 + **self == PC10_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC10_A::VALUE14 + **self == PC10_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC10_A::VALUE15 + **self == PC10_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC10_A::VALUE16 + **self == PC10_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC10_A::VALUE17 + **self == PC10_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC10_A::VALUE18 + **self == PC10_A::VALUE18 + } +} +impl core::ops::Deref for PC10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC10`"] +#[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] pub struct PC10_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC11`"] -pub type PC11_R = crate::R; +#[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC11_R(crate::FieldReader); impl PC11_R { + pub(crate) fn new(bits: u8) -> Self { + PC11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC11_A::VALUE1), - 1 => Val(PC11_A::VALUE2), - 2 => Val(PC11_A::VALUE3), - 3 => Val(PC11_A::VALUE4), - 4 => Val(PC11_A::VALUE5), - 5 => Val(PC11_A::VALUE6), - 6 => Val(PC11_A::VALUE7), - 7 => Val(PC11_A::VALUE8), - 16 => Val(PC11_A::VALUE9), - 17 => Val(PC11_A::VALUE10), - 18 => Val(PC11_A::VALUE11), - 19 => Val(PC11_A::VALUE12), - 20 => Val(PC11_A::VALUE13), - 24 => Val(PC11_A::VALUE14), - 25 => Val(PC11_A::VALUE15), - 26 => Val(PC11_A::VALUE16), - 27 => Val(PC11_A::VALUE17), - 28 => Val(PC11_A::VALUE18), - i => Res(i), + 0 => Some(PC11_A::VALUE1), + 1 => Some(PC11_A::VALUE2), + 2 => Some(PC11_A::VALUE3), + 3 => Some(PC11_A::VALUE4), + 4 => Some(PC11_A::VALUE5), + 5 => Some(PC11_A::VALUE6), + 6 => Some(PC11_A::VALUE7), + 7 => Some(PC11_A::VALUE8), + 16 => Some(PC11_A::VALUE9), + 17 => Some(PC11_A::VALUE10), + 18 => Some(PC11_A::VALUE11), + 19 => Some(PC11_A::VALUE12), + 20 => Some(PC11_A::VALUE13), + 24 => Some(PC11_A::VALUE14), + 25 => Some(PC11_A::VALUE15), + 26 => Some(PC11_A::VALUE16), + 27 => Some(PC11_A::VALUE17), + 28 => Some(PC11_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC11_A::VALUE1 + **self == PC11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC11_A::VALUE2 + **self == PC11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC11_A::VALUE3 + **self == PC11_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC11_A::VALUE4 + **self == PC11_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC11_A::VALUE5 + **self == PC11_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC11_A::VALUE6 + **self == PC11_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC11_A::VALUE7 + **self == PC11_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC11_A::VALUE8 + **self == PC11_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC11_A::VALUE9 + **self == PC11_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC11_A::VALUE10 + **self == PC11_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC11_A::VALUE11 + **self == PC11_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC11_A::VALUE12 + **self == PC11_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC11_A::VALUE13 + **self == PC11_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC11_A::VALUE14 + **self == PC11_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC11_A::VALUE15 + **self == PC11_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC11_A::VALUE16 + **self == PC11_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC11_A::VALUE17 + **self == PC11_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC11_A::VALUE18 + **self == PC11_A::VALUE18 + } +} +impl core::ops::Deref for PC11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC11`"] +#[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] pub struct PC11_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc11(&mut self) -> PC11_W { PC11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Input/Output Control Register 8\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 [iocr8](index.html) module"] +pub struct IOCR8_SPEC; +impl crate::RegisterSpec for IOCR8_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr8::R](R) reader structure"] +impl crate::Readable for IOCR8_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr8::W](W) writer structure"] +impl crate::Writable for IOCR8_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR8 to value 0"] +impl crate::Resettable for IOCR8_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/omr.rs b/src/port1/omr.rs index c8c458f2..a4b80bc3 100644 --- a/src/port1/omr.rs +++ b/src/port1/omr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OMR"] -pub type W = crate::W; -#[doc = "Register OMR `reset()`'s with value 0"] -impl crate::ResetValue for super::OMR { - type Type = u32; +#[doc = "Register `OMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `PS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PS0` writer - Port n Set Bit 0"] pub struct PS0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> PS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `PS1`"] +#[doc = "Field `PS1` writer - Port n Set Bit 1"] pub struct PS1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> PS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS2`"] +#[doc = "Field `PS2` writer - Port n Set Bit 2"] pub struct PS2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS3`"] +#[doc = "Field `PS3` writer - Port n Set Bit 3"] pub struct PS3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS4`"] +#[doc = "Field `PS4` writer - Port n Set Bit 4"] pub struct PS4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PS5`"] +#[doc = "Field `PS5` writer - Port n Set Bit 5"] pub struct PS5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `PS6`"] +#[doc = "Field `PS6` writer - Port n Set Bit 6"] pub struct PS6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> PS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `PS7`"] +#[doc = "Field `PS7` writer - Port n Set Bit 7"] pub struct PS7_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `PS8`"] +#[doc = "Field `PS8` writer - Port n Set Bit 8"] pub struct PS8_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PS9`"] +#[doc = "Field `PS9` writer - Port n Set Bit 9"] pub struct PS9_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS10`"] +#[doc = "Field `PS10` writer - Port n Set Bit 10"] pub struct PS10_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> PS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS11`"] +#[doc = "Field `PS11` writer - Port n Set Bit 11"] pub struct PS11_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> PS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS12`"] +#[doc = "Field `PS12` writer - Port n Set Bit 12"] pub struct PS12_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `PS13`"] +#[doc = "Field `PS13` writer - Port n Set Bit 13"] pub struct PS13_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `PS14`"] +#[doc = "Field `PS14` writer - Port n Set Bit 14"] pub struct PS14_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> PS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `PS15`"] +#[doc = "Field `PS15` writer - Port n Set Bit 15"] pub struct PS15_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> PS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Write proxy for field `PR0`"] +#[doc = "Field `PR0` writer - Port n Reset Bit 0"] pub struct PR0_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> PR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `PR1`"] +#[doc = "Field `PR1` writer - Port n Reset Bit 1"] pub struct PR1_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> PR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PR2`"] +#[doc = "Field `PR2` writer - Port n Reset Bit 2"] pub struct PR2_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> PR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PR3`"] +#[doc = "Field `PR3` writer - Port n Reset Bit 3"] pub struct PR3_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> PR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PR4`"] +#[doc = "Field `PR4` writer - Port n Reset Bit 4"] pub struct PR4_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> PR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `PR5`"] +#[doc = "Field `PR5` writer - Port n Reset Bit 5"] pub struct PR5_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> PR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `PR6`"] +#[doc = "Field `PR6` writer - Port n Reset Bit 6"] pub struct PR6_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> PR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `PR7`"] +#[doc = "Field `PR7` writer - Port n Reset Bit 7"] pub struct PR7_W<'a> { w: &'a mut W, } @@ -532,11 +543,11 @@ impl<'a> PR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `PR8`"] +#[doc = "Field `PR8` writer - Port n Reset Bit 8"] pub struct PR8_W<'a> { w: &'a mut W, } @@ -554,11 +565,11 @@ impl<'a> PR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `PR9`"] +#[doc = "Field `PR9` writer - Port n Reset Bit 9"] pub struct PR9_W<'a> { w: &'a mut W, } @@ -576,11 +587,11 @@ impl<'a> PR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `PR10`"] +#[doc = "Field `PR10` writer - Port n Reset Bit 10"] pub struct PR10_W<'a> { w: &'a mut W, } @@ -598,11 +609,11 @@ impl<'a> PR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `PR11`"] +#[doc = "Field `PR11` writer - Port n Reset Bit 11"] pub struct PR11_W<'a> { w: &'a mut W, } @@ -620,11 +631,11 @@ impl<'a> PR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `PR12`"] +#[doc = "Field `PR12` writer - Port n Reset Bit 12"] pub struct PR12_W<'a> { w: &'a mut W, } @@ -642,11 +653,11 @@ impl<'a> PR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `PR13`"] +#[doc = "Field `PR13` writer - Port n Reset Bit 13"] pub struct PR13_W<'a> { w: &'a mut W, } @@ -664,11 +675,11 @@ impl<'a> PR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Write proxy for field `PR14`"] +#[doc = "Field `PR14` writer - Port n Reset Bit 14"] pub struct PR14_W<'a> { w: &'a mut W, } @@ -686,11 +697,11 @@ impl<'a> PR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Write proxy for field `PR15`"] +#[doc = "Field `PR15` writer - Port n Reset Bit 15"] pub struct PR15_W<'a> { w: &'a mut W, } @@ -708,7 +719,7 @@ impl<'a> PR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -873,4 +884,26 @@ impl W { pub fn pr15(&mut self) -> PR15_W { PR15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Output Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](index.html) module"] +pub struct OMR_SPEC; +impl crate::RegisterSpec for OMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +impl crate::Writable for OMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OMR to value 0"] +impl crate::Resettable for OMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/out.rs b/src/port1/out.rs index 234afddb..0fc315b0 100644 --- a/src/port1/out.rs +++ b/src/port1/out.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OUT"] -pub type R = crate::R; -#[doc = "Writer for register OUT"] -pub type W = crate::W; -#[doc = "Register OUT `reset()`'s with value 0"] -impl crate::ResetValue for super::OUT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Output Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -38,15 +65,22 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 } } -#[doc = "Write proxy for field `P0`"] +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P0` writer - Port n Output Bit 0"] pub struct P0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Output Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -113,15 +148,22 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 } } -#[doc = "Write proxy for field `P1`"] +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P1` writer - Port n Output Bit 1"] pub struct P1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Output Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -188,15 +231,22 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P2`"] +#[doc = "Field `P2` writer - Port n Output Bit 2"] pub struct P2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Output Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -263,15 +314,22 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P3`"] +#[doc = "Field `P3` writer - Port n Output Bit 3"] pub struct P3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Output Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -338,15 +397,22 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P4`"] +#[doc = "Field `P4` writer - Port n Output Bit 4"] pub struct P4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Output Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -413,15 +480,22 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P5`"] +#[doc = "Field `P5` writer - Port n Output Bit 5"] pub struct P5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Output Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -488,15 +563,22 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 } } -#[doc = "Write proxy for field `P6`"] +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P6` writer - Port n Output Bit 6"] pub struct P6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Output Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -563,15 +646,22 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 } } -#[doc = "Write proxy for field `P7`"] +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P7` writer - Port n Output Bit 7"] pub struct P7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Output Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -638,15 +729,22 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 } } -#[doc = "Write proxy for field `P8`"] +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P8` writer - Port n Output Bit 8"] pub struct P8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Output Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -713,15 +812,22 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P9`"] +#[doc = "Field `P9` writer - Port n Output Bit 9"] pub struct P9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Output Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -788,15 +895,22 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 } } -#[doc = "Write proxy for field `P10`"] +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P10` writer - Port n Output Bit 10"] pub struct P10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Output Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -863,15 +978,22 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 } } -#[doc = "Write proxy for field `P11`"] +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P11` writer - Port n Output Bit 11"] pub struct P11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Output Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -938,15 +1061,22 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P12`"] +#[doc = "Field `P12` writer - Port n Output Bit 12"] pub struct P12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Output Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -1013,15 +1144,22 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 } } -#[doc = "Write proxy for field `P13`"] +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P13` writer - Port n Output Bit 13"] pub struct P13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Output Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -1088,15 +1227,22 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 } } -#[doc = "Write proxy for field `P14`"] +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P14` writer - Port n Output Bit 14"] pub struct P14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Output Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -1163,15 +1310,22 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 } } -#[doc = "Write proxy for field `P15`"] +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P15` writer - Port n Output Bit 15"] pub struct P15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn p15(&mut self) -> P15_W { P15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Output Register\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 [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port1/pdisc.rs b/src/port1/pdisc.rs index dad72964..79ff12fe 100644 --- a/src/port1/pdisc.rs +++ b/src/port1/pdisc.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PDISC"] -pub type R = crate::R; +#[doc = "Register `PDISC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PDIS0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS0`"] -pub type PDIS0_R = crate::R; +#[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] +pub struct PDIS0_R(crate::FieldReader); impl PDIS0_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS0_A { @@ -28,12 +44,19 @@ impl PDIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS0_A::VALUE1 + **self == PDIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS0_A::VALUE2 + **self == PDIS0_A::VALUE2 + } +} +impl core::ops::Deref for PDIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS1`"] -pub type PDIS1_R = crate::R; +#[doc = "Field `PDIS1` reader - Pad Disable for Port n Pin 1"] +pub struct PDIS1_R(crate::FieldReader); impl PDIS1_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS1_A { @@ -64,12 +90,19 @@ impl PDIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS1_A::VALUE1 + **self == PDIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS1_A::VALUE2 + **self == PDIS1_A::VALUE2 + } +} +impl core::ops::Deref for PDIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS2`"] -pub type PDIS2_R = crate::R; +#[doc = "Field `PDIS2` reader - Pad Disable for Port n Pin 2"] +pub struct PDIS2_R(crate::FieldReader); impl PDIS2_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS2_A { @@ -100,12 +136,19 @@ impl PDIS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS2_A::VALUE1 + **self == PDIS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS2_A::VALUE2 + **self == PDIS2_A::VALUE2 + } +} +impl core::ops::Deref for PDIS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS3`"] -pub type PDIS3_R = crate::R; +#[doc = "Field `PDIS3` reader - Pad Disable for Port n Pin 3"] +pub struct PDIS3_R(crate::FieldReader); impl PDIS3_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS3_A { @@ -136,12 +182,19 @@ impl PDIS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS3_A::VALUE1 + **self == PDIS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS3_A::VALUE2 + **self == PDIS3_A::VALUE2 + } +} +impl core::ops::Deref for PDIS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS4`"] -pub type PDIS4_R = crate::R; +#[doc = "Field `PDIS4` reader - Pad Disable for Port n Pin 4"] +pub struct PDIS4_R(crate::FieldReader); impl PDIS4_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS4_A { @@ -172,12 +228,19 @@ impl PDIS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS4_A::VALUE1 + **self == PDIS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS4_A::VALUE2 + **self == PDIS4_A::VALUE2 + } +} +impl core::ops::Deref for PDIS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS5`"] -pub type PDIS5_R = crate::R; +#[doc = "Field `PDIS5` reader - Pad Disable for Port n Pin 5"] +pub struct PDIS5_R(crate::FieldReader); impl PDIS5_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS5_A { @@ -208,12 +274,19 @@ impl PDIS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS5_A::VALUE1 + **self == PDIS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS5_A::VALUE2 + **self == PDIS5_A::VALUE2 + } +} +impl core::ops::Deref for PDIS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS6`"] -pub type PDIS6_R = crate::R; +#[doc = "Field `PDIS6` reader - Pad Disable for Port n Pin 6"] +pub struct PDIS6_R(crate::FieldReader); impl PDIS6_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS6_A { @@ -244,12 +320,19 @@ impl PDIS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS6_A::VALUE1 + **self == PDIS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS6_A::VALUE2 + **self == PDIS6_A::VALUE2 + } +} +impl core::ops::Deref for PDIS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS7`"] -pub type PDIS7_R = crate::R; +#[doc = "Field `PDIS7` reader - Pad Disable for Port n Pin 7"] +pub struct PDIS7_R(crate::FieldReader); impl PDIS7_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS7_A { @@ -280,12 +366,19 @@ impl PDIS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS7_A::VALUE1 + **self == PDIS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS7_A::VALUE2 + **self == PDIS7_A::VALUE2 + } +} +impl core::ops::Deref for PDIS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS8`"] -pub type PDIS8_R = crate::R; +#[doc = "Field `PDIS8` reader - Pad Disable for Port n Pin 8"] +pub struct PDIS8_R(crate::FieldReader); impl PDIS8_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS8_A { @@ -316,12 +412,19 @@ impl PDIS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS8_A::VALUE1 + **self == PDIS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS8_A::VALUE2 + **self == PDIS8_A::VALUE2 + } +} +impl core::ops::Deref for PDIS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS9`"] -pub type PDIS9_R = crate::R; +#[doc = "Field `PDIS9` reader - Pad Disable for Port n Pin 9"] +pub struct PDIS9_R(crate::FieldReader); impl PDIS9_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS9_A { @@ -352,12 +458,19 @@ impl PDIS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS9_A::VALUE1 + **self == PDIS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS9_A::VALUE2 + **self == PDIS9_A::VALUE2 + } +} +impl core::ops::Deref for PDIS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS10`"] -pub type PDIS10_R = crate::R; +#[doc = "Field `PDIS10` reader - Pad Disable for Port n Pin 10"] +pub struct PDIS10_R(crate::FieldReader); impl PDIS10_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS10_A { @@ -388,12 +504,19 @@ impl PDIS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS10_A::VALUE1 + **self == PDIS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS10_A::VALUE2 + **self == PDIS10_A::VALUE2 + } +} +impl core::ops::Deref for PDIS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS11`"] -pub type PDIS11_R = crate::R; +#[doc = "Field `PDIS11` reader - Pad Disable for Port n Pin 11"] +pub struct PDIS11_R(crate::FieldReader); impl PDIS11_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS11_A { @@ -424,12 +550,19 @@ impl PDIS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS11_A::VALUE1 + **self == PDIS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS11_A::VALUE2 + **self == PDIS11_A::VALUE2 + } +} +impl core::ops::Deref for PDIS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS12`"] -pub type PDIS12_R = crate::R; +#[doc = "Field `PDIS12` reader - Pad Disable for Port n Pin 12"] +pub struct PDIS12_R(crate::FieldReader); impl PDIS12_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS12_A { @@ -460,12 +596,19 @@ impl PDIS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS12_A::VALUE1 + **self == PDIS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS12_A::VALUE2 + **self == PDIS12_A::VALUE2 + } +} +impl core::ops::Deref for PDIS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS13`"] -pub type PDIS13_R = crate::R; +#[doc = "Field `PDIS13` reader - Pad Disable for Port n Pin 13"] +pub struct PDIS13_R(crate::FieldReader); impl PDIS13_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS13_A { @@ -496,12 +642,19 @@ impl PDIS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS13_A::VALUE1 + **self == PDIS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS13_A::VALUE2 + **self == PDIS13_A::VALUE2 + } +} +impl core::ops::Deref for PDIS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS14`"] -pub type PDIS14_R = crate::R; +#[doc = "Field `PDIS14` reader - Pad Disable for Port n Pin 14"] +pub struct PDIS14_R(crate::FieldReader); impl PDIS14_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS14_A { @@ -532,12 +688,19 @@ impl PDIS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS14_A::VALUE1 + **self == PDIS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS14_A::VALUE2 + **self == PDIS14_A::VALUE2 + } +} +impl core::ops::Deref for PDIS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS15`"] -pub type PDIS15_R = crate::R; +#[doc = "Field `PDIS15` reader - Pad Disable for Port n Pin 15"] +pub struct PDIS15_R(crate::FieldReader); impl PDIS15_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS15_A { @@ -568,12 +734,19 @@ impl PDIS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS15_A::VALUE1 + **self == PDIS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS15_A::VALUE2 + **self == PDIS15_A::VALUE2 + } +} +impl core::ops::Deref for PDIS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 1 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](index.html) module"] +pub struct PDISC_SPEC; +impl crate::RegisterSpec for PDISC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdisc::R](R) reader structure"] +impl crate::Readable for PDISC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PDISC to value 0"] +impl crate::Resettable for PDISC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port1/pdr0.rs b/src/port1/pdr0.rs index 0923fc4a..edf108d1 100644 --- a/src/port1/pdr0.rs +++ b/src/port1/pdr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR0"] -pub type R = crate::R; -#[doc = "Writer for register PDR0"] -pub type W = crate::W; -#[doc = "Register PDR0 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] +pub struct PD0_R(crate::FieldReader); +impl PD0_R { + pub(crate) fn new(bits: u8) -> Self { + PD0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD0`"] -pub type PD0_R = crate::R; -#[doc = "Write proxy for field `PD0`"] +impl core::ops::Deref for PD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] pub struct PD0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD1`"] -pub type PD1_R = crate::R; -#[doc = "Write proxy for field `PD1`"] +#[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] +pub struct PD1_R(crate::FieldReader); +impl PD1_R { + pub(crate) fn new(bits: u8) -> Self { + PD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] pub struct PD1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD2`"] -pub type PD2_R = crate::R; -#[doc = "Write proxy for field `PD2`"] +#[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] +pub struct PD2_R(crate::FieldReader); +impl PD2_R { + pub(crate) fn new(bits: u8) -> Self { + PD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] pub struct PD2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD3`"] -pub type PD3_R = crate::R; -#[doc = "Write proxy for field `PD3`"] +#[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] +pub struct PD3_R(crate::FieldReader); +impl PD3_R { + pub(crate) fn new(bits: u8) -> Self { + PD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] pub struct PD3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD4`"] -pub type PD4_R = crate::R; -#[doc = "Write proxy for field `PD4`"] +#[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] +pub struct PD4_R(crate::FieldReader); +impl PD4_R { + pub(crate) fn new(bits: u8) -> Self { + PD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] pub struct PD4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD5`"] -pub type PD5_R = crate::R; -#[doc = "Write proxy for field `PD5`"] +#[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] +pub struct PD5_R(crate::FieldReader); +impl PD5_R { + pub(crate) fn new(bits: u8) -> Self { + PD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] pub struct PD5_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD6`"] -pub type PD6_R = crate::R; -#[doc = "Write proxy for field `PD6`"] +#[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] +pub struct PD6_R(crate::FieldReader); +impl PD6_R { + pub(crate) fn new(bits: u8) -> Self { + PD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] pub struct PD6_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD7`"] -pub type PD7_R = crate::R; -#[doc = "Write proxy for field `PD7`"] +#[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] +pub struct PD7_R(crate::FieldReader); +impl PD7_R { + pub(crate) fn new(bits: u8) -> Self { + PD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] pub struct PD7_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd7(&mut self) -> PD7_W { PD7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Pad Driver Mode 0 Register\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 [pdr0](index.html) module"] +pub struct PDR0_SPEC; +impl crate::RegisterSpec for PDR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr0::R](R) reader structure"] +impl crate::Readable for PDR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr0::W](W) writer structure"] +impl crate::Writable for PDR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR0 to value 0x2222_2222"] +impl crate::Resettable for PDR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port1/pdr1.rs b/src/port1/pdr1.rs index 2587bf70..86478188 100644 --- a/src/port1/pdr1.rs +++ b/src/port1/pdr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR1"] -pub type R = crate::R; -#[doc = "Writer for register PDR1"] -pub type W = crate::W; -#[doc = "Register PDR1 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] +pub struct PD8_R(crate::FieldReader); +impl PD8_R { + pub(crate) fn new(bits: u8) -> Self { + PD8_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD8`"] -pub type PD8_R = crate::R; -#[doc = "Write proxy for field `PD8`"] +impl core::ops::Deref for PD8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] pub struct PD8_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD9`"] -pub type PD9_R = crate::R; -#[doc = "Write proxy for field `PD9`"] +#[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] +pub struct PD9_R(crate::FieldReader); +impl PD9_R { + pub(crate) fn new(bits: u8) -> Self { + PD9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] pub struct PD9_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD10`"] -pub type PD10_R = crate::R; -#[doc = "Write proxy for field `PD10`"] +#[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] +pub struct PD10_R(crate::FieldReader); +impl PD10_R { + pub(crate) fn new(bits: u8) -> Self { + PD10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] pub struct PD10_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD11`"] -pub type PD11_R = crate::R; -#[doc = "Write proxy for field `PD11`"] +#[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] +pub struct PD11_R(crate::FieldReader); +impl PD11_R { + pub(crate) fn new(bits: u8) -> Self { + PD11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] pub struct PD11_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD12`"] -pub type PD12_R = crate::R; -#[doc = "Write proxy for field `PD12`"] +#[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] +pub struct PD12_R(crate::FieldReader); +impl PD12_R { + pub(crate) fn new(bits: u8) -> Self { + PD12_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] pub struct PD12_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD13`"] -pub type PD13_R = crate::R; -#[doc = "Write proxy for field `PD13`"] +#[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] +pub struct PD13_R(crate::FieldReader); +impl PD13_R { + pub(crate) fn new(bits: u8) -> Self { + PD13_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] pub struct PD13_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD14`"] -pub type PD14_R = crate::R; -#[doc = "Write proxy for field `PD14`"] +#[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] +pub struct PD14_R(crate::FieldReader); +impl PD14_R { + pub(crate) fn new(bits: u8) -> Self { + PD14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] pub struct PD14_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD15`"] -pub type PD15_R = crate::R; -#[doc = "Write proxy for field `PD15`"] +#[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] +pub struct PD15_R(crate::FieldReader); +impl PD15_R { + pub(crate) fn new(bits: u8) -> Self { + PD15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] pub struct PD15_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd15(&mut self) -> PD15_W { PD15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Pad Driver Mode 1 Register\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 [pdr1](index.html) module"] +pub struct PDR1_SPEC; +impl crate::RegisterSpec for PDR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr1::R](R) reader structure"] +impl crate::Readable for PDR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr1::W](W) writer structure"] +impl crate::Writable for PDR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR1 to value 0x2222_2222"] +impl crate::Resettable for PDR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port1/pps.rs b/src/port1/pps.rs index b45c5930..1ce57524 100644 --- a/src/port1/pps.rs +++ b/src/port1/pps.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PPS"] -pub type R = crate::R; -#[doc = "Writer for register PPS"] -pub type W = crate::W; -#[doc = "Register PPS `reset()`'s with value 0"] -impl crate::ResetValue for super::PPS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS0`"] -pub type PPS0_R = crate::R; +#[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] +pub struct PPS0_R(crate::FieldReader); impl PPS0_R { + pub(crate) fn new(bits: bool) -> Self { + PPS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS0_A { @@ -38,15 +65,22 @@ impl PPS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS0_A::VALUE1 + **self == PPS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS0_A::VALUE2 + **self == PPS0_A::VALUE2 } } -#[doc = "Write proxy for field `PPS0`"] +impl core::ops::Deref for PPS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] pub struct PPS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS1`"] -pub type PPS1_R = crate::R; +#[doc = "Field `PPS1` reader - Port n Pin Power Save Bit 1"] +pub struct PPS1_R(crate::FieldReader); impl PPS1_R { + pub(crate) fn new(bits: bool) -> Self { + PPS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS1_A { @@ -113,15 +148,22 @@ impl PPS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS1_A::VALUE1 + **self == PPS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS1_A::VALUE2 + **self == PPS1_A::VALUE2 } } -#[doc = "Write proxy for field `PPS1`"] +impl core::ops::Deref for PPS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] pub struct PPS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS2`"] -pub type PPS2_R = crate::R; +#[doc = "Field `PPS2` reader - Port n Pin Power Save Bit 2"] +pub struct PPS2_R(crate::FieldReader); impl PPS2_R { + pub(crate) fn new(bits: bool) -> Self { + PPS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS2_A { @@ -188,15 +231,22 @@ impl PPS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS2_A::VALUE1 + **self == PPS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS2_A::VALUE2 + **self == PPS2_A::VALUE2 + } +} +impl core::ops::Deref for PPS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS2`"] +#[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] pub struct PPS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS3`"] -pub type PPS3_R = crate::R; +#[doc = "Field `PPS3` reader - Port n Pin Power Save Bit 3"] +pub struct PPS3_R(crate::FieldReader); impl PPS3_R { + pub(crate) fn new(bits: bool) -> Self { + PPS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS3_A { @@ -263,15 +314,22 @@ impl PPS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS3_A::VALUE1 + **self == PPS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS3_A::VALUE2 + **self == PPS3_A::VALUE2 + } +} +impl core::ops::Deref for PPS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS3`"] +#[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] pub struct PPS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS4`"] -pub type PPS4_R = crate::R; +#[doc = "Field `PPS4` reader - Port n Pin Power Save Bit 4"] +pub struct PPS4_R(crate::FieldReader); impl PPS4_R { + pub(crate) fn new(bits: bool) -> Self { + PPS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS4_A { @@ -338,15 +397,22 @@ impl PPS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS4_A::VALUE1 + **self == PPS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS4_A::VALUE2 + **self == PPS4_A::VALUE2 + } +} +impl core::ops::Deref for PPS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS4`"] +#[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] pub struct PPS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS5`"] -pub type PPS5_R = crate::R; +#[doc = "Field `PPS5` reader - Port n Pin Power Save Bit 5"] +pub struct PPS5_R(crate::FieldReader); impl PPS5_R { + pub(crate) fn new(bits: bool) -> Self { + PPS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS5_A { @@ -413,15 +480,22 @@ impl PPS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS5_A::VALUE1 + **self == PPS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS5_A::VALUE2 + **self == PPS5_A::VALUE2 + } +} +impl core::ops::Deref for PPS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS5`"] +#[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] pub struct PPS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS6`"] -pub type PPS6_R = crate::R; +#[doc = "Field `PPS6` reader - Port n Pin Power Save Bit 6"] +pub struct PPS6_R(crate::FieldReader); impl PPS6_R { + pub(crate) fn new(bits: bool) -> Self { + PPS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS6_A { @@ -488,15 +563,22 @@ impl PPS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS6_A::VALUE1 + **self == PPS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS6_A::VALUE2 + **self == PPS6_A::VALUE2 } } -#[doc = "Write proxy for field `PPS6`"] +impl core::ops::Deref for PPS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] pub struct PPS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS7`"] -pub type PPS7_R = crate::R; +#[doc = "Field `PPS7` reader - Port n Pin Power Save Bit 7"] +pub struct PPS7_R(crate::FieldReader); impl PPS7_R { + pub(crate) fn new(bits: bool) -> Self { + PPS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS7_A { @@ -563,15 +646,22 @@ impl PPS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS7_A::VALUE1 + **self == PPS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS7_A::VALUE2 + **self == PPS7_A::VALUE2 } } -#[doc = "Write proxy for field `PPS7`"] +impl core::ops::Deref for PPS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] pub struct PPS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS8`"] -pub type PPS8_R = crate::R; +#[doc = "Field `PPS8` reader - Port n Pin Power Save Bit 8"] +pub struct PPS8_R(crate::FieldReader); impl PPS8_R { + pub(crate) fn new(bits: bool) -> Self { + PPS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS8_A { @@ -638,15 +729,22 @@ impl PPS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS8_A::VALUE1 + **self == PPS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS8_A::VALUE2 + **self == PPS8_A::VALUE2 } } -#[doc = "Write proxy for field `PPS8`"] +impl core::ops::Deref for PPS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] pub struct PPS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS9`"] -pub type PPS9_R = crate::R; +#[doc = "Field `PPS9` reader - Port n Pin Power Save Bit 9"] +pub struct PPS9_R(crate::FieldReader); impl PPS9_R { + pub(crate) fn new(bits: bool) -> Self { + PPS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS9_A { @@ -713,15 +812,22 @@ impl PPS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS9_A::VALUE1 + **self == PPS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS9_A::VALUE2 + **self == PPS9_A::VALUE2 + } +} +impl core::ops::Deref for PPS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS9`"] +#[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] pub struct PPS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS10`"] -pub type PPS10_R = crate::R; +#[doc = "Field `PPS10` reader - Port n Pin Power Save Bit 10"] +pub struct PPS10_R(crate::FieldReader); impl PPS10_R { + pub(crate) fn new(bits: bool) -> Self { + PPS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS10_A { @@ -788,15 +895,22 @@ impl PPS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS10_A::VALUE1 + **self == PPS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS10_A::VALUE2 + **self == PPS10_A::VALUE2 } } -#[doc = "Write proxy for field `PPS10`"] +impl core::ops::Deref for PPS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] pub struct PPS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS11`"] -pub type PPS11_R = crate::R; +#[doc = "Field `PPS11` reader - Port n Pin Power Save Bit 11"] +pub struct PPS11_R(crate::FieldReader); impl PPS11_R { + pub(crate) fn new(bits: bool) -> Self { + PPS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS11_A { @@ -863,15 +978,22 @@ impl PPS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS11_A::VALUE1 + **self == PPS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS11_A::VALUE2 + **self == PPS11_A::VALUE2 } } -#[doc = "Write proxy for field `PPS11`"] +impl core::ops::Deref for PPS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] pub struct PPS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS12`"] -pub type PPS12_R = crate::R; +#[doc = "Field `PPS12` reader - Port n Pin Power Save Bit 12"] +pub struct PPS12_R(crate::FieldReader); impl PPS12_R { + pub(crate) fn new(bits: bool) -> Self { + PPS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS12_A { @@ -938,15 +1061,22 @@ impl PPS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS12_A::VALUE1 + **self == PPS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS12_A::VALUE2 + **self == PPS12_A::VALUE2 + } +} +impl core::ops::Deref for PPS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS12`"] +#[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] pub struct PPS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS13`"] -pub type PPS13_R = crate::R; +#[doc = "Field `PPS13` reader - Port n Pin Power Save Bit 13"] +pub struct PPS13_R(crate::FieldReader); impl PPS13_R { + pub(crate) fn new(bits: bool) -> Self { + PPS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS13_A { @@ -1013,15 +1144,22 @@ impl PPS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS13_A::VALUE1 + **self == PPS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS13_A::VALUE2 + **self == PPS13_A::VALUE2 } } -#[doc = "Write proxy for field `PPS13`"] +impl core::ops::Deref for PPS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] pub struct PPS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS14`"] -pub type PPS14_R = crate::R; +#[doc = "Field `PPS14` reader - Port n Pin Power Save Bit 14"] +pub struct PPS14_R(crate::FieldReader); impl PPS14_R { + pub(crate) fn new(bits: bool) -> Self { + PPS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS14_A { @@ -1088,15 +1227,22 @@ impl PPS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS14_A::VALUE1 + **self == PPS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS14_A::VALUE2 + **self == PPS14_A::VALUE2 } } -#[doc = "Write proxy for field `PPS14`"] +impl core::ops::Deref for PPS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] pub struct PPS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS15`"] -pub type PPS15_R = crate::R; +#[doc = "Field `PPS15` reader - Port n Pin Power Save Bit 15"] +pub struct PPS15_R(crate::FieldReader); impl PPS15_R { + pub(crate) fn new(bits: bool) -> Self { + PPS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS15_A { @@ -1163,15 +1310,22 @@ impl PPS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS15_A::VALUE1 + **self == PPS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS15_A::VALUE2 + **self == PPS15_A::VALUE2 } } -#[doc = "Write proxy for field `PPS15`"] +impl core::ops::Deref for PPS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] pub struct PPS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pps15(&mut self) -> PPS15_W { PPS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 1 Pin Power Save Register\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 [pps](index.html) module"] +pub struct PPS_SPEC; +impl crate::RegisterSpec for PPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pps::R](R) reader structure"] +impl crate::Readable for PPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pps::W](W) writer structure"] +impl crate::Writable for PPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PPS to value 0"] +impl crate::Resettable for PPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14.rs b/src/port14.rs index 1eb9803d..733585c3 100644 --- a/src/port14.rs +++ b/src/port14.rs @@ -2,133 +2,67 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Port 14 Output Register"] - pub out: OUT, + pub out: crate::Reg, #[doc = "0x04 - Port 14 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 8usize], + pub omr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x10 - Port 14 Input/Output Control Register 0"] - pub iocr0: IOCR0, + pub iocr0: crate::Reg, #[doc = "0x14 - Port 14 Input/Output Control Register 4"] - pub iocr4: IOCR4, + pub iocr4: crate::Reg, #[doc = "0x18 - Port 14 Input/Output Control Register 8"] - pub iocr8: IOCR8, + pub iocr8: crate::Reg, #[doc = "0x1c - Port 14 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 4usize], + pub iocr12: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0x24 - Port 14 Input Register"] - pub in_: IN, - _reserved7: [u8; 56usize], + pub in_: crate::Reg, + _reserved7: [u8; 0x38], #[doc = "0x60 - Port 14 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved8: [u8; 12usize], + pub pdisc: crate::Reg, + _reserved8: [u8; 0x0c], #[doc = "0x70 - Port 14 Pin Power Save Register"] - pub pps: PPS, + pub pps: crate::Reg, #[doc = "0x74 - Port 14 Pin Hardware Select Register"] - pub hwsel: HWSEL, + pub hwsel: crate::Reg, } -#[doc = "Port 14 Output Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](out) module"] -pub type OUT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUT; -#[doc = "`read()` method returns [out::R](out::R) reader structure"] -impl crate::Readable for OUT {} -#[doc = "`write(|w| ..)` method takes [out::W](out::W) writer structure"] -impl crate::Writable for OUT {} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; #[doc = "Port 14 Output Register"] pub mod out; -#[doc = "Port 14 Output Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](omr) module"] -pub type OMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OMR; -#[doc = "`write(|w| ..)` method takes [omr::W](omr::W) writer structure"] -impl crate::Writable for OMR {} +#[doc = "OMR register accessor: an alias for `Reg`"] +pub type OMR = crate::Reg; #[doc = "Port 14 Output Modification Register"] pub mod omr; -#[doc = "Port 14 Input/Output Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr0](iocr0) module"] -pub type IOCR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR0; -#[doc = "`read()` method returns [iocr0::R](iocr0::R) reader structure"] -impl crate::Readable for IOCR0 {} -#[doc = "`write(|w| ..)` method takes [iocr0::W](iocr0::W) writer structure"] -impl crate::Writable for IOCR0 {} +#[doc = "IOCR0 register accessor: an alias for `Reg`"] +pub type IOCR0 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "Port 14 Input/Output Control Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr4](iocr4) module"] -pub type IOCR4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR4; -#[doc = "`read()` method returns [iocr4::R](iocr4::R) reader structure"] -impl crate::Readable for IOCR4 {} -#[doc = "`write(|w| ..)` method takes [iocr4::W](iocr4::W) writer structure"] -impl crate::Writable for IOCR4 {} +#[doc = "IOCR4 register accessor: an alias for `Reg`"] +pub type IOCR4 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "Port 14 Input/Output Control Register 8\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr8](iocr8) module"] -pub type IOCR8 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR8; -#[doc = "`read()` method returns [iocr8::R](iocr8::R) reader structure"] -impl crate::Readable for IOCR8 {} -#[doc = "`write(|w| ..)` method takes [iocr8::W](iocr8::W) writer structure"] -impl crate::Writable for IOCR8 {} +#[doc = "IOCR8 register accessor: an alias for `Reg`"] +pub type IOCR8 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "Port 14 Input/Output Control Register 12\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr12](iocr12) module"] -pub type IOCR12 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR12; -#[doc = "`read()` method returns [iocr12::R](iocr12::R) reader structure"] -impl crate::Readable for IOCR12 {} -#[doc = "`write(|w| ..)` method takes [iocr12::W](iocr12::W) writer structure"] -impl crate::Writable for IOCR12 {} +#[doc = "IOCR12 register accessor: an alias for `Reg`"] +pub type IOCR12 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "Port 14 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`read()` method returns [in_::R](in_::R) reader structure"] -impl crate::Readable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Port 14 Input Register"] pub mod in_; -#[doc = "Port 14 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](pdisc) module"] -pub type PDISC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDISC; -#[doc = "`read()` method returns [pdisc::R](pdisc::R) reader structure"] -impl crate::Readable for PDISC {} -#[doc = "`write(|w| ..)` method takes [pdisc::W](pdisc::W) writer structure"] -impl crate::Writable for PDISC {} +#[doc = "PDISC register accessor: an alias for `Reg`"] +pub type PDISC = crate::Reg; #[doc = "Port 14 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "Port 14 Pin Power Save Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pps](pps) module"] -pub type PPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PPS; -#[doc = "`read()` method returns [pps::R](pps::R) reader structure"] -impl crate::Readable for PPS {} -#[doc = "`write(|w| ..)` method takes [pps::W](pps::W) writer structure"] -impl crate::Writable for PPS {} +#[doc = "PPS register accessor: an alias for `Reg`"] +pub type PPS = crate::Reg; #[doc = "Port 14 Pin Power Save Register"] pub mod pps; -#[doc = "Port 14 Pin Hardware Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hwsel](hwsel) module"] -pub type HWSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HWSEL; -#[doc = "`read()` method returns [hwsel::R](hwsel::R) reader structure"] -impl crate::Readable for HWSEL {} -#[doc = "`write(|w| ..)` method takes [hwsel::W](hwsel::W) writer structure"] -impl crate::Writable for HWSEL {} +#[doc = "HWSEL register accessor: an alias for `Reg`"] +pub type HWSEL = crate::Reg; #[doc = "Port 14 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port14/hwsel.rs b/src/port14/hwsel.rs index 0190c06c..1cdcc1d1 100644 --- a/src/port14/hwsel.rs +++ b/src/port14/hwsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HWSEL"] -pub type R = crate::R; -#[doc = "Writer for register HWSEL"] -pub type W = crate::W; -#[doc = "Register HWSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::HWSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HWSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HWSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW0`"] -pub type HW0_R = crate::R; +#[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] +pub struct HW0_R(crate::FieldReader); impl HW0_R { + pub(crate) fn new(bits: u8) -> Self { + HW0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW0_A::VALUE1), - 1 => Val(HW0_A::VALUE2), - 2 => Val(HW0_A::VALUE3), - i => Res(i), + 0 => Some(HW0_A::VALUE1), + 1 => Some(HW0_A::VALUE2), + 2 => Some(HW0_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW0_A::VALUE1 + **self == HW0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW0_A::VALUE2 + **self == HW0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW0_A::VALUE3 + **self == HW0_A::VALUE3 } } -#[doc = "Write proxy for field `HW0`"] +impl core::ops::Deref for HW0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] pub struct HW0_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> HW0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW1`"] -pub type HW1_R = crate::R; +#[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] +pub struct HW1_R(crate::FieldReader); impl HW1_R { + pub(crate) fn new(bits: u8) -> Self { + HW1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW1_A::VALUE1), - 1 => Val(HW1_A::VALUE2), - 2 => Val(HW1_A::VALUE3), - i => Res(i), + 0 => Some(HW1_A::VALUE1), + 1 => Some(HW1_A::VALUE2), + 2 => Some(HW1_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW1_A::VALUE1 + **self == HW1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW1_A::VALUE2 + **self == HW1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW1_A::VALUE3 + **self == HW1_A::VALUE3 + } +} +impl core::ops::Deref for HW1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW1`"] +#[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] pub struct HW1_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> HW1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW2`"] -pub type HW2_R = crate::R; +#[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] +pub struct HW2_R(crate::FieldReader); impl HW2_R { + pub(crate) fn new(bits: u8) -> Self { + HW2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW2_A::VALUE1), - 1 => Val(HW2_A::VALUE2), - 2 => Val(HW2_A::VALUE3), - i => Res(i), + 0 => Some(HW2_A::VALUE1), + 1 => Some(HW2_A::VALUE2), + 2 => Some(HW2_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW2_A::VALUE1 + **self == HW2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW2_A::VALUE2 + **self == HW2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW2_A::VALUE3 + **self == HW2_A::VALUE3 + } +} +impl core::ops::Deref for HW2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW2`"] +#[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] pub struct HW2_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> HW2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW3`"] -pub type HW3_R = crate::R; +#[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] +pub struct HW3_R(crate::FieldReader); impl HW3_R { + pub(crate) fn new(bits: u8) -> Self { + HW3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW3_A::VALUE1), - 1 => Val(HW3_A::VALUE2), - 2 => Val(HW3_A::VALUE3), - i => Res(i), + 0 => Some(HW3_A::VALUE1), + 1 => Some(HW3_A::VALUE2), + 2 => Some(HW3_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW3_A::VALUE1 + **self == HW3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW3_A::VALUE2 + **self == HW3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW3_A::VALUE3 + **self == HW3_A::VALUE3 } } -#[doc = "Write proxy for field `HW3`"] +impl core::ops::Deref for HW3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] pub struct HW3_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> HW3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -343,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW4`"] -pub type HW4_R = crate::R; +#[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] +pub struct HW4_R(crate::FieldReader); impl HW4_R { + pub(crate) fn new(bits: u8) -> Self { + HW4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW4_A::VALUE1), - 1 => Val(HW4_A::VALUE2), - 2 => Val(HW4_A::VALUE3), - i => Res(i), + 0 => Some(HW4_A::VALUE1), + 1 => Some(HW4_A::VALUE2), + 2 => Some(HW4_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW4_A::VALUE1 + **self == HW4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW4_A::VALUE2 + **self == HW4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW4_A::VALUE3 + **self == HW4_A::VALUE3 + } +} +impl core::ops::Deref for HW4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW4`"] +#[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] pub struct HW4_W<'a> { w: &'a mut W, } @@ -401,7 +470,7 @@ impl<'a> HW4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -422,37 +491,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW5`"] -pub type HW5_R = crate::R; +#[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] +pub struct HW5_R(crate::FieldReader); impl HW5_R { + pub(crate) fn new(bits: u8) -> Self { + HW5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW5_A::VALUE1), - 1 => Val(HW5_A::VALUE2), - 2 => Val(HW5_A::VALUE3), - i => Res(i), + 0 => Some(HW5_A::VALUE1), + 1 => Some(HW5_A::VALUE2), + 2 => Some(HW5_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW5_A::VALUE1 + **self == HW5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW5_A::VALUE2 + **self == HW5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW5_A::VALUE3 + **self == HW5_A::VALUE3 + } +} +impl core::ops::Deref for HW5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW5`"] +#[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] pub struct HW5_W<'a> { w: &'a mut W, } @@ -480,7 +558,7 @@ impl<'a> HW5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -501,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW6`"] -pub type HW6_R = crate::R; +#[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] +pub struct HW6_R(crate::FieldReader); impl HW6_R { + pub(crate) fn new(bits: u8) -> Self { + HW6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW6_A::VALUE1), - 1 => Val(HW6_A::VALUE2), - 2 => Val(HW6_A::VALUE3), - i => Res(i), + 0 => Some(HW6_A::VALUE1), + 1 => Some(HW6_A::VALUE2), + 2 => Some(HW6_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW6_A::VALUE1 + **self == HW6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW6_A::VALUE2 + **self == HW6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW6_A::VALUE3 + **self == HW6_A::VALUE3 } } -#[doc = "Write proxy for field `HW6`"] +impl core::ops::Deref for HW6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] pub struct HW6_W<'a> { w: &'a mut W, } @@ -559,7 +646,7 @@ impl<'a> HW6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -580,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW7`"] -pub type HW7_R = crate::R; +#[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] +pub struct HW7_R(crate::FieldReader); impl HW7_R { + pub(crate) fn new(bits: u8) -> Self { + HW7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW7_A::VALUE1), - 1 => Val(HW7_A::VALUE2), - 2 => Val(HW7_A::VALUE3), - i => Res(i), + 0 => Some(HW7_A::VALUE1), + 1 => Some(HW7_A::VALUE2), + 2 => Some(HW7_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW7_A::VALUE1 + **self == HW7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW7_A::VALUE2 + **self == HW7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW7_A::VALUE3 + **self == HW7_A::VALUE3 } } -#[doc = "Write proxy for field `HW7`"] +impl core::ops::Deref for HW7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] pub struct HW7_W<'a> { w: &'a mut W, } @@ -638,7 +734,7 @@ impl<'a> HW7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -659,37 +755,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW8`"] -pub type HW8_R = crate::R; +#[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] +pub struct HW8_R(crate::FieldReader); impl HW8_R { + pub(crate) fn new(bits: u8) -> Self { + HW8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW8_A::VALUE1), - 1 => Val(HW8_A::VALUE2), - 2 => Val(HW8_A::VALUE3), - i => Res(i), + 0 => Some(HW8_A::VALUE1), + 1 => Some(HW8_A::VALUE2), + 2 => Some(HW8_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW8_A::VALUE1 + **self == HW8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW8_A::VALUE2 + **self == HW8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW8_A::VALUE3 + **self == HW8_A::VALUE3 + } +} +impl core::ops::Deref for HW8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW8`"] +#[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] pub struct HW8_W<'a> { w: &'a mut W, } @@ -717,7 +822,7 @@ impl<'a> HW8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -738,37 +843,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW9`"] -pub type HW9_R = crate::R; +#[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] +pub struct HW9_R(crate::FieldReader); impl HW9_R { + pub(crate) fn new(bits: u8) -> Self { + HW9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW9_A::VALUE1), - 1 => Val(HW9_A::VALUE2), - 2 => Val(HW9_A::VALUE3), - i => Res(i), + 0 => Some(HW9_A::VALUE1), + 1 => Some(HW9_A::VALUE2), + 2 => Some(HW9_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW9_A::VALUE1 + **self == HW9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW9_A::VALUE2 + **self == HW9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW9_A::VALUE3 + **self == HW9_A::VALUE3 } } -#[doc = "Write proxy for field `HW9`"] +impl core::ops::Deref for HW9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] pub struct HW9_W<'a> { w: &'a mut W, } @@ -796,7 +910,7 @@ impl<'a> HW9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -817,37 +931,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW10`"] -pub type HW10_R = crate::R; +#[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] +pub struct HW10_R(crate::FieldReader); impl HW10_R { + pub(crate) fn new(bits: u8) -> Self { + HW10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW10_A::VALUE1), - 1 => Val(HW10_A::VALUE2), - 2 => Val(HW10_A::VALUE3), - i => Res(i), + 0 => Some(HW10_A::VALUE1), + 1 => Some(HW10_A::VALUE2), + 2 => Some(HW10_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW10_A::VALUE1 + **self == HW10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW10_A::VALUE2 + **self == HW10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW10_A::VALUE3 + **self == HW10_A::VALUE3 } } -#[doc = "Write proxy for field `HW10`"] +impl core::ops::Deref for HW10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] pub struct HW10_W<'a> { w: &'a mut W, } @@ -875,7 +998,7 @@ impl<'a> HW10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -896,37 +1019,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW11`"] -pub type HW11_R = crate::R; +#[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] +pub struct HW11_R(crate::FieldReader); impl HW11_R { + pub(crate) fn new(bits: u8) -> Self { + HW11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW11_A::VALUE1), - 1 => Val(HW11_A::VALUE2), - 2 => Val(HW11_A::VALUE3), - i => Res(i), + 0 => Some(HW11_A::VALUE1), + 1 => Some(HW11_A::VALUE2), + 2 => Some(HW11_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW11_A::VALUE1 + **self == HW11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW11_A::VALUE2 + **self == HW11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW11_A::VALUE3 + **self == HW11_A::VALUE3 } } -#[doc = "Write proxy for field `HW11`"] +impl core::ops::Deref for HW11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] pub struct HW11_W<'a> { w: &'a mut W, } @@ -954,7 +1086,7 @@ impl<'a> HW11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -975,37 +1107,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW12`"] -pub type HW12_R = crate::R; +#[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] +pub struct HW12_R(crate::FieldReader); impl HW12_R { + pub(crate) fn new(bits: u8) -> Self { + HW12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW12_A::VALUE1), - 1 => Val(HW12_A::VALUE2), - 2 => Val(HW12_A::VALUE3), - i => Res(i), + 0 => Some(HW12_A::VALUE1), + 1 => Some(HW12_A::VALUE2), + 2 => Some(HW12_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW12_A::VALUE1 + **self == HW12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW12_A::VALUE2 + **self == HW12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW12_A::VALUE3 + **self == HW12_A::VALUE3 + } +} +impl core::ops::Deref for HW12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW12`"] +#[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] pub struct HW12_W<'a> { w: &'a mut W, } @@ -1033,7 +1174,7 @@ impl<'a> HW12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1054,37 +1195,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW13`"] -pub type HW13_R = crate::R; +#[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] +pub struct HW13_R(crate::FieldReader); impl HW13_R { + pub(crate) fn new(bits: u8) -> Self { + HW13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW13_A::VALUE1), - 1 => Val(HW13_A::VALUE2), - 2 => Val(HW13_A::VALUE3), - i => Res(i), + 0 => Some(HW13_A::VALUE1), + 1 => Some(HW13_A::VALUE2), + 2 => Some(HW13_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW13_A::VALUE1 + **self == HW13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW13_A::VALUE2 + **self == HW13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW13_A::VALUE3 + **self == HW13_A::VALUE3 + } +} +impl core::ops::Deref for HW13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW13`"] +#[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] pub struct HW13_W<'a> { w: &'a mut W, } @@ -1112,7 +1262,7 @@ impl<'a> HW13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -1133,37 +1283,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW14`"] -pub type HW14_R = crate::R; +#[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] +pub struct HW14_R(crate::FieldReader); impl HW14_R { + pub(crate) fn new(bits: u8) -> Self { + HW14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW14_A::VALUE1), - 1 => Val(HW14_A::VALUE2), - 2 => Val(HW14_A::VALUE3), - i => Res(i), + 0 => Some(HW14_A::VALUE1), + 1 => Some(HW14_A::VALUE2), + 2 => Some(HW14_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW14_A::VALUE1 + **self == HW14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW14_A::VALUE2 + **self == HW14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW14_A::VALUE3 + **self == HW14_A::VALUE3 } } -#[doc = "Write proxy for field `HW14`"] +impl core::ops::Deref for HW14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] pub struct HW14_W<'a> { w: &'a mut W, } @@ -1191,7 +1350,7 @@ impl<'a> HW14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1212,37 +1371,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW15`"] -pub type HW15_R = crate::R; +#[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] +pub struct HW15_R(crate::FieldReader); impl HW15_R { + pub(crate) fn new(bits: u8) -> Self { + HW15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW15_A::VALUE1), - 1 => Val(HW15_A::VALUE2), - 2 => Val(HW15_A::VALUE3), - i => Res(i), + 0 => Some(HW15_A::VALUE1), + 1 => Some(HW15_A::VALUE2), + 2 => Some(HW15_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW15_A::VALUE1 + **self == HW15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW15_A::VALUE2 + **self == HW15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW15_A::VALUE3 + **self == HW15_A::VALUE3 } } -#[doc = "Write proxy for field `HW15`"] +impl core::ops::Deref for HW15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] pub struct HW15_W<'a> { w: &'a mut W, } @@ -1270,7 +1438,7 @@ impl<'a> HW15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -1437,4 +1605,30 @@ impl W { pub fn hw15(&mut self) -> HW15_W { HW15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Pin Hardware Select Register\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 [hwsel](index.html) module"] +pub struct HWSEL_SPEC; +impl crate::RegisterSpec for HWSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hwsel::R](R) reader structure"] +impl crate::Readable for HWSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hwsel::W](W) writer structure"] +impl crate::Writable for HWSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HWSEL to value 0"] +impl crate::Resettable for HWSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/in_.rs b/src/port14/in_.rs index 344607dc..4abffa41 100644 --- a/src/port14/in_.rs +++ b/src/port14/in_.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register IN"] -pub type R = crate::R; +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum P0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Input Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -28,12 +44,19 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 + } +} +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Input Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -64,12 +90,19 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 + } +} +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Input Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -100,12 +136,19 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Input Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -136,12 +182,19 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Input Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -172,12 +228,19 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Input Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -208,12 +274,19 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Input Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -244,12 +320,19 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 + } +} +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Input Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -280,12 +366,19 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 + } +} +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Input Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -316,12 +412,19 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 + } +} +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Input Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -352,12 +458,19 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Input Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -388,12 +504,19 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 + } +} +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Input Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -424,12 +550,19 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 + } +} +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Input Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -460,12 +596,19 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Input Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -496,12 +642,19 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 + } +} +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Input Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -532,12 +688,19 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 + } +} +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Input Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -568,12 +734,19 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 + } +} +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { P15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 14 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port14/iocr0.rs b/src/port14/iocr0.rs index ea51a257..2bb4060c 100644 --- a/src/port14/iocr0.rs +++ b/src/port14/iocr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR0"] -pub type R = crate::R; -#[doc = "Writer for register IOCR0"] -pub type W = crate::W; -#[doc = "Register IOCR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC0`"] -pub type PC0_R = crate::R; +#[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC0_R(crate::FieldReader); impl PC0_R { + pub(crate) fn new(bits: u8) -> Self { + PC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC0_A::VALUE1), - 1 => Val(PC0_A::VALUE2), - 2 => Val(PC0_A::VALUE3), - 3 => Val(PC0_A::VALUE4), - 4 => Val(PC0_A::VALUE5), - 5 => Val(PC0_A::VALUE6), - 6 => Val(PC0_A::VALUE7), - 7 => Val(PC0_A::VALUE8), - 16 => Val(PC0_A::VALUE9), - 17 => Val(PC0_A::VALUE10), - 18 => Val(PC0_A::VALUE11), - 19 => Val(PC0_A::VALUE12), - 20 => Val(PC0_A::VALUE13), - 24 => Val(PC0_A::VALUE14), - 25 => Val(PC0_A::VALUE15), - 26 => Val(PC0_A::VALUE16), - 27 => Val(PC0_A::VALUE17), - 28 => Val(PC0_A::VALUE18), - i => Res(i), + 0 => Some(PC0_A::VALUE1), + 1 => Some(PC0_A::VALUE2), + 2 => Some(PC0_A::VALUE3), + 3 => Some(PC0_A::VALUE4), + 4 => Some(PC0_A::VALUE5), + 5 => Some(PC0_A::VALUE6), + 6 => Some(PC0_A::VALUE7), + 7 => Some(PC0_A::VALUE8), + 16 => Some(PC0_A::VALUE9), + 17 => Some(PC0_A::VALUE10), + 18 => Some(PC0_A::VALUE11), + 19 => Some(PC0_A::VALUE12), + 20 => Some(PC0_A::VALUE13), + 24 => Some(PC0_A::VALUE14), + 25 => Some(PC0_A::VALUE15), + 26 => Some(PC0_A::VALUE16), + 27 => Some(PC0_A::VALUE17), + 28 => Some(PC0_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC0_A::VALUE1 + **self == PC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC0_A::VALUE2 + **self == PC0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC0_A::VALUE3 + **self == PC0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC0_A::VALUE4 + **self == PC0_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC0_A::VALUE5 + **self == PC0_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC0_A::VALUE6 + **self == PC0_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC0_A::VALUE7 + **self == PC0_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC0_A::VALUE8 + **self == PC0_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC0_A::VALUE9 + **self == PC0_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC0_A::VALUE10 + **self == PC0_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC0_A::VALUE11 + **self == PC0_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC0_A::VALUE12 + **self == PC0_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC0_A::VALUE13 + **self == PC0_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC0_A::VALUE14 + **self == PC0_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC0_A::VALUE15 + **self == PC0_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC0_A::VALUE16 + **self == PC0_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC0_A::VALUE17 + **self == PC0_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC0_A::VALUE18 + **self == PC0_A::VALUE18 } } -#[doc = "Write proxy for field `PC0`"] +impl core::ops::Deref for PC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] pub struct PC0_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC1`"] -pub type PC1_R = crate::R; +#[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC1_R(crate::FieldReader); impl PC1_R { + pub(crate) fn new(bits: u8) -> Self { + PC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC1_A::VALUE1), - 1 => Val(PC1_A::VALUE2), - 2 => Val(PC1_A::VALUE3), - 3 => Val(PC1_A::VALUE4), - 4 => Val(PC1_A::VALUE5), - 5 => Val(PC1_A::VALUE6), - 6 => Val(PC1_A::VALUE7), - 7 => Val(PC1_A::VALUE8), - 16 => Val(PC1_A::VALUE9), - 17 => Val(PC1_A::VALUE10), - 18 => Val(PC1_A::VALUE11), - 19 => Val(PC1_A::VALUE12), - 20 => Val(PC1_A::VALUE13), - 24 => Val(PC1_A::VALUE14), - 25 => Val(PC1_A::VALUE15), - 26 => Val(PC1_A::VALUE16), - 27 => Val(PC1_A::VALUE17), - 28 => Val(PC1_A::VALUE18), - i => Res(i), + 0 => Some(PC1_A::VALUE1), + 1 => Some(PC1_A::VALUE2), + 2 => Some(PC1_A::VALUE3), + 3 => Some(PC1_A::VALUE4), + 4 => Some(PC1_A::VALUE5), + 5 => Some(PC1_A::VALUE6), + 6 => Some(PC1_A::VALUE7), + 7 => Some(PC1_A::VALUE8), + 16 => Some(PC1_A::VALUE9), + 17 => Some(PC1_A::VALUE10), + 18 => Some(PC1_A::VALUE11), + 19 => Some(PC1_A::VALUE12), + 20 => Some(PC1_A::VALUE13), + 24 => Some(PC1_A::VALUE14), + 25 => Some(PC1_A::VALUE15), + 26 => Some(PC1_A::VALUE16), + 27 => Some(PC1_A::VALUE17), + 28 => Some(PC1_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC1_A::VALUE1 + **self == PC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC1_A::VALUE2 + **self == PC1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC1_A::VALUE3 + **self == PC1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC1_A::VALUE4 + **self == PC1_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC1_A::VALUE5 + **self == PC1_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC1_A::VALUE6 + **self == PC1_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC1_A::VALUE7 + **self == PC1_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC1_A::VALUE8 + **self == PC1_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC1_A::VALUE9 + **self == PC1_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC1_A::VALUE10 + **self == PC1_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC1_A::VALUE11 + **self == PC1_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC1_A::VALUE12 + **self == PC1_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC1_A::VALUE13 + **self == PC1_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC1_A::VALUE14 + **self == PC1_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC1_A::VALUE15 + **self == PC1_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC1_A::VALUE16 + **self == PC1_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC1_A::VALUE17 + **self == PC1_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC1_A::VALUE18 + **self == PC1_A::VALUE18 } } -#[doc = "Write proxy for field `PC1`"] +impl core::ops::Deref for PC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] pub struct PC1_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC2`"] -pub type PC2_R = crate::R; +#[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC2_R(crate::FieldReader); impl PC2_R { + pub(crate) fn new(bits: u8) -> Self { + PC2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC2_A::VALUE1), - 1 => Val(PC2_A::VALUE2), - 2 => Val(PC2_A::VALUE3), - 3 => Val(PC2_A::VALUE4), - 4 => Val(PC2_A::VALUE5), - 5 => Val(PC2_A::VALUE6), - 6 => Val(PC2_A::VALUE7), - 7 => Val(PC2_A::VALUE8), - 16 => Val(PC2_A::VALUE9), - 17 => Val(PC2_A::VALUE10), - 18 => Val(PC2_A::VALUE11), - 19 => Val(PC2_A::VALUE12), - 20 => Val(PC2_A::VALUE13), - 24 => Val(PC2_A::VALUE14), - 25 => Val(PC2_A::VALUE15), - 26 => Val(PC2_A::VALUE16), - 27 => Val(PC2_A::VALUE17), - 28 => Val(PC2_A::VALUE18), - i => Res(i), + 0 => Some(PC2_A::VALUE1), + 1 => Some(PC2_A::VALUE2), + 2 => Some(PC2_A::VALUE3), + 3 => Some(PC2_A::VALUE4), + 4 => Some(PC2_A::VALUE5), + 5 => Some(PC2_A::VALUE6), + 6 => Some(PC2_A::VALUE7), + 7 => Some(PC2_A::VALUE8), + 16 => Some(PC2_A::VALUE9), + 17 => Some(PC2_A::VALUE10), + 18 => Some(PC2_A::VALUE11), + 19 => Some(PC2_A::VALUE12), + 20 => Some(PC2_A::VALUE13), + 24 => Some(PC2_A::VALUE14), + 25 => Some(PC2_A::VALUE15), + 26 => Some(PC2_A::VALUE16), + 27 => Some(PC2_A::VALUE17), + 28 => Some(PC2_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC2_A::VALUE1 + **self == PC2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC2_A::VALUE2 + **self == PC2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC2_A::VALUE3 + **self == PC2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC2_A::VALUE4 + **self == PC2_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC2_A::VALUE5 + **self == PC2_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC2_A::VALUE6 + **self == PC2_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC2_A::VALUE7 + **self == PC2_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC2_A::VALUE8 + **self == PC2_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC2_A::VALUE9 + **self == PC2_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC2_A::VALUE10 + **self == PC2_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC2_A::VALUE11 + **self == PC2_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC2_A::VALUE12 + **self == PC2_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC2_A::VALUE13 + **self == PC2_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC2_A::VALUE14 + **self == PC2_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC2_A::VALUE15 + **self == PC2_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC2_A::VALUE16 + **self == PC2_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC2_A::VALUE17 + **self == PC2_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC2_A::VALUE18 + **self == PC2_A::VALUE18 + } +} +impl core::ops::Deref for PC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC2`"] +#[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] pub struct PC2_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC3`"] -pub type PC3_R = crate::R; +#[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC3_R(crate::FieldReader); impl PC3_R { + pub(crate) fn new(bits: u8) -> Self { + PC3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC3_A::VALUE1), - 1 => Val(PC3_A::VALUE2), - 2 => Val(PC3_A::VALUE3), - 3 => Val(PC3_A::VALUE4), - 4 => Val(PC3_A::VALUE5), - 5 => Val(PC3_A::VALUE6), - 6 => Val(PC3_A::VALUE7), - 7 => Val(PC3_A::VALUE8), - 16 => Val(PC3_A::VALUE9), - 17 => Val(PC3_A::VALUE10), - 18 => Val(PC3_A::VALUE11), - 19 => Val(PC3_A::VALUE12), - 20 => Val(PC3_A::VALUE13), - 24 => Val(PC3_A::VALUE14), - 25 => Val(PC3_A::VALUE15), - 26 => Val(PC3_A::VALUE16), - 27 => Val(PC3_A::VALUE17), - 28 => Val(PC3_A::VALUE18), - i => Res(i), + 0 => Some(PC3_A::VALUE1), + 1 => Some(PC3_A::VALUE2), + 2 => Some(PC3_A::VALUE3), + 3 => Some(PC3_A::VALUE4), + 4 => Some(PC3_A::VALUE5), + 5 => Some(PC3_A::VALUE6), + 6 => Some(PC3_A::VALUE7), + 7 => Some(PC3_A::VALUE8), + 16 => Some(PC3_A::VALUE9), + 17 => Some(PC3_A::VALUE10), + 18 => Some(PC3_A::VALUE11), + 19 => Some(PC3_A::VALUE12), + 20 => Some(PC3_A::VALUE13), + 24 => Some(PC3_A::VALUE14), + 25 => Some(PC3_A::VALUE15), + 26 => Some(PC3_A::VALUE16), + 27 => Some(PC3_A::VALUE17), + 28 => Some(PC3_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC3_A::VALUE1 + **self == PC3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC3_A::VALUE2 + **self == PC3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC3_A::VALUE3 + **self == PC3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC3_A::VALUE4 + **self == PC3_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC3_A::VALUE5 + **self == PC3_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC3_A::VALUE6 + **self == PC3_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC3_A::VALUE7 + **self == PC3_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC3_A::VALUE8 + **self == PC3_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC3_A::VALUE9 + **self == PC3_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC3_A::VALUE10 + **self == PC3_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC3_A::VALUE11 + **self == PC3_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC3_A::VALUE12 + **self == PC3_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC3_A::VALUE13 + **self == PC3_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC3_A::VALUE14 + **self == PC3_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC3_A::VALUE15 + **self == PC3_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC3_A::VALUE16 + **self == PC3_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC3_A::VALUE17 + **self == PC3_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC3_A::VALUE18 + **self == PC3_A::VALUE18 + } +} +impl core::ops::Deref for PC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC3`"] +#[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] pub struct PC3_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc3(&mut self) -> PC3_W { PC3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Input/Output Control Register 0\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 [iocr0](index.html) module"] +pub struct IOCR0_SPEC; +impl crate::RegisterSpec for IOCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr0::R](R) reader structure"] +impl crate::Readable for IOCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr0::W](W) writer structure"] +impl crate::Writable for IOCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR0 to value 0"] +impl crate::Resettable for IOCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/iocr12.rs b/src/port14/iocr12.rs index b1edc33d..f70c312b 100644 --- a/src/port14/iocr12.rs +++ b/src/port14/iocr12.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR12"] -pub type R = crate::R; -#[doc = "Writer for register IOCR12"] -pub type W = crate::W; -#[doc = "Register IOCR12 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR12 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR12` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR12` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC12`"] -pub type PC12_R = crate::R; +#[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC12_R(crate::FieldReader); impl PC12_R { + pub(crate) fn new(bits: u8) -> Self { + PC12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC12_A::VALUE1), - 1 => Val(PC12_A::VALUE2), - 2 => Val(PC12_A::VALUE3), - 3 => Val(PC12_A::VALUE4), - 4 => Val(PC12_A::VALUE5), - 5 => Val(PC12_A::VALUE6), - 6 => Val(PC12_A::VALUE7), - 7 => Val(PC12_A::VALUE8), - 16 => Val(PC12_A::VALUE9), - 17 => Val(PC12_A::VALUE10), - 18 => Val(PC12_A::VALUE11), - 19 => Val(PC12_A::VALUE12), - 20 => Val(PC12_A::VALUE13), - 24 => Val(PC12_A::VALUE14), - 25 => Val(PC12_A::VALUE15), - 26 => Val(PC12_A::VALUE16), - 27 => Val(PC12_A::VALUE17), - 28 => Val(PC12_A::VALUE18), - i => Res(i), + 0 => Some(PC12_A::VALUE1), + 1 => Some(PC12_A::VALUE2), + 2 => Some(PC12_A::VALUE3), + 3 => Some(PC12_A::VALUE4), + 4 => Some(PC12_A::VALUE5), + 5 => Some(PC12_A::VALUE6), + 6 => Some(PC12_A::VALUE7), + 7 => Some(PC12_A::VALUE8), + 16 => Some(PC12_A::VALUE9), + 17 => Some(PC12_A::VALUE10), + 18 => Some(PC12_A::VALUE11), + 19 => Some(PC12_A::VALUE12), + 20 => Some(PC12_A::VALUE13), + 24 => Some(PC12_A::VALUE14), + 25 => Some(PC12_A::VALUE15), + 26 => Some(PC12_A::VALUE16), + 27 => Some(PC12_A::VALUE17), + 28 => Some(PC12_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC12_A::VALUE1 + **self == PC12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC12_A::VALUE2 + **self == PC12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC12_A::VALUE3 + **self == PC12_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC12_A::VALUE4 + **self == PC12_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC12_A::VALUE5 + **self == PC12_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC12_A::VALUE6 + **self == PC12_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC12_A::VALUE7 + **self == PC12_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC12_A::VALUE8 + **self == PC12_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC12_A::VALUE9 + **self == PC12_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC12_A::VALUE10 + **self == PC12_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC12_A::VALUE11 + **self == PC12_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC12_A::VALUE12 + **self == PC12_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC12_A::VALUE13 + **self == PC12_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC12_A::VALUE14 + **self == PC12_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC12_A::VALUE15 + **self == PC12_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC12_A::VALUE16 + **self == PC12_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC12_A::VALUE17 + **self == PC12_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC12_A::VALUE18 + **self == PC12_A::VALUE18 } } -#[doc = "Write proxy for field `PC12`"] +impl core::ops::Deref for PC12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] pub struct PC12_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC13`"] -pub type PC13_R = crate::R; +#[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC13_R(crate::FieldReader); impl PC13_R { + pub(crate) fn new(bits: u8) -> Self { + PC13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC13_A::VALUE1), - 1 => Val(PC13_A::VALUE2), - 2 => Val(PC13_A::VALUE3), - 3 => Val(PC13_A::VALUE4), - 4 => Val(PC13_A::VALUE5), - 5 => Val(PC13_A::VALUE6), - 6 => Val(PC13_A::VALUE7), - 7 => Val(PC13_A::VALUE8), - 16 => Val(PC13_A::VALUE9), - 17 => Val(PC13_A::VALUE10), - 18 => Val(PC13_A::VALUE11), - 19 => Val(PC13_A::VALUE12), - 20 => Val(PC13_A::VALUE13), - 24 => Val(PC13_A::VALUE14), - 25 => Val(PC13_A::VALUE15), - 26 => Val(PC13_A::VALUE16), - 27 => Val(PC13_A::VALUE17), - 28 => Val(PC13_A::VALUE18), - i => Res(i), + 0 => Some(PC13_A::VALUE1), + 1 => Some(PC13_A::VALUE2), + 2 => Some(PC13_A::VALUE3), + 3 => Some(PC13_A::VALUE4), + 4 => Some(PC13_A::VALUE5), + 5 => Some(PC13_A::VALUE6), + 6 => Some(PC13_A::VALUE7), + 7 => Some(PC13_A::VALUE8), + 16 => Some(PC13_A::VALUE9), + 17 => Some(PC13_A::VALUE10), + 18 => Some(PC13_A::VALUE11), + 19 => Some(PC13_A::VALUE12), + 20 => Some(PC13_A::VALUE13), + 24 => Some(PC13_A::VALUE14), + 25 => Some(PC13_A::VALUE15), + 26 => Some(PC13_A::VALUE16), + 27 => Some(PC13_A::VALUE17), + 28 => Some(PC13_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC13_A::VALUE1 + **self == PC13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC13_A::VALUE2 + **self == PC13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC13_A::VALUE3 + **self == PC13_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC13_A::VALUE4 + **self == PC13_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC13_A::VALUE5 + **self == PC13_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC13_A::VALUE6 + **self == PC13_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC13_A::VALUE7 + **self == PC13_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC13_A::VALUE8 + **self == PC13_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC13_A::VALUE9 + **self == PC13_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC13_A::VALUE10 + **self == PC13_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC13_A::VALUE11 + **self == PC13_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC13_A::VALUE12 + **self == PC13_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC13_A::VALUE13 + **self == PC13_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC13_A::VALUE14 + **self == PC13_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC13_A::VALUE15 + **self == PC13_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC13_A::VALUE16 + **self == PC13_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC13_A::VALUE17 + **self == PC13_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC13_A::VALUE18 + **self == PC13_A::VALUE18 } } -#[doc = "Write proxy for field `PC13`"] +impl core::ops::Deref for PC13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] pub struct PC13_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC14`"] -pub type PC14_R = crate::R; +#[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC14_R(crate::FieldReader); impl PC14_R { + pub(crate) fn new(bits: u8) -> Self { + PC14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC14_A::VALUE1), - 1 => Val(PC14_A::VALUE2), - 2 => Val(PC14_A::VALUE3), - 3 => Val(PC14_A::VALUE4), - 4 => Val(PC14_A::VALUE5), - 5 => Val(PC14_A::VALUE6), - 6 => Val(PC14_A::VALUE7), - 7 => Val(PC14_A::VALUE8), - 16 => Val(PC14_A::VALUE9), - 17 => Val(PC14_A::VALUE10), - 18 => Val(PC14_A::VALUE11), - 19 => Val(PC14_A::VALUE12), - 20 => Val(PC14_A::VALUE13), - 24 => Val(PC14_A::VALUE14), - 25 => Val(PC14_A::VALUE15), - 26 => Val(PC14_A::VALUE16), - 27 => Val(PC14_A::VALUE17), - 28 => Val(PC14_A::VALUE18), - i => Res(i), + 0 => Some(PC14_A::VALUE1), + 1 => Some(PC14_A::VALUE2), + 2 => Some(PC14_A::VALUE3), + 3 => Some(PC14_A::VALUE4), + 4 => Some(PC14_A::VALUE5), + 5 => Some(PC14_A::VALUE6), + 6 => Some(PC14_A::VALUE7), + 7 => Some(PC14_A::VALUE8), + 16 => Some(PC14_A::VALUE9), + 17 => Some(PC14_A::VALUE10), + 18 => Some(PC14_A::VALUE11), + 19 => Some(PC14_A::VALUE12), + 20 => Some(PC14_A::VALUE13), + 24 => Some(PC14_A::VALUE14), + 25 => Some(PC14_A::VALUE15), + 26 => Some(PC14_A::VALUE16), + 27 => Some(PC14_A::VALUE17), + 28 => Some(PC14_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC14_A::VALUE1 + **self == PC14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC14_A::VALUE2 + **self == PC14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC14_A::VALUE3 + **self == PC14_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC14_A::VALUE4 + **self == PC14_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC14_A::VALUE5 + **self == PC14_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC14_A::VALUE6 + **self == PC14_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC14_A::VALUE7 + **self == PC14_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC14_A::VALUE8 + **self == PC14_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC14_A::VALUE9 + **self == PC14_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC14_A::VALUE10 + **self == PC14_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC14_A::VALUE11 + **self == PC14_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC14_A::VALUE12 + **self == PC14_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC14_A::VALUE13 + **self == PC14_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC14_A::VALUE14 + **self == PC14_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC14_A::VALUE15 + **self == PC14_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC14_A::VALUE16 + **self == PC14_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC14_A::VALUE17 + **self == PC14_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC14_A::VALUE18 + **self == PC14_A::VALUE18 + } +} +impl core::ops::Deref for PC14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC14`"] +#[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] pub struct PC14_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC15`"] -pub type PC15_R = crate::R; +#[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC15_R(crate::FieldReader); impl PC15_R { + pub(crate) fn new(bits: u8) -> Self { + PC15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC15_A::VALUE1), - 1 => Val(PC15_A::VALUE2), - 2 => Val(PC15_A::VALUE3), - 3 => Val(PC15_A::VALUE4), - 4 => Val(PC15_A::VALUE5), - 5 => Val(PC15_A::VALUE6), - 6 => Val(PC15_A::VALUE7), - 7 => Val(PC15_A::VALUE8), - 16 => Val(PC15_A::VALUE9), - 17 => Val(PC15_A::VALUE10), - 18 => Val(PC15_A::VALUE11), - 19 => Val(PC15_A::VALUE12), - 20 => Val(PC15_A::VALUE13), - 24 => Val(PC15_A::VALUE14), - 25 => Val(PC15_A::VALUE15), - 26 => Val(PC15_A::VALUE16), - 27 => Val(PC15_A::VALUE17), - 28 => Val(PC15_A::VALUE18), - i => Res(i), + 0 => Some(PC15_A::VALUE1), + 1 => Some(PC15_A::VALUE2), + 2 => Some(PC15_A::VALUE3), + 3 => Some(PC15_A::VALUE4), + 4 => Some(PC15_A::VALUE5), + 5 => Some(PC15_A::VALUE6), + 6 => Some(PC15_A::VALUE7), + 7 => Some(PC15_A::VALUE8), + 16 => Some(PC15_A::VALUE9), + 17 => Some(PC15_A::VALUE10), + 18 => Some(PC15_A::VALUE11), + 19 => Some(PC15_A::VALUE12), + 20 => Some(PC15_A::VALUE13), + 24 => Some(PC15_A::VALUE14), + 25 => Some(PC15_A::VALUE15), + 26 => Some(PC15_A::VALUE16), + 27 => Some(PC15_A::VALUE17), + 28 => Some(PC15_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC15_A::VALUE1 + **self == PC15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC15_A::VALUE2 + **self == PC15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC15_A::VALUE3 + **self == PC15_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC15_A::VALUE4 + **self == PC15_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC15_A::VALUE5 + **self == PC15_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC15_A::VALUE6 + **self == PC15_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC15_A::VALUE7 + **self == PC15_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC15_A::VALUE8 + **self == PC15_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC15_A::VALUE9 + **self == PC15_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC15_A::VALUE10 + **self == PC15_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC15_A::VALUE11 + **self == PC15_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC15_A::VALUE12 + **self == PC15_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC15_A::VALUE13 + **self == PC15_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC15_A::VALUE14 + **self == PC15_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC15_A::VALUE15 + **self == PC15_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC15_A::VALUE16 + **self == PC15_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC15_A::VALUE17 + **self == PC15_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC15_A::VALUE18 + **self == PC15_A::VALUE18 + } +} +impl core::ops::Deref for PC15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC15`"] +#[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] pub struct PC15_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc15(&mut self) -> PC15_W { PC15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Input/Output Control Register 12\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 [iocr12](index.html) module"] +pub struct IOCR12_SPEC; +impl crate::RegisterSpec for IOCR12_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr12::R](R) reader structure"] +impl crate::Readable for IOCR12_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr12::W](W) writer structure"] +impl crate::Writable for IOCR12_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR12 to value 0"] +impl crate::Resettable for IOCR12_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/iocr4.rs b/src/port14/iocr4.rs index d884a743..4690c45c 100644 --- a/src/port14/iocr4.rs +++ b/src/port14/iocr4.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR4"] -pub type R = crate::R; -#[doc = "Writer for register IOCR4"] -pub type W = crate::W; -#[doc = "Register IOCR4 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR4 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC4`"] -pub type PC4_R = crate::R; +#[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC4_R(crate::FieldReader); impl PC4_R { + pub(crate) fn new(bits: u8) -> Self { + PC4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC4_A::VALUE1), - 1 => Val(PC4_A::VALUE2), - 2 => Val(PC4_A::VALUE3), - 3 => Val(PC4_A::VALUE4), - 4 => Val(PC4_A::VALUE5), - 5 => Val(PC4_A::VALUE6), - 6 => Val(PC4_A::VALUE7), - 7 => Val(PC4_A::VALUE8), - 16 => Val(PC4_A::VALUE9), - 17 => Val(PC4_A::VALUE10), - 18 => Val(PC4_A::VALUE11), - 19 => Val(PC4_A::VALUE12), - 20 => Val(PC4_A::VALUE13), - 24 => Val(PC4_A::VALUE14), - 25 => Val(PC4_A::VALUE15), - 26 => Val(PC4_A::VALUE16), - 27 => Val(PC4_A::VALUE17), - 28 => Val(PC4_A::VALUE18), - i => Res(i), + 0 => Some(PC4_A::VALUE1), + 1 => Some(PC4_A::VALUE2), + 2 => Some(PC4_A::VALUE3), + 3 => Some(PC4_A::VALUE4), + 4 => Some(PC4_A::VALUE5), + 5 => Some(PC4_A::VALUE6), + 6 => Some(PC4_A::VALUE7), + 7 => Some(PC4_A::VALUE8), + 16 => Some(PC4_A::VALUE9), + 17 => Some(PC4_A::VALUE10), + 18 => Some(PC4_A::VALUE11), + 19 => Some(PC4_A::VALUE12), + 20 => Some(PC4_A::VALUE13), + 24 => Some(PC4_A::VALUE14), + 25 => Some(PC4_A::VALUE15), + 26 => Some(PC4_A::VALUE16), + 27 => Some(PC4_A::VALUE17), + 28 => Some(PC4_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC4_A::VALUE1 + **self == PC4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC4_A::VALUE2 + **self == PC4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC4_A::VALUE3 + **self == PC4_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC4_A::VALUE4 + **self == PC4_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC4_A::VALUE5 + **self == PC4_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC4_A::VALUE6 + **self == PC4_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC4_A::VALUE7 + **self == PC4_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC4_A::VALUE8 + **self == PC4_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC4_A::VALUE9 + **self == PC4_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC4_A::VALUE10 + **self == PC4_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC4_A::VALUE11 + **self == PC4_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC4_A::VALUE12 + **self == PC4_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC4_A::VALUE13 + **self == PC4_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC4_A::VALUE14 + **self == PC4_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC4_A::VALUE15 + **self == PC4_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC4_A::VALUE16 + **self == PC4_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC4_A::VALUE17 + **self == PC4_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC4_A::VALUE18 + **self == PC4_A::VALUE18 } } -#[doc = "Write proxy for field `PC4`"] +impl core::ops::Deref for PC4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] pub struct PC4_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC5`"] -pub type PC5_R = crate::R; +#[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC5_R(crate::FieldReader); impl PC5_R { + pub(crate) fn new(bits: u8) -> Self { + PC5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC5_A::VALUE1), - 1 => Val(PC5_A::VALUE2), - 2 => Val(PC5_A::VALUE3), - 3 => Val(PC5_A::VALUE4), - 4 => Val(PC5_A::VALUE5), - 5 => Val(PC5_A::VALUE6), - 6 => Val(PC5_A::VALUE7), - 7 => Val(PC5_A::VALUE8), - 16 => Val(PC5_A::VALUE9), - 17 => Val(PC5_A::VALUE10), - 18 => Val(PC5_A::VALUE11), - 19 => Val(PC5_A::VALUE12), - 20 => Val(PC5_A::VALUE13), - 24 => Val(PC5_A::VALUE14), - 25 => Val(PC5_A::VALUE15), - 26 => Val(PC5_A::VALUE16), - 27 => Val(PC5_A::VALUE17), - 28 => Val(PC5_A::VALUE18), - i => Res(i), + 0 => Some(PC5_A::VALUE1), + 1 => Some(PC5_A::VALUE2), + 2 => Some(PC5_A::VALUE3), + 3 => Some(PC5_A::VALUE4), + 4 => Some(PC5_A::VALUE5), + 5 => Some(PC5_A::VALUE6), + 6 => Some(PC5_A::VALUE7), + 7 => Some(PC5_A::VALUE8), + 16 => Some(PC5_A::VALUE9), + 17 => Some(PC5_A::VALUE10), + 18 => Some(PC5_A::VALUE11), + 19 => Some(PC5_A::VALUE12), + 20 => Some(PC5_A::VALUE13), + 24 => Some(PC5_A::VALUE14), + 25 => Some(PC5_A::VALUE15), + 26 => Some(PC5_A::VALUE16), + 27 => Some(PC5_A::VALUE17), + 28 => Some(PC5_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC5_A::VALUE1 + **self == PC5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC5_A::VALUE2 + **self == PC5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC5_A::VALUE3 + **self == PC5_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC5_A::VALUE4 + **self == PC5_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC5_A::VALUE5 + **self == PC5_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC5_A::VALUE6 + **self == PC5_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC5_A::VALUE7 + **self == PC5_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC5_A::VALUE8 + **self == PC5_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC5_A::VALUE9 + **self == PC5_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC5_A::VALUE10 + **self == PC5_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC5_A::VALUE11 + **self == PC5_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC5_A::VALUE12 + **self == PC5_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC5_A::VALUE13 + **self == PC5_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC5_A::VALUE14 + **self == PC5_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC5_A::VALUE15 + **self == PC5_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC5_A::VALUE16 + **self == PC5_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC5_A::VALUE17 + **self == PC5_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC5_A::VALUE18 + **self == PC5_A::VALUE18 } } -#[doc = "Write proxy for field `PC5`"] +impl core::ops::Deref for PC5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] pub struct PC5_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC6`"] -pub type PC6_R = crate::R; +#[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC6_R(crate::FieldReader); impl PC6_R { + pub(crate) fn new(bits: u8) -> Self { + PC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC6_A::VALUE1), - 1 => Val(PC6_A::VALUE2), - 2 => Val(PC6_A::VALUE3), - 3 => Val(PC6_A::VALUE4), - 4 => Val(PC6_A::VALUE5), - 5 => Val(PC6_A::VALUE6), - 6 => Val(PC6_A::VALUE7), - 7 => Val(PC6_A::VALUE8), - 16 => Val(PC6_A::VALUE9), - 17 => Val(PC6_A::VALUE10), - 18 => Val(PC6_A::VALUE11), - 19 => Val(PC6_A::VALUE12), - 20 => Val(PC6_A::VALUE13), - 24 => Val(PC6_A::VALUE14), - 25 => Val(PC6_A::VALUE15), - 26 => Val(PC6_A::VALUE16), - 27 => Val(PC6_A::VALUE17), - 28 => Val(PC6_A::VALUE18), - i => Res(i), + 0 => Some(PC6_A::VALUE1), + 1 => Some(PC6_A::VALUE2), + 2 => Some(PC6_A::VALUE3), + 3 => Some(PC6_A::VALUE4), + 4 => Some(PC6_A::VALUE5), + 5 => Some(PC6_A::VALUE6), + 6 => Some(PC6_A::VALUE7), + 7 => Some(PC6_A::VALUE8), + 16 => Some(PC6_A::VALUE9), + 17 => Some(PC6_A::VALUE10), + 18 => Some(PC6_A::VALUE11), + 19 => Some(PC6_A::VALUE12), + 20 => Some(PC6_A::VALUE13), + 24 => Some(PC6_A::VALUE14), + 25 => Some(PC6_A::VALUE15), + 26 => Some(PC6_A::VALUE16), + 27 => Some(PC6_A::VALUE17), + 28 => Some(PC6_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC6_A::VALUE1 + **self == PC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC6_A::VALUE2 + **self == PC6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC6_A::VALUE3 + **self == PC6_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC6_A::VALUE4 + **self == PC6_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC6_A::VALUE5 + **self == PC6_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC6_A::VALUE6 + **self == PC6_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC6_A::VALUE7 + **self == PC6_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC6_A::VALUE8 + **self == PC6_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC6_A::VALUE9 + **self == PC6_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC6_A::VALUE10 + **self == PC6_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC6_A::VALUE11 + **self == PC6_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC6_A::VALUE12 + **self == PC6_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC6_A::VALUE13 + **self == PC6_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC6_A::VALUE14 + **self == PC6_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC6_A::VALUE15 + **self == PC6_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC6_A::VALUE16 + **self == PC6_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC6_A::VALUE17 + **self == PC6_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC6_A::VALUE18 + **self == PC6_A::VALUE18 + } +} +impl core::ops::Deref for PC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC6`"] +#[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] pub struct PC6_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC7`"] -pub type PC7_R = crate::R; +#[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC7_R(crate::FieldReader); impl PC7_R { + pub(crate) fn new(bits: u8) -> Self { + PC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC7_A::VALUE1), - 1 => Val(PC7_A::VALUE2), - 2 => Val(PC7_A::VALUE3), - 3 => Val(PC7_A::VALUE4), - 4 => Val(PC7_A::VALUE5), - 5 => Val(PC7_A::VALUE6), - 6 => Val(PC7_A::VALUE7), - 7 => Val(PC7_A::VALUE8), - 16 => Val(PC7_A::VALUE9), - 17 => Val(PC7_A::VALUE10), - 18 => Val(PC7_A::VALUE11), - 19 => Val(PC7_A::VALUE12), - 20 => Val(PC7_A::VALUE13), - 24 => Val(PC7_A::VALUE14), - 25 => Val(PC7_A::VALUE15), - 26 => Val(PC7_A::VALUE16), - 27 => Val(PC7_A::VALUE17), - 28 => Val(PC7_A::VALUE18), - i => Res(i), + 0 => Some(PC7_A::VALUE1), + 1 => Some(PC7_A::VALUE2), + 2 => Some(PC7_A::VALUE3), + 3 => Some(PC7_A::VALUE4), + 4 => Some(PC7_A::VALUE5), + 5 => Some(PC7_A::VALUE6), + 6 => Some(PC7_A::VALUE7), + 7 => Some(PC7_A::VALUE8), + 16 => Some(PC7_A::VALUE9), + 17 => Some(PC7_A::VALUE10), + 18 => Some(PC7_A::VALUE11), + 19 => Some(PC7_A::VALUE12), + 20 => Some(PC7_A::VALUE13), + 24 => Some(PC7_A::VALUE14), + 25 => Some(PC7_A::VALUE15), + 26 => Some(PC7_A::VALUE16), + 27 => Some(PC7_A::VALUE17), + 28 => Some(PC7_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC7_A::VALUE1 + **self == PC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC7_A::VALUE2 + **self == PC7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC7_A::VALUE3 + **self == PC7_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC7_A::VALUE4 + **self == PC7_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC7_A::VALUE5 + **self == PC7_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC7_A::VALUE6 + **self == PC7_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC7_A::VALUE7 + **self == PC7_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC7_A::VALUE8 + **self == PC7_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC7_A::VALUE9 + **self == PC7_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC7_A::VALUE10 + **self == PC7_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC7_A::VALUE11 + **self == PC7_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC7_A::VALUE12 + **self == PC7_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC7_A::VALUE13 + **self == PC7_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC7_A::VALUE14 + **self == PC7_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC7_A::VALUE15 + **self == PC7_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC7_A::VALUE16 + **self == PC7_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC7_A::VALUE17 + **self == PC7_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC7_A::VALUE18 + **self == PC7_A::VALUE18 + } +} +impl core::ops::Deref for PC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC7`"] +#[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] pub struct PC7_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc7(&mut self) -> PC7_W { PC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Input/Output Control Register 4\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 [iocr4](index.html) module"] +pub struct IOCR4_SPEC; +impl crate::RegisterSpec for IOCR4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr4::R](R) reader structure"] +impl crate::Readable for IOCR4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr4::W](W) writer structure"] +impl crate::Writable for IOCR4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR4 to value 0"] +impl crate::Resettable for IOCR4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/iocr8.rs b/src/port14/iocr8.rs index 00d96809..65873ec8 100644 --- a/src/port14/iocr8.rs +++ b/src/port14/iocr8.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR8"] -pub type R = crate::R; -#[doc = "Writer for register IOCR8"] -pub type W = crate::W; -#[doc = "Register IOCR8 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR8 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR8` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR8` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC8`"] -pub type PC8_R = crate::R; +#[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC8_R(crate::FieldReader); impl PC8_R { + pub(crate) fn new(bits: u8) -> Self { + PC8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC8_A::VALUE1), - 1 => Val(PC8_A::VALUE2), - 2 => Val(PC8_A::VALUE3), - 3 => Val(PC8_A::VALUE4), - 4 => Val(PC8_A::VALUE5), - 5 => Val(PC8_A::VALUE6), - 6 => Val(PC8_A::VALUE7), - 7 => Val(PC8_A::VALUE8), - 16 => Val(PC8_A::VALUE9), - 17 => Val(PC8_A::VALUE10), - 18 => Val(PC8_A::VALUE11), - 19 => Val(PC8_A::VALUE12), - 20 => Val(PC8_A::VALUE13), - 24 => Val(PC8_A::VALUE14), - 25 => Val(PC8_A::VALUE15), - 26 => Val(PC8_A::VALUE16), - 27 => Val(PC8_A::VALUE17), - 28 => Val(PC8_A::VALUE18), - i => Res(i), + 0 => Some(PC8_A::VALUE1), + 1 => Some(PC8_A::VALUE2), + 2 => Some(PC8_A::VALUE3), + 3 => Some(PC8_A::VALUE4), + 4 => Some(PC8_A::VALUE5), + 5 => Some(PC8_A::VALUE6), + 6 => Some(PC8_A::VALUE7), + 7 => Some(PC8_A::VALUE8), + 16 => Some(PC8_A::VALUE9), + 17 => Some(PC8_A::VALUE10), + 18 => Some(PC8_A::VALUE11), + 19 => Some(PC8_A::VALUE12), + 20 => Some(PC8_A::VALUE13), + 24 => Some(PC8_A::VALUE14), + 25 => Some(PC8_A::VALUE15), + 26 => Some(PC8_A::VALUE16), + 27 => Some(PC8_A::VALUE17), + 28 => Some(PC8_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC8_A::VALUE1 + **self == PC8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC8_A::VALUE2 + **self == PC8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC8_A::VALUE3 + **self == PC8_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC8_A::VALUE4 + **self == PC8_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC8_A::VALUE5 + **self == PC8_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC8_A::VALUE6 + **self == PC8_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC8_A::VALUE7 + **self == PC8_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC8_A::VALUE8 + **self == PC8_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC8_A::VALUE9 + **self == PC8_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC8_A::VALUE10 + **self == PC8_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC8_A::VALUE11 + **self == PC8_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC8_A::VALUE12 + **self == PC8_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC8_A::VALUE13 + **self == PC8_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC8_A::VALUE14 + **self == PC8_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC8_A::VALUE15 + **self == PC8_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC8_A::VALUE16 + **self == PC8_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC8_A::VALUE17 + **self == PC8_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC8_A::VALUE18 + **self == PC8_A::VALUE18 } } -#[doc = "Write proxy for field `PC8`"] +impl core::ops::Deref for PC8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] pub struct PC8_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC9`"] -pub type PC9_R = crate::R; +#[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC9_R(crate::FieldReader); impl PC9_R { + pub(crate) fn new(bits: u8) -> Self { + PC9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC9_A::VALUE1), - 1 => Val(PC9_A::VALUE2), - 2 => Val(PC9_A::VALUE3), - 3 => Val(PC9_A::VALUE4), - 4 => Val(PC9_A::VALUE5), - 5 => Val(PC9_A::VALUE6), - 6 => Val(PC9_A::VALUE7), - 7 => Val(PC9_A::VALUE8), - 16 => Val(PC9_A::VALUE9), - 17 => Val(PC9_A::VALUE10), - 18 => Val(PC9_A::VALUE11), - 19 => Val(PC9_A::VALUE12), - 20 => Val(PC9_A::VALUE13), - 24 => Val(PC9_A::VALUE14), - 25 => Val(PC9_A::VALUE15), - 26 => Val(PC9_A::VALUE16), - 27 => Val(PC9_A::VALUE17), - 28 => Val(PC9_A::VALUE18), - i => Res(i), + 0 => Some(PC9_A::VALUE1), + 1 => Some(PC9_A::VALUE2), + 2 => Some(PC9_A::VALUE3), + 3 => Some(PC9_A::VALUE4), + 4 => Some(PC9_A::VALUE5), + 5 => Some(PC9_A::VALUE6), + 6 => Some(PC9_A::VALUE7), + 7 => Some(PC9_A::VALUE8), + 16 => Some(PC9_A::VALUE9), + 17 => Some(PC9_A::VALUE10), + 18 => Some(PC9_A::VALUE11), + 19 => Some(PC9_A::VALUE12), + 20 => Some(PC9_A::VALUE13), + 24 => Some(PC9_A::VALUE14), + 25 => Some(PC9_A::VALUE15), + 26 => Some(PC9_A::VALUE16), + 27 => Some(PC9_A::VALUE17), + 28 => Some(PC9_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC9_A::VALUE1 + **self == PC9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC9_A::VALUE2 + **self == PC9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC9_A::VALUE3 + **self == PC9_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC9_A::VALUE4 + **self == PC9_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC9_A::VALUE5 + **self == PC9_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC9_A::VALUE6 + **self == PC9_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC9_A::VALUE7 + **self == PC9_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC9_A::VALUE8 + **self == PC9_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC9_A::VALUE9 + **self == PC9_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC9_A::VALUE10 + **self == PC9_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC9_A::VALUE11 + **self == PC9_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC9_A::VALUE12 + **self == PC9_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC9_A::VALUE13 + **self == PC9_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC9_A::VALUE14 + **self == PC9_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC9_A::VALUE15 + **self == PC9_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC9_A::VALUE16 + **self == PC9_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC9_A::VALUE17 + **self == PC9_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC9_A::VALUE18 + **self == PC9_A::VALUE18 } } -#[doc = "Write proxy for field `PC9`"] +impl core::ops::Deref for PC9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] pub struct PC9_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC10`"] -pub type PC10_R = crate::R; +#[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC10_R(crate::FieldReader); impl PC10_R { + pub(crate) fn new(bits: u8) -> Self { + PC10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC10_A::VALUE1), - 1 => Val(PC10_A::VALUE2), - 2 => Val(PC10_A::VALUE3), - 3 => Val(PC10_A::VALUE4), - 4 => Val(PC10_A::VALUE5), - 5 => Val(PC10_A::VALUE6), - 6 => Val(PC10_A::VALUE7), - 7 => Val(PC10_A::VALUE8), - 16 => Val(PC10_A::VALUE9), - 17 => Val(PC10_A::VALUE10), - 18 => Val(PC10_A::VALUE11), - 19 => Val(PC10_A::VALUE12), - 20 => Val(PC10_A::VALUE13), - 24 => Val(PC10_A::VALUE14), - 25 => Val(PC10_A::VALUE15), - 26 => Val(PC10_A::VALUE16), - 27 => Val(PC10_A::VALUE17), - 28 => Val(PC10_A::VALUE18), - i => Res(i), + 0 => Some(PC10_A::VALUE1), + 1 => Some(PC10_A::VALUE2), + 2 => Some(PC10_A::VALUE3), + 3 => Some(PC10_A::VALUE4), + 4 => Some(PC10_A::VALUE5), + 5 => Some(PC10_A::VALUE6), + 6 => Some(PC10_A::VALUE7), + 7 => Some(PC10_A::VALUE8), + 16 => Some(PC10_A::VALUE9), + 17 => Some(PC10_A::VALUE10), + 18 => Some(PC10_A::VALUE11), + 19 => Some(PC10_A::VALUE12), + 20 => Some(PC10_A::VALUE13), + 24 => Some(PC10_A::VALUE14), + 25 => Some(PC10_A::VALUE15), + 26 => Some(PC10_A::VALUE16), + 27 => Some(PC10_A::VALUE17), + 28 => Some(PC10_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC10_A::VALUE1 + **self == PC10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC10_A::VALUE2 + **self == PC10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC10_A::VALUE3 + **self == PC10_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC10_A::VALUE4 + **self == PC10_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC10_A::VALUE5 + **self == PC10_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC10_A::VALUE6 + **self == PC10_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC10_A::VALUE7 + **self == PC10_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC10_A::VALUE8 + **self == PC10_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC10_A::VALUE9 + **self == PC10_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC10_A::VALUE10 + **self == PC10_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC10_A::VALUE11 + **self == PC10_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC10_A::VALUE12 + **self == PC10_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC10_A::VALUE13 + **self == PC10_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC10_A::VALUE14 + **self == PC10_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC10_A::VALUE15 + **self == PC10_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC10_A::VALUE16 + **self == PC10_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC10_A::VALUE17 + **self == PC10_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC10_A::VALUE18 + **self == PC10_A::VALUE18 + } +} +impl core::ops::Deref for PC10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC10`"] +#[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] pub struct PC10_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC11`"] -pub type PC11_R = crate::R; +#[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC11_R(crate::FieldReader); impl PC11_R { + pub(crate) fn new(bits: u8) -> Self { + PC11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC11_A::VALUE1), - 1 => Val(PC11_A::VALUE2), - 2 => Val(PC11_A::VALUE3), - 3 => Val(PC11_A::VALUE4), - 4 => Val(PC11_A::VALUE5), - 5 => Val(PC11_A::VALUE6), - 6 => Val(PC11_A::VALUE7), - 7 => Val(PC11_A::VALUE8), - 16 => Val(PC11_A::VALUE9), - 17 => Val(PC11_A::VALUE10), - 18 => Val(PC11_A::VALUE11), - 19 => Val(PC11_A::VALUE12), - 20 => Val(PC11_A::VALUE13), - 24 => Val(PC11_A::VALUE14), - 25 => Val(PC11_A::VALUE15), - 26 => Val(PC11_A::VALUE16), - 27 => Val(PC11_A::VALUE17), - 28 => Val(PC11_A::VALUE18), - i => Res(i), + 0 => Some(PC11_A::VALUE1), + 1 => Some(PC11_A::VALUE2), + 2 => Some(PC11_A::VALUE3), + 3 => Some(PC11_A::VALUE4), + 4 => Some(PC11_A::VALUE5), + 5 => Some(PC11_A::VALUE6), + 6 => Some(PC11_A::VALUE7), + 7 => Some(PC11_A::VALUE8), + 16 => Some(PC11_A::VALUE9), + 17 => Some(PC11_A::VALUE10), + 18 => Some(PC11_A::VALUE11), + 19 => Some(PC11_A::VALUE12), + 20 => Some(PC11_A::VALUE13), + 24 => Some(PC11_A::VALUE14), + 25 => Some(PC11_A::VALUE15), + 26 => Some(PC11_A::VALUE16), + 27 => Some(PC11_A::VALUE17), + 28 => Some(PC11_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC11_A::VALUE1 + **self == PC11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC11_A::VALUE2 + **self == PC11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC11_A::VALUE3 + **self == PC11_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC11_A::VALUE4 + **self == PC11_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC11_A::VALUE5 + **self == PC11_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC11_A::VALUE6 + **self == PC11_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC11_A::VALUE7 + **self == PC11_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC11_A::VALUE8 + **self == PC11_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC11_A::VALUE9 + **self == PC11_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC11_A::VALUE10 + **self == PC11_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC11_A::VALUE11 + **self == PC11_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC11_A::VALUE12 + **self == PC11_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC11_A::VALUE13 + **self == PC11_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC11_A::VALUE14 + **self == PC11_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC11_A::VALUE15 + **self == PC11_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC11_A::VALUE16 + **self == PC11_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC11_A::VALUE17 + **self == PC11_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC11_A::VALUE18 + **self == PC11_A::VALUE18 + } +} +impl core::ops::Deref for PC11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC11`"] +#[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] pub struct PC11_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc11(&mut self) -> PC11_W { PC11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Input/Output Control Register 8\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 [iocr8](index.html) module"] +pub struct IOCR8_SPEC; +impl crate::RegisterSpec for IOCR8_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr8::R](R) reader structure"] +impl crate::Readable for IOCR8_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr8::W](W) writer structure"] +impl crate::Writable for IOCR8_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR8 to value 0"] +impl crate::Resettable for IOCR8_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/omr.rs b/src/port14/omr.rs index c8c458f2..6e19608c 100644 --- a/src/port14/omr.rs +++ b/src/port14/omr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OMR"] -pub type W = crate::W; -#[doc = "Register OMR `reset()`'s with value 0"] -impl crate::ResetValue for super::OMR { - type Type = u32; +#[doc = "Register `OMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `PS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PS0` writer - Port n Set Bit 0"] pub struct PS0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> PS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `PS1`"] +#[doc = "Field `PS1` writer - Port n Set Bit 1"] pub struct PS1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> PS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS2`"] +#[doc = "Field `PS2` writer - Port n Set Bit 2"] pub struct PS2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS3`"] +#[doc = "Field `PS3` writer - Port n Set Bit 3"] pub struct PS3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS4`"] +#[doc = "Field `PS4` writer - Port n Set Bit 4"] pub struct PS4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PS5`"] +#[doc = "Field `PS5` writer - Port n Set Bit 5"] pub struct PS5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `PS6`"] +#[doc = "Field `PS6` writer - Port n Set Bit 6"] pub struct PS6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> PS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `PS7`"] +#[doc = "Field `PS7` writer - Port n Set Bit 7"] pub struct PS7_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `PS8`"] +#[doc = "Field `PS8` writer - Port n Set Bit 8"] pub struct PS8_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PS9`"] +#[doc = "Field `PS9` writer - Port n Set Bit 9"] pub struct PS9_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS10`"] +#[doc = "Field `PS10` writer - Port n Set Bit 10"] pub struct PS10_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> PS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS11`"] +#[doc = "Field `PS11` writer - Port n Set Bit 11"] pub struct PS11_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> PS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS12`"] +#[doc = "Field `PS12` writer - Port n Set Bit 12"] pub struct PS12_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `PS13`"] +#[doc = "Field `PS13` writer - Port n Set Bit 13"] pub struct PS13_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `PS14`"] +#[doc = "Field `PS14` writer - Port n Set Bit 14"] pub struct PS14_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> PS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `PS15`"] +#[doc = "Field `PS15` writer - Port n Set Bit 15"] pub struct PS15_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> PS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Write proxy for field `PR0`"] +#[doc = "Field `PR0` writer - Port n Reset Bit 0"] pub struct PR0_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> PR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `PR1`"] +#[doc = "Field `PR1` writer - Port n Reset Bit 1"] pub struct PR1_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> PR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PR2`"] +#[doc = "Field `PR2` writer - Port n Reset Bit 2"] pub struct PR2_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> PR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PR3`"] +#[doc = "Field `PR3` writer - Port n Reset Bit 3"] pub struct PR3_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> PR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PR4`"] +#[doc = "Field `PR4` writer - Port n Reset Bit 4"] pub struct PR4_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> PR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `PR5`"] +#[doc = "Field `PR5` writer - Port n Reset Bit 5"] pub struct PR5_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> PR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `PR6`"] +#[doc = "Field `PR6` writer - Port n Reset Bit 6"] pub struct PR6_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> PR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `PR7`"] +#[doc = "Field `PR7` writer - Port n Reset Bit 7"] pub struct PR7_W<'a> { w: &'a mut W, } @@ -532,11 +543,11 @@ impl<'a> PR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `PR8`"] +#[doc = "Field `PR8` writer - Port n Reset Bit 8"] pub struct PR8_W<'a> { w: &'a mut W, } @@ -554,11 +565,11 @@ impl<'a> PR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `PR9`"] +#[doc = "Field `PR9` writer - Port n Reset Bit 9"] pub struct PR9_W<'a> { w: &'a mut W, } @@ -576,11 +587,11 @@ impl<'a> PR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `PR10`"] +#[doc = "Field `PR10` writer - Port n Reset Bit 10"] pub struct PR10_W<'a> { w: &'a mut W, } @@ -598,11 +609,11 @@ impl<'a> PR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `PR11`"] +#[doc = "Field `PR11` writer - Port n Reset Bit 11"] pub struct PR11_W<'a> { w: &'a mut W, } @@ -620,11 +631,11 @@ impl<'a> PR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `PR12`"] +#[doc = "Field `PR12` writer - Port n Reset Bit 12"] pub struct PR12_W<'a> { w: &'a mut W, } @@ -642,11 +653,11 @@ impl<'a> PR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `PR13`"] +#[doc = "Field `PR13` writer - Port n Reset Bit 13"] pub struct PR13_W<'a> { w: &'a mut W, } @@ -664,11 +675,11 @@ impl<'a> PR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Write proxy for field `PR14`"] +#[doc = "Field `PR14` writer - Port n Reset Bit 14"] pub struct PR14_W<'a> { w: &'a mut W, } @@ -686,11 +697,11 @@ impl<'a> PR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Write proxy for field `PR15`"] +#[doc = "Field `PR15` writer - Port n Reset Bit 15"] pub struct PR15_W<'a> { w: &'a mut W, } @@ -708,7 +719,7 @@ impl<'a> PR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -873,4 +884,26 @@ impl W { pub fn pr15(&mut self) -> PR15_W { PR15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Output Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](index.html) module"] +pub struct OMR_SPEC; +impl crate::RegisterSpec for OMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +impl crate::Writable for OMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OMR to value 0"] +impl crate::Resettable for OMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/out.rs b/src/port14/out.rs index 234afddb..dd4bfa38 100644 --- a/src/port14/out.rs +++ b/src/port14/out.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OUT"] -pub type R = crate::R; -#[doc = "Writer for register OUT"] -pub type W = crate::W; -#[doc = "Register OUT `reset()`'s with value 0"] -impl crate::ResetValue for super::OUT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Output Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -38,15 +65,22 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 } } -#[doc = "Write proxy for field `P0`"] +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P0` writer - Port n Output Bit 0"] pub struct P0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Output Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -113,15 +148,22 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 } } -#[doc = "Write proxy for field `P1`"] +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P1` writer - Port n Output Bit 1"] pub struct P1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Output Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -188,15 +231,22 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P2`"] +#[doc = "Field `P2` writer - Port n Output Bit 2"] pub struct P2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Output Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -263,15 +314,22 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P3`"] +#[doc = "Field `P3` writer - Port n Output Bit 3"] pub struct P3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Output Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -338,15 +397,22 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P4`"] +#[doc = "Field `P4` writer - Port n Output Bit 4"] pub struct P4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Output Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -413,15 +480,22 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P5`"] +#[doc = "Field `P5` writer - Port n Output Bit 5"] pub struct P5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Output Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -488,15 +563,22 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 } } -#[doc = "Write proxy for field `P6`"] +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P6` writer - Port n Output Bit 6"] pub struct P6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Output Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -563,15 +646,22 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 } } -#[doc = "Write proxy for field `P7`"] +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P7` writer - Port n Output Bit 7"] pub struct P7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Output Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -638,15 +729,22 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 } } -#[doc = "Write proxy for field `P8`"] +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P8` writer - Port n Output Bit 8"] pub struct P8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Output Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -713,15 +812,22 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P9`"] +#[doc = "Field `P9` writer - Port n Output Bit 9"] pub struct P9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Output Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -788,15 +895,22 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 } } -#[doc = "Write proxy for field `P10`"] +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P10` writer - Port n Output Bit 10"] pub struct P10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Output Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -863,15 +978,22 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 } } -#[doc = "Write proxy for field `P11`"] +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P11` writer - Port n Output Bit 11"] pub struct P11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Output Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -938,15 +1061,22 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P12`"] +#[doc = "Field `P12` writer - Port n Output Bit 12"] pub struct P12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Output Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -1013,15 +1144,22 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 } } -#[doc = "Write proxy for field `P13`"] +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P13` writer - Port n Output Bit 13"] pub struct P13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Output Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -1088,15 +1227,22 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 } } -#[doc = "Write proxy for field `P14`"] +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P14` writer - Port n Output Bit 14"] pub struct P14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Output Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -1163,15 +1310,22 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 } } -#[doc = "Write proxy for field `P15`"] +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P15` writer - Port n Output Bit 15"] pub struct P15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn p15(&mut self) -> P15_W { P15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Output Register\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 [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/pdisc.rs b/src/port14/pdisc.rs index 63822227..4429b5ca 100644 --- a/src/port14/pdisc.rs +++ b/src/port14/pdisc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PDISC"] -pub type R = crate::R; -#[doc = "Writer for register PDISC"] -pub type W = crate::W; -#[doc = "Register PDISC `reset()`'s with value 0"] -impl crate::ResetValue for super::PDISC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PDISC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDISC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS0`"] -pub type PDIS0_R = crate::R; +#[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] +pub struct PDIS0_R(crate::FieldReader); impl PDIS0_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS0_A { @@ -38,15 +65,22 @@ impl PDIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS0_A::VALUE1 + **self == PDIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS0_A::VALUE2 + **self == PDIS0_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS0`"] +impl core::ops::Deref for PDIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS0` writer - Pad Disable for Port n Pin 0"] pub struct PDIS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PDIS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PDIS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS1`"] -pub type PDIS1_R = crate::R; +#[doc = "Field `PDIS1` reader - Pad Disable for Port n Pin 1"] +pub struct PDIS1_R(crate::FieldReader); impl PDIS1_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS1_A { @@ -113,15 +148,22 @@ impl PDIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS1_A::VALUE1 + **self == PDIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS1_A::VALUE2 + **self == PDIS1_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS1`"] +impl core::ops::Deref for PDIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS1` writer - Pad Disable for Port n Pin 1"] pub struct PDIS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PDIS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PDIS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS2`"] -pub type PDIS2_R = crate::R; +#[doc = "Field `PDIS2` reader - Pad Disable for Port n Pin 2"] +pub struct PDIS2_R(crate::FieldReader); impl PDIS2_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS2_A { @@ -188,15 +231,22 @@ impl PDIS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS2_A::VALUE1 + **self == PDIS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS2_A::VALUE2 + **self == PDIS2_A::VALUE2 + } +} +impl core::ops::Deref for PDIS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS2`"] +#[doc = "Field `PDIS2` writer - Pad Disable for Port n Pin 2"] pub struct PDIS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PDIS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PDIS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS3`"] -pub type PDIS3_R = crate::R; +#[doc = "Field `PDIS3` reader - Pad Disable for Port n Pin 3"] +pub struct PDIS3_R(crate::FieldReader); impl PDIS3_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS3_A { @@ -263,15 +314,22 @@ impl PDIS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS3_A::VALUE1 + **self == PDIS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS3_A::VALUE2 + **self == PDIS3_A::VALUE2 + } +} +impl core::ops::Deref for PDIS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS3`"] +#[doc = "Field `PDIS3` writer - Pad Disable for Port n Pin 3"] pub struct PDIS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PDIS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PDIS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS4`"] -pub type PDIS4_R = crate::R; +#[doc = "Field `PDIS4` reader - Pad Disable for Port n Pin 4"] +pub struct PDIS4_R(crate::FieldReader); impl PDIS4_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS4_A { @@ -338,15 +397,22 @@ impl PDIS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS4_A::VALUE1 + **self == PDIS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS4_A::VALUE2 + **self == PDIS4_A::VALUE2 + } +} +impl core::ops::Deref for PDIS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS4`"] +#[doc = "Field `PDIS4` writer - Pad Disable for Port n Pin 4"] pub struct PDIS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PDIS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PDIS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS5`"] -pub type PDIS5_R = crate::R; +#[doc = "Field `PDIS5` reader - Pad Disable for Port n Pin 5"] +pub struct PDIS5_R(crate::FieldReader); impl PDIS5_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS5_A { @@ -413,15 +480,22 @@ impl PDIS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS5_A::VALUE1 + **self == PDIS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS5_A::VALUE2 + **self == PDIS5_A::VALUE2 + } +} +impl core::ops::Deref for PDIS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS5`"] +#[doc = "Field `PDIS5` writer - Pad Disable for Port n Pin 5"] pub struct PDIS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PDIS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PDIS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS6`"] -pub type PDIS6_R = crate::R; +#[doc = "Field `PDIS6` reader - Pad Disable for Port n Pin 6"] +pub struct PDIS6_R(crate::FieldReader); impl PDIS6_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS6_A { @@ -488,15 +563,22 @@ impl PDIS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS6_A::VALUE1 + **self == PDIS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS6_A::VALUE2 + **self == PDIS6_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS6`"] +impl core::ops::Deref for PDIS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS6` writer - Pad Disable for Port n Pin 6"] pub struct PDIS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PDIS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PDIS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS7`"] -pub type PDIS7_R = crate::R; +#[doc = "Field `PDIS7` reader - Pad Disable for Port n Pin 7"] +pub struct PDIS7_R(crate::FieldReader); impl PDIS7_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS7_A { @@ -563,15 +646,22 @@ impl PDIS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS7_A::VALUE1 + **self == PDIS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS7_A::VALUE2 + **self == PDIS7_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS7`"] +impl core::ops::Deref for PDIS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS7` writer - Pad Disable for Port n Pin 7"] pub struct PDIS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PDIS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PDIS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS8`"] -pub type PDIS8_R = crate::R; +#[doc = "Field `PDIS8` reader - Pad Disable for Port n Pin 8"] +pub struct PDIS8_R(crate::FieldReader); impl PDIS8_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS8_A { @@ -638,15 +729,22 @@ impl PDIS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS8_A::VALUE1 + **self == PDIS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS8_A::VALUE2 + **self == PDIS8_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS8`"] +impl core::ops::Deref for PDIS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS8` writer - Pad Disable for Port n Pin 8"] pub struct PDIS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PDIS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PDIS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS9`"] -pub type PDIS9_R = crate::R; +#[doc = "Field `PDIS9` reader - Pad Disable for Port n Pin 9"] +pub struct PDIS9_R(crate::FieldReader); impl PDIS9_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS9_A { @@ -713,15 +812,22 @@ impl PDIS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS9_A::VALUE1 + **self == PDIS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS9_A::VALUE2 + **self == PDIS9_A::VALUE2 + } +} +impl core::ops::Deref for PDIS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS9`"] +#[doc = "Field `PDIS9` writer - Pad Disable for Port n Pin 9"] pub struct PDIS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PDIS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PDIS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS10`"] -pub type PDIS10_R = crate::R; +#[doc = "Field `PDIS10` reader - Pad Disable for Port n Pin 10"] +pub struct PDIS10_R(crate::FieldReader); impl PDIS10_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS10_A { @@ -788,15 +895,22 @@ impl PDIS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS10_A::VALUE1 + **self == PDIS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS10_A::VALUE2 + **self == PDIS10_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS10`"] +impl core::ops::Deref for PDIS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS10` writer - Pad Disable for Port n Pin 10"] pub struct PDIS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PDIS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PDIS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS11`"] -pub type PDIS11_R = crate::R; +#[doc = "Field `PDIS11` reader - Pad Disable for Port n Pin 11"] +pub struct PDIS11_R(crate::FieldReader); impl PDIS11_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS11_A { @@ -863,15 +978,22 @@ impl PDIS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS11_A::VALUE1 + **self == PDIS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS11_A::VALUE2 + **self == PDIS11_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS11`"] +impl core::ops::Deref for PDIS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS11` writer - Pad Disable for Port n Pin 11"] pub struct PDIS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PDIS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PDIS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS12`"] -pub type PDIS12_R = crate::R; +#[doc = "Field `PDIS12` reader - Pad Disable for Port n Pin 12"] +pub struct PDIS12_R(crate::FieldReader); impl PDIS12_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS12_A { @@ -938,15 +1061,22 @@ impl PDIS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS12_A::VALUE1 + **self == PDIS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS12_A::VALUE2 + **self == PDIS12_A::VALUE2 + } +} +impl core::ops::Deref for PDIS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDIS12`"] +#[doc = "Field `PDIS12` writer - Pad Disable for Port n Pin 12"] pub struct PDIS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PDIS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PDIS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS13`"] -pub type PDIS13_R = crate::R; +#[doc = "Field `PDIS13` reader - Pad Disable for Port n Pin 13"] +pub struct PDIS13_R(crate::FieldReader); impl PDIS13_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS13_A { @@ -1013,15 +1144,22 @@ impl PDIS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS13_A::VALUE1 + **self == PDIS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS13_A::VALUE2 + **self == PDIS13_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS13`"] +impl core::ops::Deref for PDIS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS13` writer - Pad Disable for Port n Pin 13"] pub struct PDIS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PDIS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PDIS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS14`"] -pub type PDIS14_R = crate::R; +#[doc = "Field `PDIS14` reader - Pad Disable for Port n Pin 14"] +pub struct PDIS14_R(crate::FieldReader); impl PDIS14_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS14_A { @@ -1088,15 +1227,22 @@ impl PDIS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS14_A::VALUE1 + **self == PDIS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS14_A::VALUE2 + **self == PDIS14_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS14`"] +impl core::ops::Deref for PDIS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS14` writer - Pad Disable for Port n Pin 14"] pub struct PDIS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PDIS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PDIS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS15`"] -pub type PDIS15_R = crate::R; +#[doc = "Field `PDIS15` reader - Pad Disable for Port n Pin 15"] +pub struct PDIS15_R(crate::FieldReader); impl PDIS15_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS15_A { @@ -1163,15 +1310,22 @@ impl PDIS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS15_A::VALUE1 + **self == PDIS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS15_A::VALUE2 + **self == PDIS15_A::VALUE2 } } -#[doc = "Write proxy for field `PDIS15`"] +impl core::ops::Deref for PDIS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIS15` writer - Pad Disable for Port n Pin 15"] pub struct PDIS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PDIS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDIS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PDIS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pdis15(&mut self) -> PDIS15_W { PDIS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Pin Function Decision Control Register\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 [pdisc](index.html) module"] +pub struct PDISC_SPEC; +impl crate::RegisterSpec for PDISC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdisc::R](R) reader structure"] +impl crate::Readable for PDISC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdisc::W](W) writer structure"] +impl crate::Writable for PDISC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDISC to value 0"] +impl crate::Resettable for PDISC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port14/pps.rs b/src/port14/pps.rs index b45c5930..71e9c6ec 100644 --- a/src/port14/pps.rs +++ b/src/port14/pps.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PPS"] -pub type R = crate::R; -#[doc = "Writer for register PPS"] -pub type W = crate::W; -#[doc = "Register PPS `reset()`'s with value 0"] -impl crate::ResetValue for super::PPS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS0`"] -pub type PPS0_R = crate::R; +#[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] +pub struct PPS0_R(crate::FieldReader); impl PPS0_R { + pub(crate) fn new(bits: bool) -> Self { + PPS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS0_A { @@ -38,15 +65,22 @@ impl PPS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS0_A::VALUE1 + **self == PPS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS0_A::VALUE2 + **self == PPS0_A::VALUE2 } } -#[doc = "Write proxy for field `PPS0`"] +impl core::ops::Deref for PPS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] pub struct PPS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS1`"] -pub type PPS1_R = crate::R; +#[doc = "Field `PPS1` reader - Port n Pin Power Save Bit 1"] +pub struct PPS1_R(crate::FieldReader); impl PPS1_R { + pub(crate) fn new(bits: bool) -> Self { + PPS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS1_A { @@ -113,15 +148,22 @@ impl PPS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS1_A::VALUE1 + **self == PPS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS1_A::VALUE2 + **self == PPS1_A::VALUE2 } } -#[doc = "Write proxy for field `PPS1`"] +impl core::ops::Deref for PPS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] pub struct PPS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS2`"] -pub type PPS2_R = crate::R; +#[doc = "Field `PPS2` reader - Port n Pin Power Save Bit 2"] +pub struct PPS2_R(crate::FieldReader); impl PPS2_R { + pub(crate) fn new(bits: bool) -> Self { + PPS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS2_A { @@ -188,15 +231,22 @@ impl PPS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS2_A::VALUE1 + **self == PPS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS2_A::VALUE2 + **self == PPS2_A::VALUE2 + } +} +impl core::ops::Deref for PPS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS2`"] +#[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] pub struct PPS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS3`"] -pub type PPS3_R = crate::R; +#[doc = "Field `PPS3` reader - Port n Pin Power Save Bit 3"] +pub struct PPS3_R(crate::FieldReader); impl PPS3_R { + pub(crate) fn new(bits: bool) -> Self { + PPS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS3_A { @@ -263,15 +314,22 @@ impl PPS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS3_A::VALUE1 + **self == PPS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS3_A::VALUE2 + **self == PPS3_A::VALUE2 + } +} +impl core::ops::Deref for PPS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS3`"] +#[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] pub struct PPS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS4`"] -pub type PPS4_R = crate::R; +#[doc = "Field `PPS4` reader - Port n Pin Power Save Bit 4"] +pub struct PPS4_R(crate::FieldReader); impl PPS4_R { + pub(crate) fn new(bits: bool) -> Self { + PPS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS4_A { @@ -338,15 +397,22 @@ impl PPS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS4_A::VALUE1 + **self == PPS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS4_A::VALUE2 + **self == PPS4_A::VALUE2 + } +} +impl core::ops::Deref for PPS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS4`"] +#[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] pub struct PPS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS5`"] -pub type PPS5_R = crate::R; +#[doc = "Field `PPS5` reader - Port n Pin Power Save Bit 5"] +pub struct PPS5_R(crate::FieldReader); impl PPS5_R { + pub(crate) fn new(bits: bool) -> Self { + PPS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS5_A { @@ -413,15 +480,22 @@ impl PPS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS5_A::VALUE1 + **self == PPS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS5_A::VALUE2 + **self == PPS5_A::VALUE2 + } +} +impl core::ops::Deref for PPS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS5`"] +#[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] pub struct PPS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS6`"] -pub type PPS6_R = crate::R; +#[doc = "Field `PPS6` reader - Port n Pin Power Save Bit 6"] +pub struct PPS6_R(crate::FieldReader); impl PPS6_R { + pub(crate) fn new(bits: bool) -> Self { + PPS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS6_A { @@ -488,15 +563,22 @@ impl PPS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS6_A::VALUE1 + **self == PPS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS6_A::VALUE2 + **self == PPS6_A::VALUE2 } } -#[doc = "Write proxy for field `PPS6`"] +impl core::ops::Deref for PPS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] pub struct PPS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS7`"] -pub type PPS7_R = crate::R; +#[doc = "Field `PPS7` reader - Port n Pin Power Save Bit 7"] +pub struct PPS7_R(crate::FieldReader); impl PPS7_R { + pub(crate) fn new(bits: bool) -> Self { + PPS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS7_A { @@ -563,15 +646,22 @@ impl PPS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS7_A::VALUE1 + **self == PPS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS7_A::VALUE2 + **self == PPS7_A::VALUE2 } } -#[doc = "Write proxy for field `PPS7`"] +impl core::ops::Deref for PPS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] pub struct PPS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS8`"] -pub type PPS8_R = crate::R; +#[doc = "Field `PPS8` reader - Port n Pin Power Save Bit 8"] +pub struct PPS8_R(crate::FieldReader); impl PPS8_R { + pub(crate) fn new(bits: bool) -> Self { + PPS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS8_A { @@ -638,15 +729,22 @@ impl PPS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS8_A::VALUE1 + **self == PPS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS8_A::VALUE2 + **self == PPS8_A::VALUE2 } } -#[doc = "Write proxy for field `PPS8`"] +impl core::ops::Deref for PPS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] pub struct PPS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS9`"] -pub type PPS9_R = crate::R; +#[doc = "Field `PPS9` reader - Port n Pin Power Save Bit 9"] +pub struct PPS9_R(crate::FieldReader); impl PPS9_R { + pub(crate) fn new(bits: bool) -> Self { + PPS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS9_A { @@ -713,15 +812,22 @@ impl PPS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS9_A::VALUE1 + **self == PPS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS9_A::VALUE2 + **self == PPS9_A::VALUE2 + } +} +impl core::ops::Deref for PPS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS9`"] +#[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] pub struct PPS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS10`"] -pub type PPS10_R = crate::R; +#[doc = "Field `PPS10` reader - Port n Pin Power Save Bit 10"] +pub struct PPS10_R(crate::FieldReader); impl PPS10_R { + pub(crate) fn new(bits: bool) -> Self { + PPS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS10_A { @@ -788,15 +895,22 @@ impl PPS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS10_A::VALUE1 + **self == PPS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS10_A::VALUE2 + **self == PPS10_A::VALUE2 } } -#[doc = "Write proxy for field `PPS10`"] +impl core::ops::Deref for PPS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] pub struct PPS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS11`"] -pub type PPS11_R = crate::R; +#[doc = "Field `PPS11` reader - Port n Pin Power Save Bit 11"] +pub struct PPS11_R(crate::FieldReader); impl PPS11_R { + pub(crate) fn new(bits: bool) -> Self { + PPS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS11_A { @@ -863,15 +978,22 @@ impl PPS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS11_A::VALUE1 + **self == PPS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS11_A::VALUE2 + **self == PPS11_A::VALUE2 } } -#[doc = "Write proxy for field `PPS11`"] +impl core::ops::Deref for PPS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] pub struct PPS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS12`"] -pub type PPS12_R = crate::R; +#[doc = "Field `PPS12` reader - Port n Pin Power Save Bit 12"] +pub struct PPS12_R(crate::FieldReader); impl PPS12_R { + pub(crate) fn new(bits: bool) -> Self { + PPS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS12_A { @@ -938,15 +1061,22 @@ impl PPS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS12_A::VALUE1 + **self == PPS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS12_A::VALUE2 + **self == PPS12_A::VALUE2 + } +} +impl core::ops::Deref for PPS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS12`"] +#[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] pub struct PPS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS13`"] -pub type PPS13_R = crate::R; +#[doc = "Field `PPS13` reader - Port n Pin Power Save Bit 13"] +pub struct PPS13_R(crate::FieldReader); impl PPS13_R { + pub(crate) fn new(bits: bool) -> Self { + PPS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS13_A { @@ -1013,15 +1144,22 @@ impl PPS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS13_A::VALUE1 + **self == PPS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS13_A::VALUE2 + **self == PPS13_A::VALUE2 } } -#[doc = "Write proxy for field `PPS13`"] +impl core::ops::Deref for PPS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] pub struct PPS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS14`"] -pub type PPS14_R = crate::R; +#[doc = "Field `PPS14` reader - Port n Pin Power Save Bit 14"] +pub struct PPS14_R(crate::FieldReader); impl PPS14_R { + pub(crate) fn new(bits: bool) -> Self { + PPS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS14_A { @@ -1088,15 +1227,22 @@ impl PPS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS14_A::VALUE1 + **self == PPS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS14_A::VALUE2 + **self == PPS14_A::VALUE2 } } -#[doc = "Write proxy for field `PPS14`"] +impl core::ops::Deref for PPS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] pub struct PPS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS15`"] -pub type PPS15_R = crate::R; +#[doc = "Field `PPS15` reader - Port n Pin Power Save Bit 15"] +pub struct PPS15_R(crate::FieldReader); impl PPS15_R { + pub(crate) fn new(bits: bool) -> Self { + PPS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS15_A { @@ -1163,15 +1310,22 @@ impl PPS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS15_A::VALUE1 + **self == PPS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS15_A::VALUE2 + **self == PPS15_A::VALUE2 } } -#[doc = "Write proxy for field `PPS15`"] +impl core::ops::Deref for PPS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] pub struct PPS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pps15(&mut self) -> PPS15_W { PPS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 14 Pin Power Save Register\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 [pps](index.html) module"] +pub struct PPS_SPEC; +impl crate::RegisterSpec for PPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pps::R](R) reader structure"] +impl crate::Readable for PPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pps::W](W) writer structure"] +impl crate::Writable for PPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PPS to value 0"] +impl crate::Resettable for PPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2.rs b/src/port2.rs index ac9b35eb..2b2e850a 100644 --- a/src/port2.rs +++ b/src/port2.rs @@ -2,158 +2,80 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Port 2 Output Register"] - pub out: OUT, + pub out: crate::Reg, #[doc = "0x04 - Port 2 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 8usize], + pub omr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x10 - Port 2 Input/Output Control Register 0"] - pub iocr0: IOCR0, + pub iocr0: crate::Reg, #[doc = "0x14 - Port 2 Input/Output Control Register 4"] - pub iocr4: IOCR4, + pub iocr4: crate::Reg, #[doc = "0x18 - Port 2 Input/Output Control Register 8"] - pub iocr8: IOCR8, + pub iocr8: crate::Reg, #[doc = "0x1c - Port 2 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 4usize], + pub iocr12: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0x24 - Port 2 Input Register"] - pub in_: IN, - _reserved7: [u8; 24usize], + pub in_: crate::Reg, + _reserved7: [u8; 0x18], #[doc = "0x40 - Port 2 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + pub pdr0: crate::Reg, #[doc = "0x44 - Port 2 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved9: [u8; 24usize], + pub pdr1: crate::Reg, + _reserved9: [u8; 0x18], #[doc = "0x60 - Port 2 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved10: [u8; 12usize], + pub pdisc: crate::Reg, + _reserved10: [u8; 0x0c], #[doc = "0x70 - Port 2 Pin Power Save Register"] - pub pps: PPS, + pub pps: crate::Reg, #[doc = "0x74 - Port 2 Pin Hardware Select Register"] - pub hwsel: HWSEL, + pub hwsel: crate::Reg, } -#[doc = "Port 2 Output Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](out) module"] -pub type OUT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUT; -#[doc = "`read()` method returns [out::R](out::R) reader structure"] -impl crate::Readable for OUT {} -#[doc = "`write(|w| ..)` method takes [out::W](out::W) writer structure"] -impl crate::Writable for OUT {} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; #[doc = "Port 2 Output Register"] pub mod out; -#[doc = "Port 2 Output Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](omr) module"] -pub type OMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OMR; -#[doc = "`write(|w| ..)` method takes [omr::W](omr::W) writer structure"] -impl crate::Writable for OMR {} +#[doc = "OMR register accessor: an alias for `Reg`"] +pub type OMR = crate::Reg; #[doc = "Port 2 Output Modification Register"] pub mod omr; -#[doc = "Port 2 Input/Output Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr0](iocr0) module"] -pub type IOCR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR0; -#[doc = "`read()` method returns [iocr0::R](iocr0::R) reader structure"] -impl crate::Readable for IOCR0 {} -#[doc = "`write(|w| ..)` method takes [iocr0::W](iocr0::W) writer structure"] -impl crate::Writable for IOCR0 {} +#[doc = "IOCR0 register accessor: an alias for `Reg`"] +pub type IOCR0 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "Port 2 Input/Output Control Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr4](iocr4) module"] -pub type IOCR4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR4; -#[doc = "`read()` method returns [iocr4::R](iocr4::R) reader structure"] -impl crate::Readable for IOCR4 {} -#[doc = "`write(|w| ..)` method takes [iocr4::W](iocr4::W) writer structure"] -impl crate::Writable for IOCR4 {} +#[doc = "IOCR4 register accessor: an alias for `Reg`"] +pub type IOCR4 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "Port 2 Input/Output Control Register 8\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr8](iocr8) module"] -pub type IOCR8 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR8; -#[doc = "`read()` method returns [iocr8::R](iocr8::R) reader structure"] -impl crate::Readable for IOCR8 {} -#[doc = "`write(|w| ..)` method takes [iocr8::W](iocr8::W) writer structure"] -impl crate::Writable for IOCR8 {} +#[doc = "IOCR8 register accessor: an alias for `Reg`"] +pub type IOCR8 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "Port 2 Input/Output Control Register 12\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr12](iocr12) module"] -pub type IOCR12 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR12; -#[doc = "`read()` method returns [iocr12::R](iocr12::R) reader structure"] -impl crate::Readable for IOCR12 {} -#[doc = "`write(|w| ..)` method takes [iocr12::W](iocr12::W) writer structure"] -impl crate::Writable for IOCR12 {} +#[doc = "IOCR12 register accessor: an alias for `Reg`"] +pub type IOCR12 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "Port 2 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`read()` method returns [in_::R](in_::R) reader structure"] -impl crate::Readable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Port 2 Input Register"] pub mod in_; -#[doc = "Port 2 Pad Driver Mode 0 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr0](pdr0) module"] -pub type PDR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR0; -#[doc = "`read()` method returns [pdr0::R](pdr0::R) reader structure"] -impl crate::Readable for PDR0 {} -#[doc = "`write(|w| ..)` method takes [pdr0::W](pdr0::W) writer structure"] -impl crate::Writable for PDR0 {} +#[doc = "PDR0 register accessor: an alias for `Reg`"] +pub type PDR0 = crate::Reg; #[doc = "Port 2 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "Port 2 Pad Driver Mode 1 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr1](pdr1) module"] -pub type PDR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR1; -#[doc = "`read()` method returns [pdr1::R](pdr1::R) reader structure"] -impl crate::Readable for PDR1 {} -#[doc = "`write(|w| ..)` method takes [pdr1::W](pdr1::W) writer structure"] -impl crate::Writable for PDR1 {} +#[doc = "PDR1 register accessor: an alias for `Reg`"] +pub type PDR1 = crate::Reg; #[doc = "Port 2 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "Port 2 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](pdisc) module"] -pub type PDISC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDISC; -#[doc = "`read()` method returns [pdisc::R](pdisc::R) reader structure"] -impl crate::Readable for PDISC {} +#[doc = "PDISC register accessor: an alias for `Reg`"] +pub type PDISC = crate::Reg; #[doc = "Port 2 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "Port 2 Pin Power Save Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pps](pps) module"] -pub type PPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PPS; -#[doc = "`read()` method returns [pps::R](pps::R) reader structure"] -impl crate::Readable for PPS {} -#[doc = "`write(|w| ..)` method takes [pps::W](pps::W) writer structure"] -impl crate::Writable for PPS {} +#[doc = "PPS register accessor: an alias for `Reg`"] +pub type PPS = crate::Reg; #[doc = "Port 2 Pin Power Save Register"] pub mod pps; -#[doc = "Port 2 Pin Hardware Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hwsel](hwsel) module"] -pub type HWSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HWSEL; -#[doc = "`read()` method returns [hwsel::R](hwsel::R) reader structure"] -impl crate::Readable for HWSEL {} -#[doc = "`write(|w| ..)` method takes [hwsel::W](hwsel::W) writer structure"] -impl crate::Writable for HWSEL {} +#[doc = "HWSEL register accessor: an alias for `Reg`"] +pub type HWSEL = crate::Reg; #[doc = "Port 2 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port2/hwsel.rs b/src/port2/hwsel.rs index 4527c6a1..d7660dc0 100644 --- a/src/port2/hwsel.rs +++ b/src/port2/hwsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HWSEL"] -pub type R = crate::R; -#[doc = "Writer for register HWSEL"] -pub type W = crate::W; -#[doc = "Register HWSEL `reset()`'s with value 0x04"] -impl crate::ResetValue for super::HWSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x04 +#[doc = "Register `HWSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HWSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW0`"] -pub type HW0_R = crate::R; +#[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] +pub struct HW0_R(crate::FieldReader); impl HW0_R { + pub(crate) fn new(bits: u8) -> Self { + HW0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW0_A::VALUE1), - 1 => Val(HW0_A::VALUE2), - 2 => Val(HW0_A::VALUE3), - i => Res(i), + 0 => Some(HW0_A::VALUE1), + 1 => Some(HW0_A::VALUE2), + 2 => Some(HW0_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW0_A::VALUE1 + **self == HW0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW0_A::VALUE2 + **self == HW0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW0_A::VALUE3 + **self == HW0_A::VALUE3 } } -#[doc = "Write proxy for field `HW0`"] +impl core::ops::Deref for HW0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] pub struct HW0_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> HW0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW1`"] -pub type HW1_R = crate::R; +#[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] +pub struct HW1_R(crate::FieldReader); impl HW1_R { + pub(crate) fn new(bits: u8) -> Self { + HW1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW1_A::VALUE1), - 1 => Val(HW1_A::VALUE2), - 2 => Val(HW1_A::VALUE3), - i => Res(i), + 0 => Some(HW1_A::VALUE1), + 1 => Some(HW1_A::VALUE2), + 2 => Some(HW1_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW1_A::VALUE1 + **self == HW1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW1_A::VALUE2 + **self == HW1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW1_A::VALUE3 + **self == HW1_A::VALUE3 + } +} +impl core::ops::Deref for HW1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW1`"] +#[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] pub struct HW1_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> HW1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW2`"] -pub type HW2_R = crate::R; +#[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] +pub struct HW2_R(crate::FieldReader); impl HW2_R { + pub(crate) fn new(bits: u8) -> Self { + HW2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW2_A::VALUE1), - 1 => Val(HW2_A::VALUE2), - 2 => Val(HW2_A::VALUE3), - i => Res(i), + 0 => Some(HW2_A::VALUE1), + 1 => Some(HW2_A::VALUE2), + 2 => Some(HW2_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW2_A::VALUE1 + **self == HW2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW2_A::VALUE2 + **self == HW2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW2_A::VALUE3 + **self == HW2_A::VALUE3 + } +} +impl core::ops::Deref for HW2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW2`"] +#[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] pub struct HW2_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> HW2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW3`"] -pub type HW3_R = crate::R; +#[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] +pub struct HW3_R(crate::FieldReader); impl HW3_R { + pub(crate) fn new(bits: u8) -> Self { + HW3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW3_A::VALUE1), - 1 => Val(HW3_A::VALUE2), - 2 => Val(HW3_A::VALUE3), - i => Res(i), + 0 => Some(HW3_A::VALUE1), + 1 => Some(HW3_A::VALUE2), + 2 => Some(HW3_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW3_A::VALUE1 + **self == HW3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW3_A::VALUE2 + **self == HW3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW3_A::VALUE3 + **self == HW3_A::VALUE3 } } -#[doc = "Write proxy for field `HW3`"] +impl core::ops::Deref for HW3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] pub struct HW3_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> HW3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -343,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW4`"] -pub type HW4_R = crate::R; +#[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] +pub struct HW4_R(crate::FieldReader); impl HW4_R { + pub(crate) fn new(bits: u8) -> Self { + HW4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW4_A::VALUE1), - 1 => Val(HW4_A::VALUE2), - 2 => Val(HW4_A::VALUE3), - i => Res(i), + 0 => Some(HW4_A::VALUE1), + 1 => Some(HW4_A::VALUE2), + 2 => Some(HW4_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW4_A::VALUE1 + **self == HW4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW4_A::VALUE2 + **self == HW4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW4_A::VALUE3 + **self == HW4_A::VALUE3 + } +} +impl core::ops::Deref for HW4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW4`"] +#[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] pub struct HW4_W<'a> { w: &'a mut W, } @@ -401,7 +470,7 @@ impl<'a> HW4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -422,37 +491,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW5`"] -pub type HW5_R = crate::R; +#[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] +pub struct HW5_R(crate::FieldReader); impl HW5_R { + pub(crate) fn new(bits: u8) -> Self { + HW5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW5_A::VALUE1), - 1 => Val(HW5_A::VALUE2), - 2 => Val(HW5_A::VALUE3), - i => Res(i), + 0 => Some(HW5_A::VALUE1), + 1 => Some(HW5_A::VALUE2), + 2 => Some(HW5_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW5_A::VALUE1 + **self == HW5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW5_A::VALUE2 + **self == HW5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW5_A::VALUE3 + **self == HW5_A::VALUE3 + } +} +impl core::ops::Deref for HW5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW5`"] +#[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] pub struct HW5_W<'a> { w: &'a mut W, } @@ -480,7 +558,7 @@ impl<'a> HW5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -501,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW6`"] -pub type HW6_R = crate::R; +#[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] +pub struct HW6_R(crate::FieldReader); impl HW6_R { + pub(crate) fn new(bits: u8) -> Self { + HW6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW6_A::VALUE1), - 1 => Val(HW6_A::VALUE2), - 2 => Val(HW6_A::VALUE3), - i => Res(i), + 0 => Some(HW6_A::VALUE1), + 1 => Some(HW6_A::VALUE2), + 2 => Some(HW6_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW6_A::VALUE1 + **self == HW6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW6_A::VALUE2 + **self == HW6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW6_A::VALUE3 + **self == HW6_A::VALUE3 } } -#[doc = "Write proxy for field `HW6`"] +impl core::ops::Deref for HW6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] pub struct HW6_W<'a> { w: &'a mut W, } @@ -559,7 +646,7 @@ impl<'a> HW6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -580,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW7`"] -pub type HW7_R = crate::R; +#[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] +pub struct HW7_R(crate::FieldReader); impl HW7_R { + pub(crate) fn new(bits: u8) -> Self { + HW7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW7_A::VALUE1), - 1 => Val(HW7_A::VALUE2), - 2 => Val(HW7_A::VALUE3), - i => Res(i), + 0 => Some(HW7_A::VALUE1), + 1 => Some(HW7_A::VALUE2), + 2 => Some(HW7_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW7_A::VALUE1 + **self == HW7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW7_A::VALUE2 + **self == HW7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW7_A::VALUE3 + **self == HW7_A::VALUE3 } } -#[doc = "Write proxy for field `HW7`"] +impl core::ops::Deref for HW7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] pub struct HW7_W<'a> { w: &'a mut W, } @@ -638,7 +734,7 @@ impl<'a> HW7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -659,37 +755,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW8`"] -pub type HW8_R = crate::R; +#[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] +pub struct HW8_R(crate::FieldReader); impl HW8_R { + pub(crate) fn new(bits: u8) -> Self { + HW8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW8_A::VALUE1), - 1 => Val(HW8_A::VALUE2), - 2 => Val(HW8_A::VALUE3), - i => Res(i), + 0 => Some(HW8_A::VALUE1), + 1 => Some(HW8_A::VALUE2), + 2 => Some(HW8_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW8_A::VALUE1 + **self == HW8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW8_A::VALUE2 + **self == HW8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW8_A::VALUE3 + **self == HW8_A::VALUE3 + } +} +impl core::ops::Deref for HW8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW8`"] +#[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] pub struct HW8_W<'a> { w: &'a mut W, } @@ -717,7 +822,7 @@ impl<'a> HW8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -738,37 +843,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW9`"] -pub type HW9_R = crate::R; +#[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] +pub struct HW9_R(crate::FieldReader); impl HW9_R { + pub(crate) fn new(bits: u8) -> Self { + HW9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW9_A::VALUE1), - 1 => Val(HW9_A::VALUE2), - 2 => Val(HW9_A::VALUE3), - i => Res(i), + 0 => Some(HW9_A::VALUE1), + 1 => Some(HW9_A::VALUE2), + 2 => Some(HW9_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW9_A::VALUE1 + **self == HW9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW9_A::VALUE2 + **self == HW9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW9_A::VALUE3 + **self == HW9_A::VALUE3 } } -#[doc = "Write proxy for field `HW9`"] +impl core::ops::Deref for HW9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] pub struct HW9_W<'a> { w: &'a mut W, } @@ -796,7 +910,7 @@ impl<'a> HW9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -817,37 +931,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW10`"] -pub type HW10_R = crate::R; +#[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] +pub struct HW10_R(crate::FieldReader); impl HW10_R { + pub(crate) fn new(bits: u8) -> Self { + HW10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW10_A::VALUE1), - 1 => Val(HW10_A::VALUE2), - 2 => Val(HW10_A::VALUE3), - i => Res(i), + 0 => Some(HW10_A::VALUE1), + 1 => Some(HW10_A::VALUE2), + 2 => Some(HW10_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW10_A::VALUE1 + **self == HW10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW10_A::VALUE2 + **self == HW10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW10_A::VALUE3 + **self == HW10_A::VALUE3 } } -#[doc = "Write proxy for field `HW10`"] +impl core::ops::Deref for HW10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] pub struct HW10_W<'a> { w: &'a mut W, } @@ -875,7 +998,7 @@ impl<'a> HW10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -896,37 +1019,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW11`"] -pub type HW11_R = crate::R; +#[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] +pub struct HW11_R(crate::FieldReader); impl HW11_R { + pub(crate) fn new(bits: u8) -> Self { + HW11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW11_A::VALUE1), - 1 => Val(HW11_A::VALUE2), - 2 => Val(HW11_A::VALUE3), - i => Res(i), + 0 => Some(HW11_A::VALUE1), + 1 => Some(HW11_A::VALUE2), + 2 => Some(HW11_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW11_A::VALUE1 + **self == HW11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW11_A::VALUE2 + **self == HW11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW11_A::VALUE3 + **self == HW11_A::VALUE3 } } -#[doc = "Write proxy for field `HW11`"] +impl core::ops::Deref for HW11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] pub struct HW11_W<'a> { w: &'a mut W, } @@ -954,7 +1086,7 @@ impl<'a> HW11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -975,37 +1107,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW12`"] -pub type HW12_R = crate::R; +#[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] +pub struct HW12_R(crate::FieldReader); impl HW12_R { + pub(crate) fn new(bits: u8) -> Self { + HW12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW12_A::VALUE1), - 1 => Val(HW12_A::VALUE2), - 2 => Val(HW12_A::VALUE3), - i => Res(i), + 0 => Some(HW12_A::VALUE1), + 1 => Some(HW12_A::VALUE2), + 2 => Some(HW12_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW12_A::VALUE1 + **self == HW12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW12_A::VALUE2 + **self == HW12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW12_A::VALUE3 + **self == HW12_A::VALUE3 + } +} +impl core::ops::Deref for HW12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW12`"] +#[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] pub struct HW12_W<'a> { w: &'a mut W, } @@ -1033,7 +1174,7 @@ impl<'a> HW12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1054,37 +1195,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW13`"] -pub type HW13_R = crate::R; +#[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] +pub struct HW13_R(crate::FieldReader); impl HW13_R { + pub(crate) fn new(bits: u8) -> Self { + HW13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW13_A::VALUE1), - 1 => Val(HW13_A::VALUE2), - 2 => Val(HW13_A::VALUE3), - i => Res(i), + 0 => Some(HW13_A::VALUE1), + 1 => Some(HW13_A::VALUE2), + 2 => Some(HW13_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW13_A::VALUE1 + **self == HW13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW13_A::VALUE2 + **self == HW13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW13_A::VALUE3 + **self == HW13_A::VALUE3 + } +} +impl core::ops::Deref for HW13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW13`"] +#[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] pub struct HW13_W<'a> { w: &'a mut W, } @@ -1112,7 +1262,7 @@ impl<'a> HW13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -1133,37 +1283,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW14`"] -pub type HW14_R = crate::R; +#[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] +pub struct HW14_R(crate::FieldReader); impl HW14_R { + pub(crate) fn new(bits: u8) -> Self { + HW14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW14_A::VALUE1), - 1 => Val(HW14_A::VALUE2), - 2 => Val(HW14_A::VALUE3), - i => Res(i), + 0 => Some(HW14_A::VALUE1), + 1 => Some(HW14_A::VALUE2), + 2 => Some(HW14_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW14_A::VALUE1 + **self == HW14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW14_A::VALUE2 + **self == HW14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW14_A::VALUE3 + **self == HW14_A::VALUE3 } } -#[doc = "Write proxy for field `HW14`"] +impl core::ops::Deref for HW14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] pub struct HW14_W<'a> { w: &'a mut W, } @@ -1191,7 +1350,7 @@ impl<'a> HW14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1212,37 +1371,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW15`"] -pub type HW15_R = crate::R; +#[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] +pub struct HW15_R(crate::FieldReader); impl HW15_R { + pub(crate) fn new(bits: u8) -> Self { + HW15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW15_A::VALUE1), - 1 => Val(HW15_A::VALUE2), - 2 => Val(HW15_A::VALUE3), - i => Res(i), + 0 => Some(HW15_A::VALUE1), + 1 => Some(HW15_A::VALUE2), + 2 => Some(HW15_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW15_A::VALUE1 + **self == HW15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW15_A::VALUE2 + **self == HW15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW15_A::VALUE3 + **self == HW15_A::VALUE3 } } -#[doc = "Write proxy for field `HW15`"] +impl core::ops::Deref for HW15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] pub struct HW15_W<'a> { w: &'a mut W, } @@ -1270,7 +1438,7 @@ impl<'a> HW15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -1437,4 +1605,30 @@ impl W { pub fn hw15(&mut self) -> HW15_W { HW15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Pin Hardware Select Register\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 [hwsel](index.html) module"] +pub struct HWSEL_SPEC; +impl crate::RegisterSpec for HWSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hwsel::R](R) reader structure"] +impl crate::Readable for HWSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hwsel::W](W) writer structure"] +impl crate::Writable for HWSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HWSEL to value 0x04"] +impl crate::Resettable for HWSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } } diff --git a/src/port2/in_.rs b/src/port2/in_.rs index 344607dc..9486e897 100644 --- a/src/port2/in_.rs +++ b/src/port2/in_.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register IN"] -pub type R = crate::R; +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum P0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Input Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -28,12 +44,19 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 + } +} +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Input Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -64,12 +90,19 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 + } +} +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Input Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -100,12 +136,19 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Input Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -136,12 +182,19 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Input Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -172,12 +228,19 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Input Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -208,12 +274,19 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Input Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -244,12 +320,19 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 + } +} +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Input Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -280,12 +366,19 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 + } +} +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Input Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -316,12 +412,19 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 + } +} +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Input Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -352,12 +458,19 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Input Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -388,12 +504,19 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 + } +} +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Input Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -424,12 +550,19 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 + } +} +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Input Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -460,12 +596,19 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Input Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -496,12 +642,19 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 + } +} +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Input Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -532,12 +688,19 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 + } +} +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Input Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -568,12 +734,19 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 + } +} +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { P15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 2 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port2/iocr0.rs b/src/port2/iocr0.rs index ea51a257..eb004e93 100644 --- a/src/port2/iocr0.rs +++ b/src/port2/iocr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR0"] -pub type R = crate::R; -#[doc = "Writer for register IOCR0"] -pub type W = crate::W; -#[doc = "Register IOCR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC0`"] -pub type PC0_R = crate::R; +#[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC0_R(crate::FieldReader); impl PC0_R { + pub(crate) fn new(bits: u8) -> Self { + PC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC0_A::VALUE1), - 1 => Val(PC0_A::VALUE2), - 2 => Val(PC0_A::VALUE3), - 3 => Val(PC0_A::VALUE4), - 4 => Val(PC0_A::VALUE5), - 5 => Val(PC0_A::VALUE6), - 6 => Val(PC0_A::VALUE7), - 7 => Val(PC0_A::VALUE8), - 16 => Val(PC0_A::VALUE9), - 17 => Val(PC0_A::VALUE10), - 18 => Val(PC0_A::VALUE11), - 19 => Val(PC0_A::VALUE12), - 20 => Val(PC0_A::VALUE13), - 24 => Val(PC0_A::VALUE14), - 25 => Val(PC0_A::VALUE15), - 26 => Val(PC0_A::VALUE16), - 27 => Val(PC0_A::VALUE17), - 28 => Val(PC0_A::VALUE18), - i => Res(i), + 0 => Some(PC0_A::VALUE1), + 1 => Some(PC0_A::VALUE2), + 2 => Some(PC0_A::VALUE3), + 3 => Some(PC0_A::VALUE4), + 4 => Some(PC0_A::VALUE5), + 5 => Some(PC0_A::VALUE6), + 6 => Some(PC0_A::VALUE7), + 7 => Some(PC0_A::VALUE8), + 16 => Some(PC0_A::VALUE9), + 17 => Some(PC0_A::VALUE10), + 18 => Some(PC0_A::VALUE11), + 19 => Some(PC0_A::VALUE12), + 20 => Some(PC0_A::VALUE13), + 24 => Some(PC0_A::VALUE14), + 25 => Some(PC0_A::VALUE15), + 26 => Some(PC0_A::VALUE16), + 27 => Some(PC0_A::VALUE17), + 28 => Some(PC0_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC0_A::VALUE1 + **self == PC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC0_A::VALUE2 + **self == PC0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC0_A::VALUE3 + **self == PC0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC0_A::VALUE4 + **self == PC0_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC0_A::VALUE5 + **self == PC0_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC0_A::VALUE6 + **self == PC0_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC0_A::VALUE7 + **self == PC0_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC0_A::VALUE8 + **self == PC0_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC0_A::VALUE9 + **self == PC0_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC0_A::VALUE10 + **self == PC0_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC0_A::VALUE11 + **self == PC0_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC0_A::VALUE12 + **self == PC0_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC0_A::VALUE13 + **self == PC0_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC0_A::VALUE14 + **self == PC0_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC0_A::VALUE15 + **self == PC0_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC0_A::VALUE16 + **self == PC0_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC0_A::VALUE17 + **self == PC0_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC0_A::VALUE18 + **self == PC0_A::VALUE18 } } -#[doc = "Write proxy for field `PC0`"] +impl core::ops::Deref for PC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] pub struct PC0_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC1`"] -pub type PC1_R = crate::R; +#[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC1_R(crate::FieldReader); impl PC1_R { + pub(crate) fn new(bits: u8) -> Self { + PC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC1_A::VALUE1), - 1 => Val(PC1_A::VALUE2), - 2 => Val(PC1_A::VALUE3), - 3 => Val(PC1_A::VALUE4), - 4 => Val(PC1_A::VALUE5), - 5 => Val(PC1_A::VALUE6), - 6 => Val(PC1_A::VALUE7), - 7 => Val(PC1_A::VALUE8), - 16 => Val(PC1_A::VALUE9), - 17 => Val(PC1_A::VALUE10), - 18 => Val(PC1_A::VALUE11), - 19 => Val(PC1_A::VALUE12), - 20 => Val(PC1_A::VALUE13), - 24 => Val(PC1_A::VALUE14), - 25 => Val(PC1_A::VALUE15), - 26 => Val(PC1_A::VALUE16), - 27 => Val(PC1_A::VALUE17), - 28 => Val(PC1_A::VALUE18), - i => Res(i), + 0 => Some(PC1_A::VALUE1), + 1 => Some(PC1_A::VALUE2), + 2 => Some(PC1_A::VALUE3), + 3 => Some(PC1_A::VALUE4), + 4 => Some(PC1_A::VALUE5), + 5 => Some(PC1_A::VALUE6), + 6 => Some(PC1_A::VALUE7), + 7 => Some(PC1_A::VALUE8), + 16 => Some(PC1_A::VALUE9), + 17 => Some(PC1_A::VALUE10), + 18 => Some(PC1_A::VALUE11), + 19 => Some(PC1_A::VALUE12), + 20 => Some(PC1_A::VALUE13), + 24 => Some(PC1_A::VALUE14), + 25 => Some(PC1_A::VALUE15), + 26 => Some(PC1_A::VALUE16), + 27 => Some(PC1_A::VALUE17), + 28 => Some(PC1_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC1_A::VALUE1 + **self == PC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC1_A::VALUE2 + **self == PC1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC1_A::VALUE3 + **self == PC1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC1_A::VALUE4 + **self == PC1_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC1_A::VALUE5 + **self == PC1_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC1_A::VALUE6 + **self == PC1_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC1_A::VALUE7 + **self == PC1_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC1_A::VALUE8 + **self == PC1_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC1_A::VALUE9 + **self == PC1_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC1_A::VALUE10 + **self == PC1_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC1_A::VALUE11 + **self == PC1_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC1_A::VALUE12 + **self == PC1_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC1_A::VALUE13 + **self == PC1_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC1_A::VALUE14 + **self == PC1_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC1_A::VALUE15 + **self == PC1_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC1_A::VALUE16 + **self == PC1_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC1_A::VALUE17 + **self == PC1_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC1_A::VALUE18 + **self == PC1_A::VALUE18 } } -#[doc = "Write proxy for field `PC1`"] +impl core::ops::Deref for PC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] pub struct PC1_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC2`"] -pub type PC2_R = crate::R; +#[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC2_R(crate::FieldReader); impl PC2_R { + pub(crate) fn new(bits: u8) -> Self { + PC2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC2_A::VALUE1), - 1 => Val(PC2_A::VALUE2), - 2 => Val(PC2_A::VALUE3), - 3 => Val(PC2_A::VALUE4), - 4 => Val(PC2_A::VALUE5), - 5 => Val(PC2_A::VALUE6), - 6 => Val(PC2_A::VALUE7), - 7 => Val(PC2_A::VALUE8), - 16 => Val(PC2_A::VALUE9), - 17 => Val(PC2_A::VALUE10), - 18 => Val(PC2_A::VALUE11), - 19 => Val(PC2_A::VALUE12), - 20 => Val(PC2_A::VALUE13), - 24 => Val(PC2_A::VALUE14), - 25 => Val(PC2_A::VALUE15), - 26 => Val(PC2_A::VALUE16), - 27 => Val(PC2_A::VALUE17), - 28 => Val(PC2_A::VALUE18), - i => Res(i), + 0 => Some(PC2_A::VALUE1), + 1 => Some(PC2_A::VALUE2), + 2 => Some(PC2_A::VALUE3), + 3 => Some(PC2_A::VALUE4), + 4 => Some(PC2_A::VALUE5), + 5 => Some(PC2_A::VALUE6), + 6 => Some(PC2_A::VALUE7), + 7 => Some(PC2_A::VALUE8), + 16 => Some(PC2_A::VALUE9), + 17 => Some(PC2_A::VALUE10), + 18 => Some(PC2_A::VALUE11), + 19 => Some(PC2_A::VALUE12), + 20 => Some(PC2_A::VALUE13), + 24 => Some(PC2_A::VALUE14), + 25 => Some(PC2_A::VALUE15), + 26 => Some(PC2_A::VALUE16), + 27 => Some(PC2_A::VALUE17), + 28 => Some(PC2_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC2_A::VALUE1 + **self == PC2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC2_A::VALUE2 + **self == PC2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC2_A::VALUE3 + **self == PC2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC2_A::VALUE4 + **self == PC2_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC2_A::VALUE5 + **self == PC2_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC2_A::VALUE6 + **self == PC2_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC2_A::VALUE7 + **self == PC2_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC2_A::VALUE8 + **self == PC2_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC2_A::VALUE9 + **self == PC2_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC2_A::VALUE10 + **self == PC2_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC2_A::VALUE11 + **self == PC2_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC2_A::VALUE12 + **self == PC2_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC2_A::VALUE13 + **self == PC2_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC2_A::VALUE14 + **self == PC2_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC2_A::VALUE15 + **self == PC2_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC2_A::VALUE16 + **self == PC2_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC2_A::VALUE17 + **self == PC2_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC2_A::VALUE18 + **self == PC2_A::VALUE18 + } +} +impl core::ops::Deref for PC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC2`"] +#[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] pub struct PC2_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC3`"] -pub type PC3_R = crate::R; +#[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC3_R(crate::FieldReader); impl PC3_R { + pub(crate) fn new(bits: u8) -> Self { + PC3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC3_A::VALUE1), - 1 => Val(PC3_A::VALUE2), - 2 => Val(PC3_A::VALUE3), - 3 => Val(PC3_A::VALUE4), - 4 => Val(PC3_A::VALUE5), - 5 => Val(PC3_A::VALUE6), - 6 => Val(PC3_A::VALUE7), - 7 => Val(PC3_A::VALUE8), - 16 => Val(PC3_A::VALUE9), - 17 => Val(PC3_A::VALUE10), - 18 => Val(PC3_A::VALUE11), - 19 => Val(PC3_A::VALUE12), - 20 => Val(PC3_A::VALUE13), - 24 => Val(PC3_A::VALUE14), - 25 => Val(PC3_A::VALUE15), - 26 => Val(PC3_A::VALUE16), - 27 => Val(PC3_A::VALUE17), - 28 => Val(PC3_A::VALUE18), - i => Res(i), + 0 => Some(PC3_A::VALUE1), + 1 => Some(PC3_A::VALUE2), + 2 => Some(PC3_A::VALUE3), + 3 => Some(PC3_A::VALUE4), + 4 => Some(PC3_A::VALUE5), + 5 => Some(PC3_A::VALUE6), + 6 => Some(PC3_A::VALUE7), + 7 => Some(PC3_A::VALUE8), + 16 => Some(PC3_A::VALUE9), + 17 => Some(PC3_A::VALUE10), + 18 => Some(PC3_A::VALUE11), + 19 => Some(PC3_A::VALUE12), + 20 => Some(PC3_A::VALUE13), + 24 => Some(PC3_A::VALUE14), + 25 => Some(PC3_A::VALUE15), + 26 => Some(PC3_A::VALUE16), + 27 => Some(PC3_A::VALUE17), + 28 => Some(PC3_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC3_A::VALUE1 + **self == PC3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC3_A::VALUE2 + **self == PC3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC3_A::VALUE3 + **self == PC3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC3_A::VALUE4 + **self == PC3_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC3_A::VALUE5 + **self == PC3_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC3_A::VALUE6 + **self == PC3_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC3_A::VALUE7 + **self == PC3_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC3_A::VALUE8 + **self == PC3_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC3_A::VALUE9 + **self == PC3_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC3_A::VALUE10 + **self == PC3_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC3_A::VALUE11 + **self == PC3_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC3_A::VALUE12 + **self == PC3_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC3_A::VALUE13 + **self == PC3_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC3_A::VALUE14 + **self == PC3_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC3_A::VALUE15 + **self == PC3_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC3_A::VALUE16 + **self == PC3_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC3_A::VALUE17 + **self == PC3_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC3_A::VALUE18 + **self == PC3_A::VALUE18 + } +} +impl core::ops::Deref for PC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC3`"] +#[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] pub struct PC3_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc3(&mut self) -> PC3_W { PC3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Input/Output Control Register 0\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 [iocr0](index.html) module"] +pub struct IOCR0_SPEC; +impl crate::RegisterSpec for IOCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr0::R](R) reader structure"] +impl crate::Readable for IOCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr0::W](W) writer structure"] +impl crate::Writable for IOCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR0 to value 0"] +impl crate::Resettable for IOCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/iocr12.rs b/src/port2/iocr12.rs index b1edc33d..9a96a259 100644 --- a/src/port2/iocr12.rs +++ b/src/port2/iocr12.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR12"] -pub type R = crate::R; -#[doc = "Writer for register IOCR12"] -pub type W = crate::W; -#[doc = "Register IOCR12 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR12 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR12` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR12` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC12`"] -pub type PC12_R = crate::R; +#[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC12_R(crate::FieldReader); impl PC12_R { + pub(crate) fn new(bits: u8) -> Self { + PC12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC12_A::VALUE1), - 1 => Val(PC12_A::VALUE2), - 2 => Val(PC12_A::VALUE3), - 3 => Val(PC12_A::VALUE4), - 4 => Val(PC12_A::VALUE5), - 5 => Val(PC12_A::VALUE6), - 6 => Val(PC12_A::VALUE7), - 7 => Val(PC12_A::VALUE8), - 16 => Val(PC12_A::VALUE9), - 17 => Val(PC12_A::VALUE10), - 18 => Val(PC12_A::VALUE11), - 19 => Val(PC12_A::VALUE12), - 20 => Val(PC12_A::VALUE13), - 24 => Val(PC12_A::VALUE14), - 25 => Val(PC12_A::VALUE15), - 26 => Val(PC12_A::VALUE16), - 27 => Val(PC12_A::VALUE17), - 28 => Val(PC12_A::VALUE18), - i => Res(i), + 0 => Some(PC12_A::VALUE1), + 1 => Some(PC12_A::VALUE2), + 2 => Some(PC12_A::VALUE3), + 3 => Some(PC12_A::VALUE4), + 4 => Some(PC12_A::VALUE5), + 5 => Some(PC12_A::VALUE6), + 6 => Some(PC12_A::VALUE7), + 7 => Some(PC12_A::VALUE8), + 16 => Some(PC12_A::VALUE9), + 17 => Some(PC12_A::VALUE10), + 18 => Some(PC12_A::VALUE11), + 19 => Some(PC12_A::VALUE12), + 20 => Some(PC12_A::VALUE13), + 24 => Some(PC12_A::VALUE14), + 25 => Some(PC12_A::VALUE15), + 26 => Some(PC12_A::VALUE16), + 27 => Some(PC12_A::VALUE17), + 28 => Some(PC12_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC12_A::VALUE1 + **self == PC12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC12_A::VALUE2 + **self == PC12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC12_A::VALUE3 + **self == PC12_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC12_A::VALUE4 + **self == PC12_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC12_A::VALUE5 + **self == PC12_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC12_A::VALUE6 + **self == PC12_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC12_A::VALUE7 + **self == PC12_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC12_A::VALUE8 + **self == PC12_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC12_A::VALUE9 + **self == PC12_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC12_A::VALUE10 + **self == PC12_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC12_A::VALUE11 + **self == PC12_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC12_A::VALUE12 + **self == PC12_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC12_A::VALUE13 + **self == PC12_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC12_A::VALUE14 + **self == PC12_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC12_A::VALUE15 + **self == PC12_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC12_A::VALUE16 + **self == PC12_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC12_A::VALUE17 + **self == PC12_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC12_A::VALUE18 + **self == PC12_A::VALUE18 } } -#[doc = "Write proxy for field `PC12`"] +impl core::ops::Deref for PC12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] pub struct PC12_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC13`"] -pub type PC13_R = crate::R; +#[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC13_R(crate::FieldReader); impl PC13_R { + pub(crate) fn new(bits: u8) -> Self { + PC13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC13_A::VALUE1), - 1 => Val(PC13_A::VALUE2), - 2 => Val(PC13_A::VALUE3), - 3 => Val(PC13_A::VALUE4), - 4 => Val(PC13_A::VALUE5), - 5 => Val(PC13_A::VALUE6), - 6 => Val(PC13_A::VALUE7), - 7 => Val(PC13_A::VALUE8), - 16 => Val(PC13_A::VALUE9), - 17 => Val(PC13_A::VALUE10), - 18 => Val(PC13_A::VALUE11), - 19 => Val(PC13_A::VALUE12), - 20 => Val(PC13_A::VALUE13), - 24 => Val(PC13_A::VALUE14), - 25 => Val(PC13_A::VALUE15), - 26 => Val(PC13_A::VALUE16), - 27 => Val(PC13_A::VALUE17), - 28 => Val(PC13_A::VALUE18), - i => Res(i), + 0 => Some(PC13_A::VALUE1), + 1 => Some(PC13_A::VALUE2), + 2 => Some(PC13_A::VALUE3), + 3 => Some(PC13_A::VALUE4), + 4 => Some(PC13_A::VALUE5), + 5 => Some(PC13_A::VALUE6), + 6 => Some(PC13_A::VALUE7), + 7 => Some(PC13_A::VALUE8), + 16 => Some(PC13_A::VALUE9), + 17 => Some(PC13_A::VALUE10), + 18 => Some(PC13_A::VALUE11), + 19 => Some(PC13_A::VALUE12), + 20 => Some(PC13_A::VALUE13), + 24 => Some(PC13_A::VALUE14), + 25 => Some(PC13_A::VALUE15), + 26 => Some(PC13_A::VALUE16), + 27 => Some(PC13_A::VALUE17), + 28 => Some(PC13_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC13_A::VALUE1 + **self == PC13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC13_A::VALUE2 + **self == PC13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC13_A::VALUE3 + **self == PC13_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC13_A::VALUE4 + **self == PC13_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC13_A::VALUE5 + **self == PC13_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC13_A::VALUE6 + **self == PC13_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC13_A::VALUE7 + **self == PC13_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC13_A::VALUE8 + **self == PC13_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC13_A::VALUE9 + **self == PC13_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC13_A::VALUE10 + **self == PC13_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC13_A::VALUE11 + **self == PC13_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC13_A::VALUE12 + **self == PC13_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC13_A::VALUE13 + **self == PC13_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC13_A::VALUE14 + **self == PC13_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC13_A::VALUE15 + **self == PC13_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC13_A::VALUE16 + **self == PC13_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC13_A::VALUE17 + **self == PC13_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC13_A::VALUE18 + **self == PC13_A::VALUE18 } } -#[doc = "Write proxy for field `PC13`"] +impl core::ops::Deref for PC13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] pub struct PC13_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC14`"] -pub type PC14_R = crate::R; +#[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC14_R(crate::FieldReader); impl PC14_R { + pub(crate) fn new(bits: u8) -> Self { + PC14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC14_A::VALUE1), - 1 => Val(PC14_A::VALUE2), - 2 => Val(PC14_A::VALUE3), - 3 => Val(PC14_A::VALUE4), - 4 => Val(PC14_A::VALUE5), - 5 => Val(PC14_A::VALUE6), - 6 => Val(PC14_A::VALUE7), - 7 => Val(PC14_A::VALUE8), - 16 => Val(PC14_A::VALUE9), - 17 => Val(PC14_A::VALUE10), - 18 => Val(PC14_A::VALUE11), - 19 => Val(PC14_A::VALUE12), - 20 => Val(PC14_A::VALUE13), - 24 => Val(PC14_A::VALUE14), - 25 => Val(PC14_A::VALUE15), - 26 => Val(PC14_A::VALUE16), - 27 => Val(PC14_A::VALUE17), - 28 => Val(PC14_A::VALUE18), - i => Res(i), + 0 => Some(PC14_A::VALUE1), + 1 => Some(PC14_A::VALUE2), + 2 => Some(PC14_A::VALUE3), + 3 => Some(PC14_A::VALUE4), + 4 => Some(PC14_A::VALUE5), + 5 => Some(PC14_A::VALUE6), + 6 => Some(PC14_A::VALUE7), + 7 => Some(PC14_A::VALUE8), + 16 => Some(PC14_A::VALUE9), + 17 => Some(PC14_A::VALUE10), + 18 => Some(PC14_A::VALUE11), + 19 => Some(PC14_A::VALUE12), + 20 => Some(PC14_A::VALUE13), + 24 => Some(PC14_A::VALUE14), + 25 => Some(PC14_A::VALUE15), + 26 => Some(PC14_A::VALUE16), + 27 => Some(PC14_A::VALUE17), + 28 => Some(PC14_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC14_A::VALUE1 + **self == PC14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC14_A::VALUE2 + **self == PC14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC14_A::VALUE3 + **self == PC14_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC14_A::VALUE4 + **self == PC14_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC14_A::VALUE5 + **self == PC14_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC14_A::VALUE6 + **self == PC14_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC14_A::VALUE7 + **self == PC14_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC14_A::VALUE8 + **self == PC14_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC14_A::VALUE9 + **self == PC14_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC14_A::VALUE10 + **self == PC14_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC14_A::VALUE11 + **self == PC14_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC14_A::VALUE12 + **self == PC14_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC14_A::VALUE13 + **self == PC14_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC14_A::VALUE14 + **self == PC14_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC14_A::VALUE15 + **self == PC14_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC14_A::VALUE16 + **self == PC14_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC14_A::VALUE17 + **self == PC14_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC14_A::VALUE18 + **self == PC14_A::VALUE18 + } +} +impl core::ops::Deref for PC14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC14`"] +#[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] pub struct PC14_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC15`"] -pub type PC15_R = crate::R; +#[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] +pub struct PC15_R(crate::FieldReader); impl PC15_R { + pub(crate) fn new(bits: u8) -> Self { + PC15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC15_A::VALUE1), - 1 => Val(PC15_A::VALUE2), - 2 => Val(PC15_A::VALUE3), - 3 => Val(PC15_A::VALUE4), - 4 => Val(PC15_A::VALUE5), - 5 => Val(PC15_A::VALUE6), - 6 => Val(PC15_A::VALUE7), - 7 => Val(PC15_A::VALUE8), - 16 => Val(PC15_A::VALUE9), - 17 => Val(PC15_A::VALUE10), - 18 => Val(PC15_A::VALUE11), - 19 => Val(PC15_A::VALUE12), - 20 => Val(PC15_A::VALUE13), - 24 => Val(PC15_A::VALUE14), - 25 => Val(PC15_A::VALUE15), - 26 => Val(PC15_A::VALUE16), - 27 => Val(PC15_A::VALUE17), - 28 => Val(PC15_A::VALUE18), - i => Res(i), + 0 => Some(PC15_A::VALUE1), + 1 => Some(PC15_A::VALUE2), + 2 => Some(PC15_A::VALUE3), + 3 => Some(PC15_A::VALUE4), + 4 => Some(PC15_A::VALUE5), + 5 => Some(PC15_A::VALUE6), + 6 => Some(PC15_A::VALUE7), + 7 => Some(PC15_A::VALUE8), + 16 => Some(PC15_A::VALUE9), + 17 => Some(PC15_A::VALUE10), + 18 => Some(PC15_A::VALUE11), + 19 => Some(PC15_A::VALUE12), + 20 => Some(PC15_A::VALUE13), + 24 => Some(PC15_A::VALUE14), + 25 => Some(PC15_A::VALUE15), + 26 => Some(PC15_A::VALUE16), + 27 => Some(PC15_A::VALUE17), + 28 => Some(PC15_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC15_A::VALUE1 + **self == PC15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC15_A::VALUE2 + **self == PC15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC15_A::VALUE3 + **self == PC15_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC15_A::VALUE4 + **self == PC15_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC15_A::VALUE5 + **self == PC15_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC15_A::VALUE6 + **self == PC15_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC15_A::VALUE7 + **self == PC15_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC15_A::VALUE8 + **self == PC15_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC15_A::VALUE9 + **self == PC15_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC15_A::VALUE10 + **self == PC15_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC15_A::VALUE11 + **self == PC15_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC15_A::VALUE12 + **self == PC15_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC15_A::VALUE13 + **self == PC15_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC15_A::VALUE14 + **self == PC15_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC15_A::VALUE15 + **self == PC15_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC15_A::VALUE16 + **self == PC15_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC15_A::VALUE17 + **self == PC15_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC15_A::VALUE18 + **self == PC15_A::VALUE18 + } +} +impl core::ops::Deref for PC15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC15`"] +#[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] pub struct PC15_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc15(&mut self) -> PC15_W { PC15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Input/Output Control Register 12\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 [iocr12](index.html) module"] +pub struct IOCR12_SPEC; +impl crate::RegisterSpec for IOCR12_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr12::R](R) reader structure"] +impl crate::Readable for IOCR12_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr12::W](W) writer structure"] +impl crate::Writable for IOCR12_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR12 to value 0"] +impl crate::Resettable for IOCR12_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/iocr4.rs b/src/port2/iocr4.rs index d884a743..2a61e4ea 100644 --- a/src/port2/iocr4.rs +++ b/src/port2/iocr4.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR4"] -pub type R = crate::R; -#[doc = "Writer for register IOCR4"] -pub type W = crate::W; -#[doc = "Register IOCR4 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR4 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC4`"] -pub type PC4_R = crate::R; +#[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC4_R(crate::FieldReader); impl PC4_R { + pub(crate) fn new(bits: u8) -> Self { + PC4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC4_A::VALUE1), - 1 => Val(PC4_A::VALUE2), - 2 => Val(PC4_A::VALUE3), - 3 => Val(PC4_A::VALUE4), - 4 => Val(PC4_A::VALUE5), - 5 => Val(PC4_A::VALUE6), - 6 => Val(PC4_A::VALUE7), - 7 => Val(PC4_A::VALUE8), - 16 => Val(PC4_A::VALUE9), - 17 => Val(PC4_A::VALUE10), - 18 => Val(PC4_A::VALUE11), - 19 => Val(PC4_A::VALUE12), - 20 => Val(PC4_A::VALUE13), - 24 => Val(PC4_A::VALUE14), - 25 => Val(PC4_A::VALUE15), - 26 => Val(PC4_A::VALUE16), - 27 => Val(PC4_A::VALUE17), - 28 => Val(PC4_A::VALUE18), - i => Res(i), + 0 => Some(PC4_A::VALUE1), + 1 => Some(PC4_A::VALUE2), + 2 => Some(PC4_A::VALUE3), + 3 => Some(PC4_A::VALUE4), + 4 => Some(PC4_A::VALUE5), + 5 => Some(PC4_A::VALUE6), + 6 => Some(PC4_A::VALUE7), + 7 => Some(PC4_A::VALUE8), + 16 => Some(PC4_A::VALUE9), + 17 => Some(PC4_A::VALUE10), + 18 => Some(PC4_A::VALUE11), + 19 => Some(PC4_A::VALUE12), + 20 => Some(PC4_A::VALUE13), + 24 => Some(PC4_A::VALUE14), + 25 => Some(PC4_A::VALUE15), + 26 => Some(PC4_A::VALUE16), + 27 => Some(PC4_A::VALUE17), + 28 => Some(PC4_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC4_A::VALUE1 + **self == PC4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC4_A::VALUE2 + **self == PC4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC4_A::VALUE3 + **self == PC4_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC4_A::VALUE4 + **self == PC4_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC4_A::VALUE5 + **self == PC4_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC4_A::VALUE6 + **self == PC4_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC4_A::VALUE7 + **self == PC4_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC4_A::VALUE8 + **self == PC4_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC4_A::VALUE9 + **self == PC4_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC4_A::VALUE10 + **self == PC4_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC4_A::VALUE11 + **self == PC4_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC4_A::VALUE12 + **self == PC4_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC4_A::VALUE13 + **self == PC4_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC4_A::VALUE14 + **self == PC4_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC4_A::VALUE15 + **self == PC4_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC4_A::VALUE16 + **self == PC4_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC4_A::VALUE17 + **self == PC4_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC4_A::VALUE18 + **self == PC4_A::VALUE18 } } -#[doc = "Write proxy for field `PC4`"] +impl core::ops::Deref for PC4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] pub struct PC4_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC5`"] -pub type PC5_R = crate::R; +#[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC5_R(crate::FieldReader); impl PC5_R { + pub(crate) fn new(bits: u8) -> Self { + PC5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC5_A::VALUE1), - 1 => Val(PC5_A::VALUE2), - 2 => Val(PC5_A::VALUE3), - 3 => Val(PC5_A::VALUE4), - 4 => Val(PC5_A::VALUE5), - 5 => Val(PC5_A::VALUE6), - 6 => Val(PC5_A::VALUE7), - 7 => Val(PC5_A::VALUE8), - 16 => Val(PC5_A::VALUE9), - 17 => Val(PC5_A::VALUE10), - 18 => Val(PC5_A::VALUE11), - 19 => Val(PC5_A::VALUE12), - 20 => Val(PC5_A::VALUE13), - 24 => Val(PC5_A::VALUE14), - 25 => Val(PC5_A::VALUE15), - 26 => Val(PC5_A::VALUE16), - 27 => Val(PC5_A::VALUE17), - 28 => Val(PC5_A::VALUE18), - i => Res(i), + 0 => Some(PC5_A::VALUE1), + 1 => Some(PC5_A::VALUE2), + 2 => Some(PC5_A::VALUE3), + 3 => Some(PC5_A::VALUE4), + 4 => Some(PC5_A::VALUE5), + 5 => Some(PC5_A::VALUE6), + 6 => Some(PC5_A::VALUE7), + 7 => Some(PC5_A::VALUE8), + 16 => Some(PC5_A::VALUE9), + 17 => Some(PC5_A::VALUE10), + 18 => Some(PC5_A::VALUE11), + 19 => Some(PC5_A::VALUE12), + 20 => Some(PC5_A::VALUE13), + 24 => Some(PC5_A::VALUE14), + 25 => Some(PC5_A::VALUE15), + 26 => Some(PC5_A::VALUE16), + 27 => Some(PC5_A::VALUE17), + 28 => Some(PC5_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC5_A::VALUE1 + **self == PC5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC5_A::VALUE2 + **self == PC5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC5_A::VALUE3 + **self == PC5_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC5_A::VALUE4 + **self == PC5_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC5_A::VALUE5 + **self == PC5_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC5_A::VALUE6 + **self == PC5_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC5_A::VALUE7 + **self == PC5_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC5_A::VALUE8 + **self == PC5_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC5_A::VALUE9 + **self == PC5_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC5_A::VALUE10 + **self == PC5_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC5_A::VALUE11 + **self == PC5_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC5_A::VALUE12 + **self == PC5_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC5_A::VALUE13 + **self == PC5_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC5_A::VALUE14 + **self == PC5_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC5_A::VALUE15 + **self == PC5_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC5_A::VALUE16 + **self == PC5_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC5_A::VALUE17 + **self == PC5_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC5_A::VALUE18 + **self == PC5_A::VALUE18 } } -#[doc = "Write proxy for field `PC5`"] +impl core::ops::Deref for PC5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] pub struct PC5_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC6`"] -pub type PC6_R = crate::R; +#[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC6_R(crate::FieldReader); impl PC6_R { + pub(crate) fn new(bits: u8) -> Self { + PC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC6_A::VALUE1), - 1 => Val(PC6_A::VALUE2), - 2 => Val(PC6_A::VALUE3), - 3 => Val(PC6_A::VALUE4), - 4 => Val(PC6_A::VALUE5), - 5 => Val(PC6_A::VALUE6), - 6 => Val(PC6_A::VALUE7), - 7 => Val(PC6_A::VALUE8), - 16 => Val(PC6_A::VALUE9), - 17 => Val(PC6_A::VALUE10), - 18 => Val(PC6_A::VALUE11), - 19 => Val(PC6_A::VALUE12), - 20 => Val(PC6_A::VALUE13), - 24 => Val(PC6_A::VALUE14), - 25 => Val(PC6_A::VALUE15), - 26 => Val(PC6_A::VALUE16), - 27 => Val(PC6_A::VALUE17), - 28 => Val(PC6_A::VALUE18), - i => Res(i), + 0 => Some(PC6_A::VALUE1), + 1 => Some(PC6_A::VALUE2), + 2 => Some(PC6_A::VALUE3), + 3 => Some(PC6_A::VALUE4), + 4 => Some(PC6_A::VALUE5), + 5 => Some(PC6_A::VALUE6), + 6 => Some(PC6_A::VALUE7), + 7 => Some(PC6_A::VALUE8), + 16 => Some(PC6_A::VALUE9), + 17 => Some(PC6_A::VALUE10), + 18 => Some(PC6_A::VALUE11), + 19 => Some(PC6_A::VALUE12), + 20 => Some(PC6_A::VALUE13), + 24 => Some(PC6_A::VALUE14), + 25 => Some(PC6_A::VALUE15), + 26 => Some(PC6_A::VALUE16), + 27 => Some(PC6_A::VALUE17), + 28 => Some(PC6_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC6_A::VALUE1 + **self == PC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC6_A::VALUE2 + **self == PC6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC6_A::VALUE3 + **self == PC6_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC6_A::VALUE4 + **self == PC6_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC6_A::VALUE5 + **self == PC6_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC6_A::VALUE6 + **self == PC6_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC6_A::VALUE7 + **self == PC6_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC6_A::VALUE8 + **self == PC6_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC6_A::VALUE9 + **self == PC6_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC6_A::VALUE10 + **self == PC6_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC6_A::VALUE11 + **self == PC6_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC6_A::VALUE12 + **self == PC6_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC6_A::VALUE13 + **self == PC6_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC6_A::VALUE14 + **self == PC6_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC6_A::VALUE15 + **self == PC6_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC6_A::VALUE16 + **self == PC6_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC6_A::VALUE17 + **self == PC6_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC6_A::VALUE18 + **self == PC6_A::VALUE18 + } +} +impl core::ops::Deref for PC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC6`"] +#[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] pub struct PC6_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC7`"] -pub type PC7_R = crate::R; +#[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] +pub struct PC7_R(crate::FieldReader); impl PC7_R { + pub(crate) fn new(bits: u8) -> Self { + PC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC7_A::VALUE1), - 1 => Val(PC7_A::VALUE2), - 2 => Val(PC7_A::VALUE3), - 3 => Val(PC7_A::VALUE4), - 4 => Val(PC7_A::VALUE5), - 5 => Val(PC7_A::VALUE6), - 6 => Val(PC7_A::VALUE7), - 7 => Val(PC7_A::VALUE8), - 16 => Val(PC7_A::VALUE9), - 17 => Val(PC7_A::VALUE10), - 18 => Val(PC7_A::VALUE11), - 19 => Val(PC7_A::VALUE12), - 20 => Val(PC7_A::VALUE13), - 24 => Val(PC7_A::VALUE14), - 25 => Val(PC7_A::VALUE15), - 26 => Val(PC7_A::VALUE16), - 27 => Val(PC7_A::VALUE17), - 28 => Val(PC7_A::VALUE18), - i => Res(i), + 0 => Some(PC7_A::VALUE1), + 1 => Some(PC7_A::VALUE2), + 2 => Some(PC7_A::VALUE3), + 3 => Some(PC7_A::VALUE4), + 4 => Some(PC7_A::VALUE5), + 5 => Some(PC7_A::VALUE6), + 6 => Some(PC7_A::VALUE7), + 7 => Some(PC7_A::VALUE8), + 16 => Some(PC7_A::VALUE9), + 17 => Some(PC7_A::VALUE10), + 18 => Some(PC7_A::VALUE11), + 19 => Some(PC7_A::VALUE12), + 20 => Some(PC7_A::VALUE13), + 24 => Some(PC7_A::VALUE14), + 25 => Some(PC7_A::VALUE15), + 26 => Some(PC7_A::VALUE16), + 27 => Some(PC7_A::VALUE17), + 28 => Some(PC7_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC7_A::VALUE1 + **self == PC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC7_A::VALUE2 + **self == PC7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC7_A::VALUE3 + **self == PC7_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC7_A::VALUE4 + **self == PC7_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC7_A::VALUE5 + **self == PC7_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC7_A::VALUE6 + **self == PC7_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC7_A::VALUE7 + **self == PC7_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC7_A::VALUE8 + **self == PC7_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC7_A::VALUE9 + **self == PC7_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC7_A::VALUE10 + **self == PC7_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC7_A::VALUE11 + **self == PC7_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC7_A::VALUE12 + **self == PC7_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC7_A::VALUE13 + **self == PC7_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC7_A::VALUE14 + **self == PC7_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC7_A::VALUE15 + **self == PC7_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC7_A::VALUE16 + **self == PC7_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC7_A::VALUE17 + **self == PC7_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC7_A::VALUE18 + **self == PC7_A::VALUE18 + } +} +impl core::ops::Deref for PC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC7`"] +#[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] pub struct PC7_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc7(&mut self) -> PC7_W { PC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Input/Output Control Register 4\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 [iocr4](index.html) module"] +pub struct IOCR4_SPEC; +impl crate::RegisterSpec for IOCR4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr4::R](R) reader structure"] +impl crate::Readable for IOCR4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr4::W](W) writer structure"] +impl crate::Writable for IOCR4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR4 to value 0"] +impl crate::Resettable for IOCR4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/iocr8.rs b/src/port2/iocr8.rs index 00d96809..3eda1f1b 100644 --- a/src/port2/iocr8.rs +++ b/src/port2/iocr8.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR8"] -pub type R = crate::R; -#[doc = "Writer for register IOCR8"] -pub type W = crate::W; -#[doc = "Register IOCR8 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR8 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR8` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR8` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC8`"] -pub type PC8_R = crate::R; +#[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC8_R(crate::FieldReader); impl PC8_R { + pub(crate) fn new(bits: u8) -> Self { + PC8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC8_A::VALUE1), - 1 => Val(PC8_A::VALUE2), - 2 => Val(PC8_A::VALUE3), - 3 => Val(PC8_A::VALUE4), - 4 => Val(PC8_A::VALUE5), - 5 => Val(PC8_A::VALUE6), - 6 => Val(PC8_A::VALUE7), - 7 => Val(PC8_A::VALUE8), - 16 => Val(PC8_A::VALUE9), - 17 => Val(PC8_A::VALUE10), - 18 => Val(PC8_A::VALUE11), - 19 => Val(PC8_A::VALUE12), - 20 => Val(PC8_A::VALUE13), - 24 => Val(PC8_A::VALUE14), - 25 => Val(PC8_A::VALUE15), - 26 => Val(PC8_A::VALUE16), - 27 => Val(PC8_A::VALUE17), - 28 => Val(PC8_A::VALUE18), - i => Res(i), + 0 => Some(PC8_A::VALUE1), + 1 => Some(PC8_A::VALUE2), + 2 => Some(PC8_A::VALUE3), + 3 => Some(PC8_A::VALUE4), + 4 => Some(PC8_A::VALUE5), + 5 => Some(PC8_A::VALUE6), + 6 => Some(PC8_A::VALUE7), + 7 => Some(PC8_A::VALUE8), + 16 => Some(PC8_A::VALUE9), + 17 => Some(PC8_A::VALUE10), + 18 => Some(PC8_A::VALUE11), + 19 => Some(PC8_A::VALUE12), + 20 => Some(PC8_A::VALUE13), + 24 => Some(PC8_A::VALUE14), + 25 => Some(PC8_A::VALUE15), + 26 => Some(PC8_A::VALUE16), + 27 => Some(PC8_A::VALUE17), + 28 => Some(PC8_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC8_A::VALUE1 + **self == PC8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC8_A::VALUE2 + **self == PC8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC8_A::VALUE3 + **self == PC8_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC8_A::VALUE4 + **self == PC8_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC8_A::VALUE5 + **self == PC8_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC8_A::VALUE6 + **self == PC8_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC8_A::VALUE7 + **self == PC8_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC8_A::VALUE8 + **self == PC8_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC8_A::VALUE9 + **self == PC8_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC8_A::VALUE10 + **self == PC8_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC8_A::VALUE11 + **self == PC8_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC8_A::VALUE12 + **self == PC8_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC8_A::VALUE13 + **self == PC8_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC8_A::VALUE14 + **self == PC8_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC8_A::VALUE15 + **self == PC8_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC8_A::VALUE16 + **self == PC8_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC8_A::VALUE17 + **self == PC8_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC8_A::VALUE18 + **self == PC8_A::VALUE18 } } -#[doc = "Write proxy for field `PC8`"] +impl core::ops::Deref for PC8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] pub struct PC8_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC9`"] -pub type PC9_R = crate::R; +#[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC9_R(crate::FieldReader); impl PC9_R { + pub(crate) fn new(bits: u8) -> Self { + PC9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC9_A::VALUE1), - 1 => Val(PC9_A::VALUE2), - 2 => Val(PC9_A::VALUE3), - 3 => Val(PC9_A::VALUE4), - 4 => Val(PC9_A::VALUE5), - 5 => Val(PC9_A::VALUE6), - 6 => Val(PC9_A::VALUE7), - 7 => Val(PC9_A::VALUE8), - 16 => Val(PC9_A::VALUE9), - 17 => Val(PC9_A::VALUE10), - 18 => Val(PC9_A::VALUE11), - 19 => Val(PC9_A::VALUE12), - 20 => Val(PC9_A::VALUE13), - 24 => Val(PC9_A::VALUE14), - 25 => Val(PC9_A::VALUE15), - 26 => Val(PC9_A::VALUE16), - 27 => Val(PC9_A::VALUE17), - 28 => Val(PC9_A::VALUE18), - i => Res(i), + 0 => Some(PC9_A::VALUE1), + 1 => Some(PC9_A::VALUE2), + 2 => Some(PC9_A::VALUE3), + 3 => Some(PC9_A::VALUE4), + 4 => Some(PC9_A::VALUE5), + 5 => Some(PC9_A::VALUE6), + 6 => Some(PC9_A::VALUE7), + 7 => Some(PC9_A::VALUE8), + 16 => Some(PC9_A::VALUE9), + 17 => Some(PC9_A::VALUE10), + 18 => Some(PC9_A::VALUE11), + 19 => Some(PC9_A::VALUE12), + 20 => Some(PC9_A::VALUE13), + 24 => Some(PC9_A::VALUE14), + 25 => Some(PC9_A::VALUE15), + 26 => Some(PC9_A::VALUE16), + 27 => Some(PC9_A::VALUE17), + 28 => Some(PC9_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC9_A::VALUE1 + **self == PC9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC9_A::VALUE2 + **self == PC9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC9_A::VALUE3 + **self == PC9_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC9_A::VALUE4 + **self == PC9_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC9_A::VALUE5 + **self == PC9_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC9_A::VALUE6 + **self == PC9_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC9_A::VALUE7 + **self == PC9_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC9_A::VALUE8 + **self == PC9_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC9_A::VALUE9 + **self == PC9_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC9_A::VALUE10 + **self == PC9_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC9_A::VALUE11 + **self == PC9_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC9_A::VALUE12 + **self == PC9_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC9_A::VALUE13 + **self == PC9_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC9_A::VALUE14 + **self == PC9_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC9_A::VALUE15 + **self == PC9_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC9_A::VALUE16 + **self == PC9_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC9_A::VALUE17 + **self == PC9_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC9_A::VALUE18 + **self == PC9_A::VALUE18 } } -#[doc = "Write proxy for field `PC9`"] +impl core::ops::Deref for PC9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] pub struct PC9_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC10`"] -pub type PC10_R = crate::R; +#[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC10_R(crate::FieldReader); impl PC10_R { + pub(crate) fn new(bits: u8) -> Self { + PC10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC10_A::VALUE1), - 1 => Val(PC10_A::VALUE2), - 2 => Val(PC10_A::VALUE3), - 3 => Val(PC10_A::VALUE4), - 4 => Val(PC10_A::VALUE5), - 5 => Val(PC10_A::VALUE6), - 6 => Val(PC10_A::VALUE7), - 7 => Val(PC10_A::VALUE8), - 16 => Val(PC10_A::VALUE9), - 17 => Val(PC10_A::VALUE10), - 18 => Val(PC10_A::VALUE11), - 19 => Val(PC10_A::VALUE12), - 20 => Val(PC10_A::VALUE13), - 24 => Val(PC10_A::VALUE14), - 25 => Val(PC10_A::VALUE15), - 26 => Val(PC10_A::VALUE16), - 27 => Val(PC10_A::VALUE17), - 28 => Val(PC10_A::VALUE18), - i => Res(i), + 0 => Some(PC10_A::VALUE1), + 1 => Some(PC10_A::VALUE2), + 2 => Some(PC10_A::VALUE3), + 3 => Some(PC10_A::VALUE4), + 4 => Some(PC10_A::VALUE5), + 5 => Some(PC10_A::VALUE6), + 6 => Some(PC10_A::VALUE7), + 7 => Some(PC10_A::VALUE8), + 16 => Some(PC10_A::VALUE9), + 17 => Some(PC10_A::VALUE10), + 18 => Some(PC10_A::VALUE11), + 19 => Some(PC10_A::VALUE12), + 20 => Some(PC10_A::VALUE13), + 24 => Some(PC10_A::VALUE14), + 25 => Some(PC10_A::VALUE15), + 26 => Some(PC10_A::VALUE16), + 27 => Some(PC10_A::VALUE17), + 28 => Some(PC10_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC10_A::VALUE1 + **self == PC10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC10_A::VALUE2 + **self == PC10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC10_A::VALUE3 + **self == PC10_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC10_A::VALUE4 + **self == PC10_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC10_A::VALUE5 + **self == PC10_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC10_A::VALUE6 + **self == PC10_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC10_A::VALUE7 + **self == PC10_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC10_A::VALUE8 + **self == PC10_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC10_A::VALUE9 + **self == PC10_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC10_A::VALUE10 + **self == PC10_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC10_A::VALUE11 + **self == PC10_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC10_A::VALUE12 + **self == PC10_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC10_A::VALUE13 + **self == PC10_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC10_A::VALUE14 + **self == PC10_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC10_A::VALUE15 + **self == PC10_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC10_A::VALUE16 + **self == PC10_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC10_A::VALUE17 + **self == PC10_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC10_A::VALUE18 + **self == PC10_A::VALUE18 + } +} +impl core::ops::Deref for PC10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC10`"] +#[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] pub struct PC10_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC11`"] -pub type PC11_R = crate::R; +#[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] +pub struct PC11_R(crate::FieldReader); impl PC11_R { + pub(crate) fn new(bits: u8) -> Self { + PC11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC11_A::VALUE1), - 1 => Val(PC11_A::VALUE2), - 2 => Val(PC11_A::VALUE3), - 3 => Val(PC11_A::VALUE4), - 4 => Val(PC11_A::VALUE5), - 5 => Val(PC11_A::VALUE6), - 6 => Val(PC11_A::VALUE7), - 7 => Val(PC11_A::VALUE8), - 16 => Val(PC11_A::VALUE9), - 17 => Val(PC11_A::VALUE10), - 18 => Val(PC11_A::VALUE11), - 19 => Val(PC11_A::VALUE12), - 20 => Val(PC11_A::VALUE13), - 24 => Val(PC11_A::VALUE14), - 25 => Val(PC11_A::VALUE15), - 26 => Val(PC11_A::VALUE16), - 27 => Val(PC11_A::VALUE17), - 28 => Val(PC11_A::VALUE18), - i => Res(i), + 0 => Some(PC11_A::VALUE1), + 1 => Some(PC11_A::VALUE2), + 2 => Some(PC11_A::VALUE3), + 3 => Some(PC11_A::VALUE4), + 4 => Some(PC11_A::VALUE5), + 5 => Some(PC11_A::VALUE6), + 6 => Some(PC11_A::VALUE7), + 7 => Some(PC11_A::VALUE8), + 16 => Some(PC11_A::VALUE9), + 17 => Some(PC11_A::VALUE10), + 18 => Some(PC11_A::VALUE11), + 19 => Some(PC11_A::VALUE12), + 20 => Some(PC11_A::VALUE13), + 24 => Some(PC11_A::VALUE14), + 25 => Some(PC11_A::VALUE15), + 26 => Some(PC11_A::VALUE16), + 27 => Some(PC11_A::VALUE17), + 28 => Some(PC11_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC11_A::VALUE1 + **self == PC11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC11_A::VALUE2 + **self == PC11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC11_A::VALUE3 + **self == PC11_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC11_A::VALUE4 + **self == PC11_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC11_A::VALUE5 + **self == PC11_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC11_A::VALUE6 + **self == PC11_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC11_A::VALUE7 + **self == PC11_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC11_A::VALUE8 + **self == PC11_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC11_A::VALUE9 + **self == PC11_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC11_A::VALUE10 + **self == PC11_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC11_A::VALUE11 + **self == PC11_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC11_A::VALUE12 + **self == PC11_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC11_A::VALUE13 + **self == PC11_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC11_A::VALUE14 + **self == PC11_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC11_A::VALUE15 + **self == PC11_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC11_A::VALUE16 + **self == PC11_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC11_A::VALUE17 + **self == PC11_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC11_A::VALUE18 + **self == PC11_A::VALUE18 + } +} +impl core::ops::Deref for PC11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC11`"] +#[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] pub struct PC11_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc11(&mut self) -> PC11_W { PC11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Input/Output Control Register 8\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 [iocr8](index.html) module"] +pub struct IOCR8_SPEC; +impl crate::RegisterSpec for IOCR8_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr8::R](R) reader structure"] +impl crate::Readable for IOCR8_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr8::W](W) writer structure"] +impl crate::Writable for IOCR8_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR8 to value 0"] +impl crate::Resettable for IOCR8_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/omr.rs b/src/port2/omr.rs index c8c458f2..96f77b08 100644 --- a/src/port2/omr.rs +++ b/src/port2/omr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OMR"] -pub type W = crate::W; -#[doc = "Register OMR `reset()`'s with value 0"] -impl crate::ResetValue for super::OMR { - type Type = u32; +#[doc = "Register `OMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `PS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PS0` writer - Port n Set Bit 0"] pub struct PS0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> PS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `PS1`"] +#[doc = "Field `PS1` writer - Port n Set Bit 1"] pub struct PS1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> PS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS2`"] +#[doc = "Field `PS2` writer - Port n Set Bit 2"] pub struct PS2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS3`"] +#[doc = "Field `PS3` writer - Port n Set Bit 3"] pub struct PS3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS4`"] +#[doc = "Field `PS4` writer - Port n Set Bit 4"] pub struct PS4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PS5`"] +#[doc = "Field `PS5` writer - Port n Set Bit 5"] pub struct PS5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `PS6`"] +#[doc = "Field `PS6` writer - Port n Set Bit 6"] pub struct PS6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> PS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `PS7`"] +#[doc = "Field `PS7` writer - Port n Set Bit 7"] pub struct PS7_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `PS8`"] +#[doc = "Field `PS8` writer - Port n Set Bit 8"] pub struct PS8_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PS9`"] +#[doc = "Field `PS9` writer - Port n Set Bit 9"] pub struct PS9_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS10`"] +#[doc = "Field `PS10` writer - Port n Set Bit 10"] pub struct PS10_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> PS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS11`"] +#[doc = "Field `PS11` writer - Port n Set Bit 11"] pub struct PS11_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> PS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS12`"] +#[doc = "Field `PS12` writer - Port n Set Bit 12"] pub struct PS12_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `PS13`"] +#[doc = "Field `PS13` writer - Port n Set Bit 13"] pub struct PS13_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `PS14`"] +#[doc = "Field `PS14` writer - Port n Set Bit 14"] pub struct PS14_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> PS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `PS15`"] +#[doc = "Field `PS15` writer - Port n Set Bit 15"] pub struct PS15_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> PS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Write proxy for field `PR0`"] +#[doc = "Field `PR0` writer - Port n Reset Bit 0"] pub struct PR0_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> PR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `PR1`"] +#[doc = "Field `PR1` writer - Port n Reset Bit 1"] pub struct PR1_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> PR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PR2`"] +#[doc = "Field `PR2` writer - Port n Reset Bit 2"] pub struct PR2_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> PR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PR3`"] +#[doc = "Field `PR3` writer - Port n Reset Bit 3"] pub struct PR3_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> PR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PR4`"] +#[doc = "Field `PR4` writer - Port n Reset Bit 4"] pub struct PR4_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> PR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `PR5`"] +#[doc = "Field `PR5` writer - Port n Reset Bit 5"] pub struct PR5_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> PR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `PR6`"] +#[doc = "Field `PR6` writer - Port n Reset Bit 6"] pub struct PR6_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> PR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `PR7`"] +#[doc = "Field `PR7` writer - Port n Reset Bit 7"] pub struct PR7_W<'a> { w: &'a mut W, } @@ -532,11 +543,11 @@ impl<'a> PR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `PR8`"] +#[doc = "Field `PR8` writer - Port n Reset Bit 8"] pub struct PR8_W<'a> { w: &'a mut W, } @@ -554,11 +565,11 @@ impl<'a> PR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `PR9`"] +#[doc = "Field `PR9` writer - Port n Reset Bit 9"] pub struct PR9_W<'a> { w: &'a mut W, } @@ -576,11 +587,11 @@ impl<'a> PR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `PR10`"] +#[doc = "Field `PR10` writer - Port n Reset Bit 10"] pub struct PR10_W<'a> { w: &'a mut W, } @@ -598,11 +609,11 @@ impl<'a> PR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `PR11`"] +#[doc = "Field `PR11` writer - Port n Reset Bit 11"] pub struct PR11_W<'a> { w: &'a mut W, } @@ -620,11 +631,11 @@ impl<'a> PR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `PR12`"] +#[doc = "Field `PR12` writer - Port n Reset Bit 12"] pub struct PR12_W<'a> { w: &'a mut W, } @@ -642,11 +653,11 @@ impl<'a> PR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `PR13`"] +#[doc = "Field `PR13` writer - Port n Reset Bit 13"] pub struct PR13_W<'a> { w: &'a mut W, } @@ -664,11 +675,11 @@ impl<'a> PR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Write proxy for field `PR14`"] +#[doc = "Field `PR14` writer - Port n Reset Bit 14"] pub struct PR14_W<'a> { w: &'a mut W, } @@ -686,11 +697,11 @@ impl<'a> PR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Write proxy for field `PR15`"] +#[doc = "Field `PR15` writer - Port n Reset Bit 15"] pub struct PR15_W<'a> { w: &'a mut W, } @@ -708,7 +719,7 @@ impl<'a> PR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -873,4 +884,26 @@ impl W { pub fn pr15(&mut self) -> PR15_W { PR15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Output Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](index.html) module"] +pub struct OMR_SPEC; +impl crate::RegisterSpec for OMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +impl crate::Writable for OMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OMR to value 0"] +impl crate::Resettable for OMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/out.rs b/src/port2/out.rs index 234afddb..af967aa8 100644 --- a/src/port2/out.rs +++ b/src/port2/out.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OUT"] -pub type R = crate::R; -#[doc = "Writer for register OUT"] -pub type W = crate::W; -#[doc = "Register OUT `reset()`'s with value 0"] -impl crate::ResetValue for super::OUT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Output Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -38,15 +65,22 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 } } -#[doc = "Write proxy for field `P0`"] +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P0` writer - Port n Output Bit 0"] pub struct P0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Output Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -113,15 +148,22 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 } } -#[doc = "Write proxy for field `P1`"] +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P1` writer - Port n Output Bit 1"] pub struct P1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Output Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -188,15 +231,22 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P2`"] +#[doc = "Field `P2` writer - Port n Output Bit 2"] pub struct P2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Output Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -263,15 +314,22 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P3`"] +#[doc = "Field `P3` writer - Port n Output Bit 3"] pub struct P3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Output Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -338,15 +397,22 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P4`"] +#[doc = "Field `P4` writer - Port n Output Bit 4"] pub struct P4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Output Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -413,15 +480,22 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P5`"] +#[doc = "Field `P5` writer - Port n Output Bit 5"] pub struct P5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Output Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -488,15 +563,22 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 } } -#[doc = "Write proxy for field `P6`"] +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P6` writer - Port n Output Bit 6"] pub struct P6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Output Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -563,15 +646,22 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 } } -#[doc = "Write proxy for field `P7`"] +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P7` writer - Port n Output Bit 7"] pub struct P7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Output Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -638,15 +729,22 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 } } -#[doc = "Write proxy for field `P8`"] +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P8` writer - Port n Output Bit 8"] pub struct P8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Output Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -713,15 +812,22 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P9`"] +#[doc = "Field `P9` writer - Port n Output Bit 9"] pub struct P9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Output Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -788,15 +895,22 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 } } -#[doc = "Write proxy for field `P10`"] +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P10` writer - Port n Output Bit 10"] pub struct P10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Output Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -863,15 +978,22 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 } } -#[doc = "Write proxy for field `P11`"] +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P11` writer - Port n Output Bit 11"] pub struct P11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Output Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -938,15 +1061,22 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P12`"] +#[doc = "Field `P12` writer - Port n Output Bit 12"] pub struct P12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Output Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -1013,15 +1144,22 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 } } -#[doc = "Write proxy for field `P13`"] +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P13` writer - Port n Output Bit 13"] pub struct P13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Output Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -1088,15 +1227,22 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 } } -#[doc = "Write proxy for field `P14`"] +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P14` writer - Port n Output Bit 14"] pub struct P14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Output Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -1163,15 +1310,22 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 } } -#[doc = "Write proxy for field `P15`"] +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P15` writer - Port n Output Bit 15"] pub struct P15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn p15(&mut self) -> P15_W { P15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Output Register\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 [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port2/pdisc.rs b/src/port2/pdisc.rs index dad72964..ce4e4f71 100644 --- a/src/port2/pdisc.rs +++ b/src/port2/pdisc.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PDISC"] -pub type R = crate::R; +#[doc = "Register `PDISC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PDIS0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS0`"] -pub type PDIS0_R = crate::R; +#[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] +pub struct PDIS0_R(crate::FieldReader); impl PDIS0_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS0_A { @@ -28,12 +44,19 @@ impl PDIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS0_A::VALUE1 + **self == PDIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS0_A::VALUE2 + **self == PDIS0_A::VALUE2 + } +} +impl core::ops::Deref for PDIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS1`"] -pub type PDIS1_R = crate::R; +#[doc = "Field `PDIS1` reader - Pad Disable for Port n Pin 1"] +pub struct PDIS1_R(crate::FieldReader); impl PDIS1_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS1_A { @@ -64,12 +90,19 @@ impl PDIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS1_A::VALUE1 + **self == PDIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS1_A::VALUE2 + **self == PDIS1_A::VALUE2 + } +} +impl core::ops::Deref for PDIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS2`"] -pub type PDIS2_R = crate::R; +#[doc = "Field `PDIS2` reader - Pad Disable for Port n Pin 2"] +pub struct PDIS2_R(crate::FieldReader); impl PDIS2_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS2_A { @@ -100,12 +136,19 @@ impl PDIS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS2_A::VALUE1 + **self == PDIS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS2_A::VALUE2 + **self == PDIS2_A::VALUE2 + } +} +impl core::ops::Deref for PDIS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS3`"] -pub type PDIS3_R = crate::R; +#[doc = "Field `PDIS3` reader - Pad Disable for Port n Pin 3"] +pub struct PDIS3_R(crate::FieldReader); impl PDIS3_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS3_A { @@ -136,12 +182,19 @@ impl PDIS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS3_A::VALUE1 + **self == PDIS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS3_A::VALUE2 + **self == PDIS3_A::VALUE2 + } +} +impl core::ops::Deref for PDIS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS4`"] -pub type PDIS4_R = crate::R; +#[doc = "Field `PDIS4` reader - Pad Disable for Port n Pin 4"] +pub struct PDIS4_R(crate::FieldReader); impl PDIS4_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS4_A { @@ -172,12 +228,19 @@ impl PDIS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS4_A::VALUE1 + **self == PDIS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS4_A::VALUE2 + **self == PDIS4_A::VALUE2 + } +} +impl core::ops::Deref for PDIS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS5`"] -pub type PDIS5_R = crate::R; +#[doc = "Field `PDIS5` reader - Pad Disable for Port n Pin 5"] +pub struct PDIS5_R(crate::FieldReader); impl PDIS5_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS5_A { @@ -208,12 +274,19 @@ impl PDIS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS5_A::VALUE1 + **self == PDIS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS5_A::VALUE2 + **self == PDIS5_A::VALUE2 + } +} +impl core::ops::Deref for PDIS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS6`"] -pub type PDIS6_R = crate::R; +#[doc = "Field `PDIS6` reader - Pad Disable for Port n Pin 6"] +pub struct PDIS6_R(crate::FieldReader); impl PDIS6_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS6_A { @@ -244,12 +320,19 @@ impl PDIS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS6_A::VALUE1 + **self == PDIS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS6_A::VALUE2 + **self == PDIS6_A::VALUE2 + } +} +impl core::ops::Deref for PDIS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS7`"] -pub type PDIS7_R = crate::R; +#[doc = "Field `PDIS7` reader - Pad Disable for Port n Pin 7"] +pub struct PDIS7_R(crate::FieldReader); impl PDIS7_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS7_A { @@ -280,12 +366,19 @@ impl PDIS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS7_A::VALUE1 + **self == PDIS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS7_A::VALUE2 + **self == PDIS7_A::VALUE2 + } +} +impl core::ops::Deref for PDIS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS8`"] -pub type PDIS8_R = crate::R; +#[doc = "Field `PDIS8` reader - Pad Disable for Port n Pin 8"] +pub struct PDIS8_R(crate::FieldReader); impl PDIS8_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS8_A { @@ -316,12 +412,19 @@ impl PDIS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS8_A::VALUE1 + **self == PDIS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS8_A::VALUE2 + **self == PDIS8_A::VALUE2 + } +} +impl core::ops::Deref for PDIS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS9`"] -pub type PDIS9_R = crate::R; +#[doc = "Field `PDIS9` reader - Pad Disable for Port n Pin 9"] +pub struct PDIS9_R(crate::FieldReader); impl PDIS9_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS9_A { @@ -352,12 +458,19 @@ impl PDIS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS9_A::VALUE1 + **self == PDIS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS9_A::VALUE2 + **self == PDIS9_A::VALUE2 + } +} +impl core::ops::Deref for PDIS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS10`"] -pub type PDIS10_R = crate::R; +#[doc = "Field `PDIS10` reader - Pad Disable for Port n Pin 10"] +pub struct PDIS10_R(crate::FieldReader); impl PDIS10_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS10_A { @@ -388,12 +504,19 @@ impl PDIS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS10_A::VALUE1 + **self == PDIS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS10_A::VALUE2 + **self == PDIS10_A::VALUE2 + } +} +impl core::ops::Deref for PDIS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS11`"] -pub type PDIS11_R = crate::R; +#[doc = "Field `PDIS11` reader - Pad Disable for Port n Pin 11"] +pub struct PDIS11_R(crate::FieldReader); impl PDIS11_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS11_A { @@ -424,12 +550,19 @@ impl PDIS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS11_A::VALUE1 + **self == PDIS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS11_A::VALUE2 + **self == PDIS11_A::VALUE2 + } +} +impl core::ops::Deref for PDIS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS12`"] -pub type PDIS12_R = crate::R; +#[doc = "Field `PDIS12` reader - Pad Disable for Port n Pin 12"] +pub struct PDIS12_R(crate::FieldReader); impl PDIS12_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS12_A { @@ -460,12 +596,19 @@ impl PDIS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS12_A::VALUE1 + **self == PDIS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS12_A::VALUE2 + **self == PDIS12_A::VALUE2 + } +} +impl core::ops::Deref for PDIS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS13`"] -pub type PDIS13_R = crate::R; +#[doc = "Field `PDIS13` reader - Pad Disable for Port n Pin 13"] +pub struct PDIS13_R(crate::FieldReader); impl PDIS13_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS13_A { @@ -496,12 +642,19 @@ impl PDIS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS13_A::VALUE1 + **self == PDIS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS13_A::VALUE2 + **self == PDIS13_A::VALUE2 + } +} +impl core::ops::Deref for PDIS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS14`"] -pub type PDIS14_R = crate::R; +#[doc = "Field `PDIS14` reader - Pad Disable for Port n Pin 14"] +pub struct PDIS14_R(crate::FieldReader); impl PDIS14_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS14_A { @@ -532,12 +688,19 @@ impl PDIS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS14_A::VALUE1 + **self == PDIS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS14_A::VALUE2 + **self == PDIS14_A::VALUE2 + } +} +impl core::ops::Deref for PDIS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS15`"] -pub type PDIS15_R = crate::R; +#[doc = "Field `PDIS15` reader - Pad Disable for Port n Pin 15"] +pub struct PDIS15_R(crate::FieldReader); impl PDIS15_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS15_A { @@ -568,12 +734,19 @@ impl PDIS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS15_A::VALUE1 + **self == PDIS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS15_A::VALUE2 + **self == PDIS15_A::VALUE2 + } +} +impl core::ops::Deref for PDIS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 2 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](index.html) module"] +pub struct PDISC_SPEC; +impl crate::RegisterSpec for PDISC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdisc::R](R) reader structure"] +impl crate::Readable for PDISC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PDISC to value 0"] +impl crate::Resettable for PDISC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port2/pdr0.rs b/src/port2/pdr0.rs index 0923fc4a..c3b3776a 100644 --- a/src/port2/pdr0.rs +++ b/src/port2/pdr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR0"] -pub type R = crate::R; -#[doc = "Writer for register PDR0"] -pub type W = crate::W; -#[doc = "Register PDR0 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] +pub struct PD0_R(crate::FieldReader); +impl PD0_R { + pub(crate) fn new(bits: u8) -> Self { + PD0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD0`"] -pub type PD0_R = crate::R; -#[doc = "Write proxy for field `PD0`"] +impl core::ops::Deref for PD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] pub struct PD0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD1`"] -pub type PD1_R = crate::R; -#[doc = "Write proxy for field `PD1`"] +#[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] +pub struct PD1_R(crate::FieldReader); +impl PD1_R { + pub(crate) fn new(bits: u8) -> Self { + PD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] pub struct PD1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD2`"] -pub type PD2_R = crate::R; -#[doc = "Write proxy for field `PD2`"] +#[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] +pub struct PD2_R(crate::FieldReader); +impl PD2_R { + pub(crate) fn new(bits: u8) -> Self { + PD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] pub struct PD2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD3`"] -pub type PD3_R = crate::R; -#[doc = "Write proxy for field `PD3`"] +#[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] +pub struct PD3_R(crate::FieldReader); +impl PD3_R { + pub(crate) fn new(bits: u8) -> Self { + PD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] pub struct PD3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD4`"] -pub type PD4_R = crate::R; -#[doc = "Write proxy for field `PD4`"] +#[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] +pub struct PD4_R(crate::FieldReader); +impl PD4_R { + pub(crate) fn new(bits: u8) -> Self { + PD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] pub struct PD4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD5`"] -pub type PD5_R = crate::R; -#[doc = "Write proxy for field `PD5`"] +#[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] +pub struct PD5_R(crate::FieldReader); +impl PD5_R { + pub(crate) fn new(bits: u8) -> Self { + PD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] pub struct PD5_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD6`"] -pub type PD6_R = crate::R; -#[doc = "Write proxy for field `PD6`"] +#[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] +pub struct PD6_R(crate::FieldReader); +impl PD6_R { + pub(crate) fn new(bits: u8) -> Self { + PD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] pub struct PD6_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD7`"] -pub type PD7_R = crate::R; -#[doc = "Write proxy for field `PD7`"] +#[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] +pub struct PD7_R(crate::FieldReader); +impl PD7_R { + pub(crate) fn new(bits: u8) -> Self { + PD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] pub struct PD7_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd7(&mut self) -> PD7_W { PD7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Pad Driver Mode 0 Register\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 [pdr0](index.html) module"] +pub struct PDR0_SPEC; +impl crate::RegisterSpec for PDR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr0::R](R) reader structure"] +impl crate::Readable for PDR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr0::W](W) writer structure"] +impl crate::Writable for PDR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR0 to value 0x2222_2222"] +impl crate::Resettable for PDR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port2/pdr1.rs b/src/port2/pdr1.rs index 2587bf70..46d63681 100644 --- a/src/port2/pdr1.rs +++ b/src/port2/pdr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR1"] -pub type R = crate::R; -#[doc = "Writer for register PDR1"] -pub type W = crate::W; -#[doc = "Register PDR1 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] +pub struct PD8_R(crate::FieldReader); +impl PD8_R { + pub(crate) fn new(bits: u8) -> Self { + PD8_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD8`"] -pub type PD8_R = crate::R; -#[doc = "Write proxy for field `PD8`"] +impl core::ops::Deref for PD8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] pub struct PD8_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD9`"] -pub type PD9_R = crate::R; -#[doc = "Write proxy for field `PD9`"] +#[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] +pub struct PD9_R(crate::FieldReader); +impl PD9_R { + pub(crate) fn new(bits: u8) -> Self { + PD9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] pub struct PD9_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD10`"] -pub type PD10_R = crate::R; -#[doc = "Write proxy for field `PD10`"] +#[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] +pub struct PD10_R(crate::FieldReader); +impl PD10_R { + pub(crate) fn new(bits: u8) -> Self { + PD10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] pub struct PD10_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD11`"] -pub type PD11_R = crate::R; -#[doc = "Write proxy for field `PD11`"] +#[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] +pub struct PD11_R(crate::FieldReader); +impl PD11_R { + pub(crate) fn new(bits: u8) -> Self { + PD11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] pub struct PD11_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD12`"] -pub type PD12_R = crate::R; -#[doc = "Write proxy for field `PD12`"] +#[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] +pub struct PD12_R(crate::FieldReader); +impl PD12_R { + pub(crate) fn new(bits: u8) -> Self { + PD12_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] pub struct PD12_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD13`"] -pub type PD13_R = crate::R; -#[doc = "Write proxy for field `PD13`"] +#[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] +pub struct PD13_R(crate::FieldReader); +impl PD13_R { + pub(crate) fn new(bits: u8) -> Self { + PD13_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] pub struct PD13_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD14`"] -pub type PD14_R = crate::R; -#[doc = "Write proxy for field `PD14`"] +#[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] +pub struct PD14_R(crate::FieldReader); +impl PD14_R { + pub(crate) fn new(bits: u8) -> Self { + PD14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] pub struct PD14_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD15`"] -pub type PD15_R = crate::R; -#[doc = "Write proxy for field `PD15`"] +#[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] +pub struct PD15_R(crate::FieldReader); +impl PD15_R { + pub(crate) fn new(bits: u8) -> Self { + PD15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] pub struct PD15_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd15(&mut self) -> PD15_W { PD15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Pad Driver Mode 1 Register\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 [pdr1](index.html) module"] +pub struct PDR1_SPEC; +impl crate::RegisterSpec for PDR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr1::R](R) reader structure"] +impl crate::Readable for PDR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr1::W](W) writer structure"] +impl crate::Writable for PDR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR1 to value 0x2222_2222"] +impl crate::Resettable for PDR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port2/pps.rs b/src/port2/pps.rs index b45c5930..e49d5f8c 100644 --- a/src/port2/pps.rs +++ b/src/port2/pps.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PPS"] -pub type R = crate::R; -#[doc = "Writer for register PPS"] -pub type W = crate::W; -#[doc = "Register PPS `reset()`'s with value 0"] -impl crate::ResetValue for super::PPS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS0`"] -pub type PPS0_R = crate::R; +#[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] +pub struct PPS0_R(crate::FieldReader); impl PPS0_R { + pub(crate) fn new(bits: bool) -> Self { + PPS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS0_A { @@ -38,15 +65,22 @@ impl PPS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS0_A::VALUE1 + **self == PPS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS0_A::VALUE2 + **self == PPS0_A::VALUE2 } } -#[doc = "Write proxy for field `PPS0`"] +impl core::ops::Deref for PPS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] pub struct PPS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS1`"] -pub type PPS1_R = crate::R; +#[doc = "Field `PPS1` reader - Port n Pin Power Save Bit 1"] +pub struct PPS1_R(crate::FieldReader); impl PPS1_R { + pub(crate) fn new(bits: bool) -> Self { + PPS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS1_A { @@ -113,15 +148,22 @@ impl PPS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS1_A::VALUE1 + **self == PPS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS1_A::VALUE2 + **self == PPS1_A::VALUE2 } } -#[doc = "Write proxy for field `PPS1`"] +impl core::ops::Deref for PPS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] pub struct PPS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS2`"] -pub type PPS2_R = crate::R; +#[doc = "Field `PPS2` reader - Port n Pin Power Save Bit 2"] +pub struct PPS2_R(crate::FieldReader); impl PPS2_R { + pub(crate) fn new(bits: bool) -> Self { + PPS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS2_A { @@ -188,15 +231,22 @@ impl PPS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS2_A::VALUE1 + **self == PPS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS2_A::VALUE2 + **self == PPS2_A::VALUE2 + } +} +impl core::ops::Deref for PPS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS2`"] +#[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] pub struct PPS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS3`"] -pub type PPS3_R = crate::R; +#[doc = "Field `PPS3` reader - Port n Pin Power Save Bit 3"] +pub struct PPS3_R(crate::FieldReader); impl PPS3_R { + pub(crate) fn new(bits: bool) -> Self { + PPS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS3_A { @@ -263,15 +314,22 @@ impl PPS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS3_A::VALUE1 + **self == PPS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS3_A::VALUE2 + **self == PPS3_A::VALUE2 + } +} +impl core::ops::Deref for PPS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS3`"] +#[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] pub struct PPS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS4`"] -pub type PPS4_R = crate::R; +#[doc = "Field `PPS4` reader - Port n Pin Power Save Bit 4"] +pub struct PPS4_R(crate::FieldReader); impl PPS4_R { + pub(crate) fn new(bits: bool) -> Self { + PPS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS4_A { @@ -338,15 +397,22 @@ impl PPS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS4_A::VALUE1 + **self == PPS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS4_A::VALUE2 + **self == PPS4_A::VALUE2 + } +} +impl core::ops::Deref for PPS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS4`"] +#[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] pub struct PPS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS5`"] -pub type PPS5_R = crate::R; +#[doc = "Field `PPS5` reader - Port n Pin Power Save Bit 5"] +pub struct PPS5_R(crate::FieldReader); impl PPS5_R { + pub(crate) fn new(bits: bool) -> Self { + PPS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS5_A { @@ -413,15 +480,22 @@ impl PPS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS5_A::VALUE1 + **self == PPS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS5_A::VALUE2 + **self == PPS5_A::VALUE2 + } +} +impl core::ops::Deref for PPS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS5`"] +#[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] pub struct PPS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS6`"] -pub type PPS6_R = crate::R; +#[doc = "Field `PPS6` reader - Port n Pin Power Save Bit 6"] +pub struct PPS6_R(crate::FieldReader); impl PPS6_R { + pub(crate) fn new(bits: bool) -> Self { + PPS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS6_A { @@ -488,15 +563,22 @@ impl PPS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS6_A::VALUE1 + **self == PPS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS6_A::VALUE2 + **self == PPS6_A::VALUE2 } } -#[doc = "Write proxy for field `PPS6`"] +impl core::ops::Deref for PPS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] pub struct PPS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS7`"] -pub type PPS7_R = crate::R; +#[doc = "Field `PPS7` reader - Port n Pin Power Save Bit 7"] +pub struct PPS7_R(crate::FieldReader); impl PPS7_R { + pub(crate) fn new(bits: bool) -> Self { + PPS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS7_A { @@ -563,15 +646,22 @@ impl PPS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS7_A::VALUE1 + **self == PPS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS7_A::VALUE2 + **self == PPS7_A::VALUE2 } } -#[doc = "Write proxy for field `PPS7`"] +impl core::ops::Deref for PPS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] pub struct PPS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS8`"] -pub type PPS8_R = crate::R; +#[doc = "Field `PPS8` reader - Port n Pin Power Save Bit 8"] +pub struct PPS8_R(crate::FieldReader); impl PPS8_R { + pub(crate) fn new(bits: bool) -> Self { + PPS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS8_A { @@ -638,15 +729,22 @@ impl PPS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS8_A::VALUE1 + **self == PPS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS8_A::VALUE2 + **self == PPS8_A::VALUE2 } } -#[doc = "Write proxy for field `PPS8`"] +impl core::ops::Deref for PPS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] pub struct PPS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS9`"] -pub type PPS9_R = crate::R; +#[doc = "Field `PPS9` reader - Port n Pin Power Save Bit 9"] +pub struct PPS9_R(crate::FieldReader); impl PPS9_R { + pub(crate) fn new(bits: bool) -> Self { + PPS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS9_A { @@ -713,15 +812,22 @@ impl PPS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS9_A::VALUE1 + **self == PPS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS9_A::VALUE2 + **self == PPS9_A::VALUE2 + } +} +impl core::ops::Deref for PPS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS9`"] +#[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] pub struct PPS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS10`"] -pub type PPS10_R = crate::R; +#[doc = "Field `PPS10` reader - Port n Pin Power Save Bit 10"] +pub struct PPS10_R(crate::FieldReader); impl PPS10_R { + pub(crate) fn new(bits: bool) -> Self { + PPS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS10_A { @@ -788,15 +895,22 @@ impl PPS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS10_A::VALUE1 + **self == PPS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS10_A::VALUE2 + **self == PPS10_A::VALUE2 } } -#[doc = "Write proxy for field `PPS10`"] +impl core::ops::Deref for PPS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] pub struct PPS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS11`"] -pub type PPS11_R = crate::R; +#[doc = "Field `PPS11` reader - Port n Pin Power Save Bit 11"] +pub struct PPS11_R(crate::FieldReader); impl PPS11_R { + pub(crate) fn new(bits: bool) -> Self { + PPS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS11_A { @@ -863,15 +978,22 @@ impl PPS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS11_A::VALUE1 + **self == PPS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS11_A::VALUE2 + **self == PPS11_A::VALUE2 } } -#[doc = "Write proxy for field `PPS11`"] +impl core::ops::Deref for PPS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] pub struct PPS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS12`"] -pub type PPS12_R = crate::R; +#[doc = "Field `PPS12` reader - Port n Pin Power Save Bit 12"] +pub struct PPS12_R(crate::FieldReader); impl PPS12_R { + pub(crate) fn new(bits: bool) -> Self { + PPS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS12_A { @@ -938,15 +1061,22 @@ impl PPS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS12_A::VALUE1 + **self == PPS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS12_A::VALUE2 + **self == PPS12_A::VALUE2 + } +} +impl core::ops::Deref for PPS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS12`"] +#[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] pub struct PPS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS13`"] -pub type PPS13_R = crate::R; +#[doc = "Field `PPS13` reader - Port n Pin Power Save Bit 13"] +pub struct PPS13_R(crate::FieldReader); impl PPS13_R { + pub(crate) fn new(bits: bool) -> Self { + PPS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS13_A { @@ -1013,15 +1144,22 @@ impl PPS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS13_A::VALUE1 + **self == PPS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS13_A::VALUE2 + **self == PPS13_A::VALUE2 } } -#[doc = "Write proxy for field `PPS13`"] +impl core::ops::Deref for PPS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] pub struct PPS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS14`"] -pub type PPS14_R = crate::R; +#[doc = "Field `PPS14` reader - Port n Pin Power Save Bit 14"] +pub struct PPS14_R(crate::FieldReader); impl PPS14_R { + pub(crate) fn new(bits: bool) -> Self { + PPS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS14_A { @@ -1088,15 +1227,22 @@ impl PPS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS14_A::VALUE1 + **self == PPS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS14_A::VALUE2 + **self == PPS14_A::VALUE2 } } -#[doc = "Write proxy for field `PPS14`"] +impl core::ops::Deref for PPS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] pub struct PPS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS15`"] -pub type PPS15_R = crate::R; +#[doc = "Field `PPS15` reader - Port n Pin Power Save Bit 15"] +pub struct PPS15_R(crate::FieldReader); impl PPS15_R { + pub(crate) fn new(bits: bool) -> Self { + PPS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS15_A { @@ -1163,15 +1310,22 @@ impl PPS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS15_A::VALUE1 + **self == PPS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS15_A::VALUE2 + **self == PPS15_A::VALUE2 } } -#[doc = "Write proxy for field `PPS15`"] +impl core::ops::Deref for PPS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] pub struct PPS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pps15(&mut self) -> PPS15_W { PPS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 2 Pin Power Save Register\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 [pps](index.html) module"] +pub struct PPS_SPEC; +impl crate::RegisterSpec for PPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pps::R](R) reader structure"] +impl crate::Readable for PPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pps::W](W) writer structure"] +impl crate::Writable for PPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PPS to value 0"] +impl crate::Resettable for PPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port3.rs b/src/port3.rs index 7b94ef24..e2d10500 100644 --- a/src/port3.rs +++ b/src/port3.rs @@ -2,106 +2,56 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Port 3 Output Register"] - pub out: OUT, + pub out: crate::Reg, #[doc = "0x04 - Port 3 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 8usize], + pub omr: crate::Reg, + _reserved2: [u8; 0x08], #[doc = "0x10 - Port 3 Input/Output Control Register 0"] - pub iocr0: IOCR0, - _reserved3: [u8; 16usize], + pub iocr0: crate::Reg, + _reserved3: [u8; 0x10], #[doc = "0x24 - Port 3 Input Register"] - pub in_: IN, - _reserved4: [u8; 24usize], + pub in_: crate::Reg, + _reserved4: [u8; 0x18], #[doc = "0x40 - Port 3 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, - _reserved5: [u8; 28usize], + pub pdr0: crate::Reg, + _reserved5: [u8; 0x1c], #[doc = "0x60 - Port 3 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved6: [u8; 12usize], + pub pdisc: crate::Reg, + _reserved6: [u8; 0x0c], #[doc = "0x70 - Port 3 Pin Power Save Register"] - pub pps: PPS, + pub pps: crate::Reg, #[doc = "0x74 - Port 3 Pin Hardware Select Register"] - pub hwsel: HWSEL, + pub hwsel: crate::Reg, } -#[doc = "Port 3 Output Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](out) module"] -pub type OUT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUT; -#[doc = "`read()` method returns [out::R](out::R) reader structure"] -impl crate::Readable for OUT {} -#[doc = "`write(|w| ..)` method takes [out::W](out::W) writer structure"] -impl crate::Writable for OUT {} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; #[doc = "Port 3 Output Register"] pub mod out; -#[doc = "Port 3 Output Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](omr) module"] -pub type OMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OMR; -#[doc = "`write(|w| ..)` method takes [omr::W](omr::W) writer structure"] -impl crate::Writable for OMR {} +#[doc = "OMR register accessor: an alias for `Reg`"] +pub type OMR = crate::Reg; #[doc = "Port 3 Output Modification Register"] pub mod omr; -#[doc = "Port 3 Input/Output Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iocr0](iocr0) module"] -pub type IOCR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IOCR0; -#[doc = "`read()` method returns [iocr0::R](iocr0::R) reader structure"] -impl crate::Readable for IOCR0 {} -#[doc = "`write(|w| ..)` method takes [iocr0::W](iocr0::W) writer structure"] -impl crate::Writable for IOCR0 {} +#[doc = "IOCR0 register accessor: an alias for `Reg`"] +pub type IOCR0 = crate::Reg; #[doc = "Port 3 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "Port 3 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`read()` method returns [in_::R](in_::R) reader structure"] -impl crate::Readable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Port 3 Input Register"] pub mod in_; -#[doc = "Port 3 Pad Driver Mode 0 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdr0](pdr0) module"] -pub type PDR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDR0; -#[doc = "`read()` method returns [pdr0::R](pdr0::R) reader structure"] -impl crate::Readable for PDR0 {} -#[doc = "`write(|w| ..)` method takes [pdr0::W](pdr0::W) writer structure"] -impl crate::Writable for PDR0 {} +#[doc = "PDR0 register accessor: an alias for `Reg`"] +pub type PDR0 = crate::Reg; #[doc = "Port 3 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "Port 3 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](pdisc) module"] -pub type PDISC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDISC; -#[doc = "`read()` method returns [pdisc::R](pdisc::R) reader structure"] -impl crate::Readable for PDISC {} +#[doc = "PDISC register accessor: an alias for `Reg`"] +pub type PDISC = crate::Reg; #[doc = "Port 3 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "Port 3 Pin Power Save Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pps](pps) module"] -pub type PPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PPS; -#[doc = "`read()` method returns [pps::R](pps::R) reader structure"] -impl crate::Readable for PPS {} -#[doc = "`write(|w| ..)` method takes [pps::W](pps::W) writer structure"] -impl crate::Writable for PPS {} +#[doc = "PPS register accessor: an alias for `Reg`"] +pub type PPS = crate::Reg; #[doc = "Port 3 Pin Power Save Register"] pub mod pps; -#[doc = "Port 3 Pin Hardware Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hwsel](hwsel) module"] -pub type HWSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HWSEL; -#[doc = "`read()` method returns [hwsel::R](hwsel::R) reader structure"] -impl crate::Readable for HWSEL {} -#[doc = "`write(|w| ..)` method takes [hwsel::W](hwsel::W) writer structure"] -impl crate::Writable for HWSEL {} +#[doc = "HWSEL register accessor: an alias for `Reg`"] +pub type HWSEL = crate::Reg; #[doc = "Port 3 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port3/hwsel.rs b/src/port3/hwsel.rs index 0190c06c..3cc3588a 100644 --- a/src/port3/hwsel.rs +++ b/src/port3/hwsel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HWSEL"] -pub type R = crate::R; -#[doc = "Writer for register HWSEL"] -pub type W = crate::W; -#[doc = "Register HWSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::HWSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HWSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HWSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW0`"] -pub type HW0_R = crate::R; +#[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] +pub struct HW0_R(crate::FieldReader); impl HW0_R { + pub(crate) fn new(bits: u8) -> Self { + HW0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW0_A::VALUE1), - 1 => Val(HW0_A::VALUE2), - 2 => Val(HW0_A::VALUE3), - i => Res(i), + 0 => Some(HW0_A::VALUE1), + 1 => Some(HW0_A::VALUE2), + 2 => Some(HW0_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW0_A::VALUE1 + **self == HW0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW0_A::VALUE2 + **self == HW0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW0_A::VALUE3 + **self == HW0_A::VALUE3 } } -#[doc = "Write proxy for field `HW0`"] +impl core::ops::Deref for HW0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] pub struct HW0_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> HW0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW1`"] -pub type HW1_R = crate::R; +#[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] +pub struct HW1_R(crate::FieldReader); impl HW1_R { + pub(crate) fn new(bits: u8) -> Self { + HW1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW1_A::VALUE1), - 1 => Val(HW1_A::VALUE2), - 2 => Val(HW1_A::VALUE3), - i => Res(i), + 0 => Some(HW1_A::VALUE1), + 1 => Some(HW1_A::VALUE2), + 2 => Some(HW1_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW1_A::VALUE1 + **self == HW1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW1_A::VALUE2 + **self == HW1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW1_A::VALUE3 + **self == HW1_A::VALUE3 + } +} +impl core::ops::Deref for HW1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW1`"] +#[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] pub struct HW1_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> HW1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -185,37 +227,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW2`"] -pub type HW2_R = crate::R; +#[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] +pub struct HW2_R(crate::FieldReader); impl HW2_R { + pub(crate) fn new(bits: u8) -> Self { + HW2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW2_A::VALUE1), - 1 => Val(HW2_A::VALUE2), - 2 => Val(HW2_A::VALUE3), - i => Res(i), + 0 => Some(HW2_A::VALUE1), + 1 => Some(HW2_A::VALUE2), + 2 => Some(HW2_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW2_A::VALUE1 + **self == HW2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW2_A::VALUE2 + **self == HW2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW2_A::VALUE3 + **self == HW2_A::VALUE3 + } +} +impl core::ops::Deref for HW2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW2`"] +#[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] pub struct HW2_W<'a> { w: &'a mut W, } @@ -243,7 +294,7 @@ impl<'a> HW2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -264,37 +315,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW3`"] -pub type HW3_R = crate::R; +#[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] +pub struct HW3_R(crate::FieldReader); impl HW3_R { + pub(crate) fn new(bits: u8) -> Self { + HW3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW3_A::VALUE1), - 1 => Val(HW3_A::VALUE2), - 2 => Val(HW3_A::VALUE3), - i => Res(i), + 0 => Some(HW3_A::VALUE1), + 1 => Some(HW3_A::VALUE2), + 2 => Some(HW3_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW3_A::VALUE1 + **self == HW3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW3_A::VALUE2 + **self == HW3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW3_A::VALUE3 + **self == HW3_A::VALUE3 } } -#[doc = "Write proxy for field `HW3`"] +impl core::ops::Deref for HW3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] pub struct HW3_W<'a> { w: &'a mut W, } @@ -322,7 +382,7 @@ impl<'a> HW3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -343,37 +403,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW4`"] -pub type HW4_R = crate::R; +#[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] +pub struct HW4_R(crate::FieldReader); impl HW4_R { + pub(crate) fn new(bits: u8) -> Self { + HW4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW4_A::VALUE1), - 1 => Val(HW4_A::VALUE2), - 2 => Val(HW4_A::VALUE3), - i => Res(i), + 0 => Some(HW4_A::VALUE1), + 1 => Some(HW4_A::VALUE2), + 2 => Some(HW4_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW4_A::VALUE1 + **self == HW4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW4_A::VALUE2 + **self == HW4_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW4_A::VALUE3 + **self == HW4_A::VALUE3 + } +} +impl core::ops::Deref for HW4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW4`"] +#[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] pub struct HW4_W<'a> { w: &'a mut W, } @@ -401,7 +470,7 @@ impl<'a> HW4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -422,37 +491,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW5`"] -pub type HW5_R = crate::R; +#[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] +pub struct HW5_R(crate::FieldReader); impl HW5_R { + pub(crate) fn new(bits: u8) -> Self { + HW5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW5_A::VALUE1), - 1 => Val(HW5_A::VALUE2), - 2 => Val(HW5_A::VALUE3), - i => Res(i), + 0 => Some(HW5_A::VALUE1), + 1 => Some(HW5_A::VALUE2), + 2 => Some(HW5_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW5_A::VALUE1 + **self == HW5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW5_A::VALUE2 + **self == HW5_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW5_A::VALUE3 + **self == HW5_A::VALUE3 + } +} +impl core::ops::Deref for HW5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW5`"] +#[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] pub struct HW5_W<'a> { w: &'a mut W, } @@ -480,7 +558,7 @@ impl<'a> HW5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -501,37 +579,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW6`"] -pub type HW6_R = crate::R; +#[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] +pub struct HW6_R(crate::FieldReader); impl HW6_R { + pub(crate) fn new(bits: u8) -> Self { + HW6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW6_A::VALUE1), - 1 => Val(HW6_A::VALUE2), - 2 => Val(HW6_A::VALUE3), - i => Res(i), + 0 => Some(HW6_A::VALUE1), + 1 => Some(HW6_A::VALUE2), + 2 => Some(HW6_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW6_A::VALUE1 + **self == HW6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW6_A::VALUE2 + **self == HW6_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW6_A::VALUE3 + **self == HW6_A::VALUE3 } } -#[doc = "Write proxy for field `HW6`"] +impl core::ops::Deref for HW6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] pub struct HW6_W<'a> { w: &'a mut W, } @@ -559,7 +646,7 @@ impl<'a> HW6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -580,37 +667,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW7`"] -pub type HW7_R = crate::R; +#[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] +pub struct HW7_R(crate::FieldReader); impl HW7_R { + pub(crate) fn new(bits: u8) -> Self { + HW7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW7_A::VALUE1), - 1 => Val(HW7_A::VALUE2), - 2 => Val(HW7_A::VALUE3), - i => Res(i), + 0 => Some(HW7_A::VALUE1), + 1 => Some(HW7_A::VALUE2), + 2 => Some(HW7_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW7_A::VALUE1 + **self == HW7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW7_A::VALUE2 + **self == HW7_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW7_A::VALUE3 + **self == HW7_A::VALUE3 } } -#[doc = "Write proxy for field `HW7`"] +impl core::ops::Deref for HW7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] pub struct HW7_W<'a> { w: &'a mut W, } @@ -638,7 +734,7 @@ impl<'a> HW7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } @@ -659,37 +755,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW8`"] -pub type HW8_R = crate::R; +#[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] +pub struct HW8_R(crate::FieldReader); impl HW8_R { + pub(crate) fn new(bits: u8) -> Self { + HW8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW8_A::VALUE1), - 1 => Val(HW8_A::VALUE2), - 2 => Val(HW8_A::VALUE3), - i => Res(i), + 0 => Some(HW8_A::VALUE1), + 1 => Some(HW8_A::VALUE2), + 2 => Some(HW8_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW8_A::VALUE1 + **self == HW8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW8_A::VALUE2 + **self == HW8_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW8_A::VALUE3 + **self == HW8_A::VALUE3 + } +} +impl core::ops::Deref for HW8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW8`"] +#[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] pub struct HW8_W<'a> { w: &'a mut W, } @@ -717,7 +822,7 @@ impl<'a> HW8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -738,37 +843,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW9`"] -pub type HW9_R = crate::R; +#[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] +pub struct HW9_R(crate::FieldReader); impl HW9_R { + pub(crate) fn new(bits: u8) -> Self { + HW9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW9_A::VALUE1), - 1 => Val(HW9_A::VALUE2), - 2 => Val(HW9_A::VALUE3), - i => Res(i), + 0 => Some(HW9_A::VALUE1), + 1 => Some(HW9_A::VALUE2), + 2 => Some(HW9_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW9_A::VALUE1 + **self == HW9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW9_A::VALUE2 + **self == HW9_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW9_A::VALUE3 + **self == HW9_A::VALUE3 } } -#[doc = "Write proxy for field `HW9`"] +impl core::ops::Deref for HW9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] pub struct HW9_W<'a> { w: &'a mut W, } @@ -796,7 +910,7 @@ impl<'a> HW9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } @@ -817,37 +931,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW10`"] -pub type HW10_R = crate::R; +#[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] +pub struct HW10_R(crate::FieldReader); impl HW10_R { + pub(crate) fn new(bits: u8) -> Self { + HW10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW10_A::VALUE1), - 1 => Val(HW10_A::VALUE2), - 2 => Val(HW10_A::VALUE3), - i => Res(i), + 0 => Some(HW10_A::VALUE1), + 1 => Some(HW10_A::VALUE2), + 2 => Some(HW10_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW10_A::VALUE1 + **self == HW10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW10_A::VALUE2 + **self == HW10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW10_A::VALUE3 + **self == HW10_A::VALUE3 } } -#[doc = "Write proxy for field `HW10`"] +impl core::ops::Deref for HW10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] pub struct HW10_W<'a> { w: &'a mut W, } @@ -875,7 +998,7 @@ impl<'a> HW10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -896,37 +1019,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW11`"] -pub type HW11_R = crate::R; +#[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] +pub struct HW11_R(crate::FieldReader); impl HW11_R { + pub(crate) fn new(bits: u8) -> Self { + HW11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW11_A::VALUE1), - 1 => Val(HW11_A::VALUE2), - 2 => Val(HW11_A::VALUE3), - i => Res(i), + 0 => Some(HW11_A::VALUE1), + 1 => Some(HW11_A::VALUE2), + 2 => Some(HW11_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW11_A::VALUE1 + **self == HW11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW11_A::VALUE2 + **self == HW11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW11_A::VALUE3 + **self == HW11_A::VALUE3 } } -#[doc = "Write proxy for field `HW11`"] +impl core::ops::Deref for HW11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] pub struct HW11_W<'a> { w: &'a mut W, } @@ -954,7 +1086,7 @@ impl<'a> HW11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -975,37 +1107,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW12`"] -pub type HW12_R = crate::R; +#[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] +pub struct HW12_R(crate::FieldReader); impl HW12_R { + pub(crate) fn new(bits: u8) -> Self { + HW12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW12_A::VALUE1), - 1 => Val(HW12_A::VALUE2), - 2 => Val(HW12_A::VALUE3), - i => Res(i), + 0 => Some(HW12_A::VALUE1), + 1 => Some(HW12_A::VALUE2), + 2 => Some(HW12_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW12_A::VALUE1 + **self == HW12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW12_A::VALUE2 + **self == HW12_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW12_A::VALUE3 + **self == HW12_A::VALUE3 + } +} +impl core::ops::Deref for HW12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW12`"] +#[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] pub struct HW12_W<'a> { w: &'a mut W, } @@ -1033,7 +1174,7 @@ impl<'a> HW12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1054,37 +1195,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW13`"] -pub type HW13_R = crate::R; +#[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] +pub struct HW13_R(crate::FieldReader); impl HW13_R { + pub(crate) fn new(bits: u8) -> Self { + HW13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW13_A::VALUE1), - 1 => Val(HW13_A::VALUE2), - 2 => Val(HW13_A::VALUE3), - i => Res(i), + 0 => Some(HW13_A::VALUE1), + 1 => Some(HW13_A::VALUE2), + 2 => Some(HW13_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW13_A::VALUE1 + **self == HW13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW13_A::VALUE2 + **self == HW13_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW13_A::VALUE3 + **self == HW13_A::VALUE3 + } +} +impl core::ops::Deref for HW13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HW13`"] +#[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] pub struct HW13_W<'a> { w: &'a mut W, } @@ -1112,7 +1262,7 @@ impl<'a> HW13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -1133,37 +1283,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW14`"] -pub type HW14_R = crate::R; +#[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] +pub struct HW14_R(crate::FieldReader); impl HW14_R { + pub(crate) fn new(bits: u8) -> Self { + HW14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW14_A::VALUE1), - 1 => Val(HW14_A::VALUE2), - 2 => Val(HW14_A::VALUE3), - i => Res(i), + 0 => Some(HW14_A::VALUE1), + 1 => Some(HW14_A::VALUE2), + 2 => Some(HW14_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW14_A::VALUE1 + **self == HW14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW14_A::VALUE2 + **self == HW14_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW14_A::VALUE3 + **self == HW14_A::VALUE3 } } -#[doc = "Write proxy for field `HW14`"] +impl core::ops::Deref for HW14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] pub struct HW14_W<'a> { w: &'a mut W, } @@ -1191,7 +1350,7 @@ impl<'a> HW14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -1212,37 +1371,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HW15`"] -pub type HW15_R = crate::R; +#[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] +pub struct HW15_R(crate::FieldReader); impl HW15_R { + pub(crate) fn new(bits: u8) -> Self { + HW15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HW15_A::VALUE1), - 1 => Val(HW15_A::VALUE2), - 2 => Val(HW15_A::VALUE3), - i => Res(i), + 0 => Some(HW15_A::VALUE1), + 1 => Some(HW15_A::VALUE2), + 2 => Some(HW15_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HW15_A::VALUE1 + **self == HW15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HW15_A::VALUE2 + **self == HW15_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HW15_A::VALUE3 + **self == HW15_A::VALUE3 } } -#[doc = "Write proxy for field `HW15`"] +impl core::ops::Deref for HW15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] pub struct HW15_W<'a> { w: &'a mut W, } @@ -1270,7 +1438,7 @@ impl<'a> HW15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -1437,4 +1605,30 @@ impl W { pub fn hw15(&mut self) -> HW15_W { HW15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Pin Hardware Select Register\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 [hwsel](index.html) module"] +pub struct HWSEL_SPEC; +impl crate::RegisterSpec for HWSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hwsel::R](R) reader structure"] +impl crate::Readable for HWSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hwsel::W](W) writer structure"] +impl crate::Writable for HWSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HWSEL to value 0"] +impl crate::Resettable for HWSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port3/in_.rs b/src/port3/in_.rs index 344607dc..540369e6 100644 --- a/src/port3/in_.rs +++ b/src/port3/in_.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register IN"] -pub type R = crate::R; +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum P0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Input Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -28,12 +44,19 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 + } +} +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Input Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -64,12 +90,19 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 + } +} +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Input Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -100,12 +136,19 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Input Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -136,12 +182,19 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Input Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -172,12 +228,19 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Input Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -208,12 +274,19 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Input Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -244,12 +320,19 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 + } +} +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Input Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -280,12 +366,19 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 + } +} +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Input Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -316,12 +412,19 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 + } +} +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Input Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -352,12 +458,19 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Input Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -388,12 +504,19 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 + } +} +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Input Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -424,12 +550,19 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 + } +} +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Input Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -460,12 +596,19 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Input Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -496,12 +642,19 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 + } +} +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Input Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -532,12 +688,19 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 + } +} +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Port n Input Bit 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Input Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -568,12 +734,19 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 + } +} +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { P15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 3 Input Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port3/iocr0.rs b/src/port3/iocr0.rs index ea51a257..9ac52965 100644 --- a/src/port3/iocr0.rs +++ b/src/port3/iocr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register IOCR0"] -pub type R = crate::R; -#[doc = "Writer for register IOCR0"] -pub type W = crate::W; -#[doc = "Register IOCR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::IOCR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `IOCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IOCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] @@ -57,127 +81,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC0`"] -pub type PC0_R = crate::R; +#[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC0_R(crate::FieldReader); impl PC0_R { + pub(crate) fn new(bits: u8) -> Self { + PC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC0_A::VALUE1), - 1 => Val(PC0_A::VALUE2), - 2 => Val(PC0_A::VALUE3), - 3 => Val(PC0_A::VALUE4), - 4 => Val(PC0_A::VALUE5), - 5 => Val(PC0_A::VALUE6), - 6 => Val(PC0_A::VALUE7), - 7 => Val(PC0_A::VALUE8), - 16 => Val(PC0_A::VALUE9), - 17 => Val(PC0_A::VALUE10), - 18 => Val(PC0_A::VALUE11), - 19 => Val(PC0_A::VALUE12), - 20 => Val(PC0_A::VALUE13), - 24 => Val(PC0_A::VALUE14), - 25 => Val(PC0_A::VALUE15), - 26 => Val(PC0_A::VALUE16), - 27 => Val(PC0_A::VALUE17), - 28 => Val(PC0_A::VALUE18), - i => Res(i), + 0 => Some(PC0_A::VALUE1), + 1 => Some(PC0_A::VALUE2), + 2 => Some(PC0_A::VALUE3), + 3 => Some(PC0_A::VALUE4), + 4 => Some(PC0_A::VALUE5), + 5 => Some(PC0_A::VALUE6), + 6 => Some(PC0_A::VALUE7), + 7 => Some(PC0_A::VALUE8), + 16 => Some(PC0_A::VALUE9), + 17 => Some(PC0_A::VALUE10), + 18 => Some(PC0_A::VALUE11), + 19 => Some(PC0_A::VALUE12), + 20 => Some(PC0_A::VALUE13), + 24 => Some(PC0_A::VALUE14), + 25 => Some(PC0_A::VALUE15), + 26 => Some(PC0_A::VALUE16), + 27 => Some(PC0_A::VALUE17), + 28 => Some(PC0_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC0_A::VALUE1 + **self == PC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC0_A::VALUE2 + **self == PC0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC0_A::VALUE3 + **self == PC0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC0_A::VALUE4 + **self == PC0_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC0_A::VALUE5 + **self == PC0_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC0_A::VALUE6 + **self == PC0_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC0_A::VALUE7 + **self == PC0_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC0_A::VALUE8 + **self == PC0_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC0_A::VALUE9 + **self == PC0_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC0_A::VALUE10 + **self == PC0_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC0_A::VALUE11 + **self == PC0_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC0_A::VALUE12 + **self == PC0_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC0_A::VALUE13 + **self == PC0_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC0_A::VALUE14 + **self == PC0_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC0_A::VALUE15 + **self == PC0_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC0_A::VALUE16 + **self == PC0_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC0_A::VALUE17 + **self == PC0_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC0_A::VALUE18 + **self == PC0_A::VALUE18 } } -#[doc = "Write proxy for field `PC0`"] +impl core::ops::Deref for PC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] pub struct PC0_W<'a> { w: &'a mut W, } @@ -280,7 +313,7 @@ impl<'a> PC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 3)) | (((value as u32) & 0x1f) << 3); + self.w.bits = (self.w.bits & !(0x1f << 3)) | ((value as u32 & 0x1f) << 3); self.w } } @@ -331,127 +364,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC1`"] -pub type PC1_R = crate::R; +#[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC1_R(crate::FieldReader); impl PC1_R { + pub(crate) fn new(bits: u8) -> Self { + PC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC1_A::VALUE1), - 1 => Val(PC1_A::VALUE2), - 2 => Val(PC1_A::VALUE3), - 3 => Val(PC1_A::VALUE4), - 4 => Val(PC1_A::VALUE5), - 5 => Val(PC1_A::VALUE6), - 6 => Val(PC1_A::VALUE7), - 7 => Val(PC1_A::VALUE8), - 16 => Val(PC1_A::VALUE9), - 17 => Val(PC1_A::VALUE10), - 18 => Val(PC1_A::VALUE11), - 19 => Val(PC1_A::VALUE12), - 20 => Val(PC1_A::VALUE13), - 24 => Val(PC1_A::VALUE14), - 25 => Val(PC1_A::VALUE15), - 26 => Val(PC1_A::VALUE16), - 27 => Val(PC1_A::VALUE17), - 28 => Val(PC1_A::VALUE18), - i => Res(i), + 0 => Some(PC1_A::VALUE1), + 1 => Some(PC1_A::VALUE2), + 2 => Some(PC1_A::VALUE3), + 3 => Some(PC1_A::VALUE4), + 4 => Some(PC1_A::VALUE5), + 5 => Some(PC1_A::VALUE6), + 6 => Some(PC1_A::VALUE7), + 7 => Some(PC1_A::VALUE8), + 16 => Some(PC1_A::VALUE9), + 17 => Some(PC1_A::VALUE10), + 18 => Some(PC1_A::VALUE11), + 19 => Some(PC1_A::VALUE12), + 20 => Some(PC1_A::VALUE13), + 24 => Some(PC1_A::VALUE14), + 25 => Some(PC1_A::VALUE15), + 26 => Some(PC1_A::VALUE16), + 27 => Some(PC1_A::VALUE17), + 28 => Some(PC1_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC1_A::VALUE1 + **self == PC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC1_A::VALUE2 + **self == PC1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC1_A::VALUE3 + **self == PC1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC1_A::VALUE4 + **self == PC1_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC1_A::VALUE5 + **self == PC1_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC1_A::VALUE6 + **self == PC1_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC1_A::VALUE7 + **self == PC1_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC1_A::VALUE8 + **self == PC1_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC1_A::VALUE9 + **self == PC1_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC1_A::VALUE10 + **self == PC1_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC1_A::VALUE11 + **self == PC1_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC1_A::VALUE12 + **self == PC1_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC1_A::VALUE13 + **self == PC1_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC1_A::VALUE14 + **self == PC1_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC1_A::VALUE15 + **self == PC1_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC1_A::VALUE16 + **self == PC1_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC1_A::VALUE17 + **self == PC1_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC1_A::VALUE18 + **self == PC1_A::VALUE18 } } -#[doc = "Write proxy for field `PC1`"] +impl core::ops::Deref for PC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] pub struct PC1_W<'a> { w: &'a mut W, } @@ -554,7 +596,7 @@ impl<'a> PC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11); + self.w.bits = (self.w.bits & !(0x1f << 11)) | ((value as u32 & 0x1f) << 11); self.w } } @@ -605,127 +647,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC2`"] -pub type PC2_R = crate::R; +#[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC2_R(crate::FieldReader); impl PC2_R { + pub(crate) fn new(bits: u8) -> Self { + PC2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC2_A::VALUE1), - 1 => Val(PC2_A::VALUE2), - 2 => Val(PC2_A::VALUE3), - 3 => Val(PC2_A::VALUE4), - 4 => Val(PC2_A::VALUE5), - 5 => Val(PC2_A::VALUE6), - 6 => Val(PC2_A::VALUE7), - 7 => Val(PC2_A::VALUE8), - 16 => Val(PC2_A::VALUE9), - 17 => Val(PC2_A::VALUE10), - 18 => Val(PC2_A::VALUE11), - 19 => Val(PC2_A::VALUE12), - 20 => Val(PC2_A::VALUE13), - 24 => Val(PC2_A::VALUE14), - 25 => Val(PC2_A::VALUE15), - 26 => Val(PC2_A::VALUE16), - 27 => Val(PC2_A::VALUE17), - 28 => Val(PC2_A::VALUE18), - i => Res(i), + 0 => Some(PC2_A::VALUE1), + 1 => Some(PC2_A::VALUE2), + 2 => Some(PC2_A::VALUE3), + 3 => Some(PC2_A::VALUE4), + 4 => Some(PC2_A::VALUE5), + 5 => Some(PC2_A::VALUE6), + 6 => Some(PC2_A::VALUE7), + 7 => Some(PC2_A::VALUE8), + 16 => Some(PC2_A::VALUE9), + 17 => Some(PC2_A::VALUE10), + 18 => Some(PC2_A::VALUE11), + 19 => Some(PC2_A::VALUE12), + 20 => Some(PC2_A::VALUE13), + 24 => Some(PC2_A::VALUE14), + 25 => Some(PC2_A::VALUE15), + 26 => Some(PC2_A::VALUE16), + 27 => Some(PC2_A::VALUE17), + 28 => Some(PC2_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC2_A::VALUE1 + **self == PC2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC2_A::VALUE2 + **self == PC2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC2_A::VALUE3 + **self == PC2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC2_A::VALUE4 + **self == PC2_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC2_A::VALUE5 + **self == PC2_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC2_A::VALUE6 + **self == PC2_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC2_A::VALUE7 + **self == PC2_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC2_A::VALUE8 + **self == PC2_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC2_A::VALUE9 + **self == PC2_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC2_A::VALUE10 + **self == PC2_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC2_A::VALUE11 + **self == PC2_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC2_A::VALUE12 + **self == PC2_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC2_A::VALUE13 + **self == PC2_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC2_A::VALUE14 + **self == PC2_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC2_A::VALUE15 + **self == PC2_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC2_A::VALUE16 + **self == PC2_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC2_A::VALUE17 + **self == PC2_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC2_A::VALUE18 + **self == PC2_A::VALUE18 + } +} +impl core::ops::Deref for PC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC2`"] +#[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] pub struct PC2_W<'a> { w: &'a mut W, } @@ -828,7 +879,7 @@ impl<'a> PC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 19)) | (((value as u32) & 0x1f) << 19); + self.w.bits = (self.w.bits & !(0x1f << 19)) | ((value as u32 & 0x1f) << 19); self.w } } @@ -879,127 +930,136 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PC3`"] -pub type PC3_R = crate::R; +#[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] +pub struct PC3_R(crate::FieldReader); impl PC3_R { + pub(crate) fn new(bits: u8) -> Self { + PC3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PC3_A::VALUE1), - 1 => Val(PC3_A::VALUE2), - 2 => Val(PC3_A::VALUE3), - 3 => Val(PC3_A::VALUE4), - 4 => Val(PC3_A::VALUE5), - 5 => Val(PC3_A::VALUE6), - 6 => Val(PC3_A::VALUE7), - 7 => Val(PC3_A::VALUE8), - 16 => Val(PC3_A::VALUE9), - 17 => Val(PC3_A::VALUE10), - 18 => Val(PC3_A::VALUE11), - 19 => Val(PC3_A::VALUE12), - 20 => Val(PC3_A::VALUE13), - 24 => Val(PC3_A::VALUE14), - 25 => Val(PC3_A::VALUE15), - 26 => Val(PC3_A::VALUE16), - 27 => Val(PC3_A::VALUE17), - 28 => Val(PC3_A::VALUE18), - i => Res(i), + 0 => Some(PC3_A::VALUE1), + 1 => Some(PC3_A::VALUE2), + 2 => Some(PC3_A::VALUE3), + 3 => Some(PC3_A::VALUE4), + 4 => Some(PC3_A::VALUE5), + 5 => Some(PC3_A::VALUE6), + 6 => Some(PC3_A::VALUE7), + 7 => Some(PC3_A::VALUE8), + 16 => Some(PC3_A::VALUE9), + 17 => Some(PC3_A::VALUE10), + 18 => Some(PC3_A::VALUE11), + 19 => Some(PC3_A::VALUE12), + 20 => Some(PC3_A::VALUE13), + 24 => Some(PC3_A::VALUE14), + 25 => Some(PC3_A::VALUE15), + 26 => Some(PC3_A::VALUE16), + 27 => Some(PC3_A::VALUE17), + 28 => Some(PC3_A::VALUE18), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PC3_A::VALUE1 + **self == PC3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PC3_A::VALUE2 + **self == PC3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PC3_A::VALUE3 + **self == PC3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PC3_A::VALUE4 + **self == PC3_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PC3_A::VALUE5 + **self == PC3_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == PC3_A::VALUE6 + **self == PC3_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == PC3_A::VALUE7 + **self == PC3_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == PC3_A::VALUE8 + **self == PC3_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == PC3_A::VALUE9 + **self == PC3_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == PC3_A::VALUE10 + **self == PC3_A::VALUE10 } #[doc = "Checks if the value of the field is `VALUE11`"] #[inline(always)] pub fn is_value11(&self) -> bool { - *self == PC3_A::VALUE11 + **self == PC3_A::VALUE11 } #[doc = "Checks if the value of the field is `VALUE12`"] #[inline(always)] pub fn is_value12(&self) -> bool { - *self == PC3_A::VALUE12 + **self == PC3_A::VALUE12 } #[doc = "Checks if the value of the field is `VALUE13`"] #[inline(always)] pub fn is_value13(&self) -> bool { - *self == PC3_A::VALUE13 + **self == PC3_A::VALUE13 } #[doc = "Checks if the value of the field is `VALUE14`"] #[inline(always)] pub fn is_value14(&self) -> bool { - *self == PC3_A::VALUE14 + **self == PC3_A::VALUE14 } #[doc = "Checks if the value of the field is `VALUE15`"] #[inline(always)] pub fn is_value15(&self) -> bool { - *self == PC3_A::VALUE15 + **self == PC3_A::VALUE15 } #[doc = "Checks if the value of the field is `VALUE16`"] #[inline(always)] pub fn is_value16(&self) -> bool { - *self == PC3_A::VALUE16 + **self == PC3_A::VALUE16 } #[doc = "Checks if the value of the field is `VALUE17`"] #[inline(always)] pub fn is_value17(&self) -> bool { - *self == PC3_A::VALUE17 + **self == PC3_A::VALUE17 } #[doc = "Checks if the value of the field is `VALUE18`"] #[inline(always)] pub fn is_value18(&self) -> bool { - *self == PC3_A::VALUE18 + **self == PC3_A::VALUE18 + } +} +impl core::ops::Deref for PC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PC3`"] +#[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] pub struct PC3_W<'a> { w: &'a mut W, } @@ -1102,7 +1162,7 @@ impl<'a> PC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 27)) | (((value as u32) & 0x1f) << 27); + self.w.bits = (self.w.bits & !(0x1f << 27)) | ((value as u32 & 0x1f) << 27); self.w } } @@ -1149,4 +1209,30 @@ impl W { pub fn pc3(&mut self) -> PC3_W { PC3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Input/Output Control Register 0\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 [iocr0](index.html) module"] +pub struct IOCR0_SPEC; +impl crate::RegisterSpec for IOCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iocr0::R](R) reader structure"] +impl crate::Readable for IOCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iocr0::W](W) writer structure"] +impl crate::Writable for IOCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IOCR0 to value 0"] +impl crate::Resettable for IOCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port3/omr.rs b/src/port3/omr.rs index c8c458f2..e20dd88e 100644 --- a/src/port3/omr.rs +++ b/src/port3/omr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register OMR"] -pub type W = crate::W; -#[doc = "Register OMR `reset()`'s with value 0"] -impl crate::ResetValue for super::OMR { - type Type = u32; +#[doc = "Register `OMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `PS0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PS0` writer - Port n Set Bit 0"] pub struct PS0_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> PS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `PS1`"] +#[doc = "Field `PS1` writer - Port n Set Bit 1"] pub struct PS1_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> PS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `PS2`"] +#[doc = "Field `PS2` writer - Port n Set Bit 2"] pub struct PS2_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> PS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `PS3`"] +#[doc = "Field `PS3` writer - Port n Set Bit 3"] pub struct PS3_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> PS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `PS4`"] +#[doc = "Field `PS4` writer - Port n Set Bit 4"] pub struct PS4_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> PS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PS5`"] +#[doc = "Field `PS5` writer - Port n Set Bit 5"] pub struct PS5_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> PS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `PS6`"] +#[doc = "Field `PS6` writer - Port n Set Bit 6"] pub struct PS6_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> PS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `PS7`"] +#[doc = "Field `PS7` writer - Port n Set Bit 7"] pub struct PS7_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> PS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `PS8`"] +#[doc = "Field `PS8` writer - Port n Set Bit 8"] pub struct PS8_W<'a> { w: &'a mut W, } @@ -202,11 +213,11 @@ impl<'a> PS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `PS9`"] +#[doc = "Field `PS9` writer - Port n Set Bit 9"] pub struct PS9_W<'a> { w: &'a mut W, } @@ -224,11 +235,11 @@ impl<'a> PS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `PS10`"] +#[doc = "Field `PS10` writer - Port n Set Bit 10"] pub struct PS10_W<'a> { w: &'a mut W, } @@ -246,11 +257,11 @@ impl<'a> PS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `PS11`"] +#[doc = "Field `PS11` writer - Port n Set Bit 11"] pub struct PS11_W<'a> { w: &'a mut W, } @@ -268,11 +279,11 @@ impl<'a> PS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `PS12`"] +#[doc = "Field `PS12` writer - Port n Set Bit 12"] pub struct PS12_W<'a> { w: &'a mut W, } @@ -290,11 +301,11 @@ impl<'a> PS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Write proxy for field `PS13`"] +#[doc = "Field `PS13` writer - Port n Set Bit 13"] pub struct PS13_W<'a> { w: &'a mut W, } @@ -312,11 +323,11 @@ impl<'a> PS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Write proxy for field `PS14`"] +#[doc = "Field `PS14` writer - Port n Set Bit 14"] pub struct PS14_W<'a> { w: &'a mut W, } @@ -334,11 +345,11 @@ impl<'a> PS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Write proxy for field `PS15`"] +#[doc = "Field `PS15` writer - Port n Set Bit 15"] pub struct PS15_W<'a> { w: &'a mut W, } @@ -356,11 +367,11 @@ impl<'a> PS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Write proxy for field `PR0`"] +#[doc = "Field `PR0` writer - Port n Reset Bit 0"] pub struct PR0_W<'a> { w: &'a mut W, } @@ -378,11 +389,11 @@ impl<'a> PR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `PR1`"] +#[doc = "Field `PR1` writer - Port n Reset Bit 1"] pub struct PR1_W<'a> { w: &'a mut W, } @@ -400,11 +411,11 @@ impl<'a> PR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `PR2`"] +#[doc = "Field `PR2` writer - Port n Reset Bit 2"] pub struct PR2_W<'a> { w: &'a mut W, } @@ -422,11 +433,11 @@ impl<'a> PR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Write proxy for field `PR3`"] +#[doc = "Field `PR3` writer - Port n Reset Bit 3"] pub struct PR3_W<'a> { w: &'a mut W, } @@ -444,11 +455,11 @@ impl<'a> PR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Write proxy for field `PR4`"] +#[doc = "Field `PR4` writer - Port n Reset Bit 4"] pub struct PR4_W<'a> { w: &'a mut W, } @@ -466,11 +477,11 @@ impl<'a> PR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Write proxy for field `PR5`"] +#[doc = "Field `PR5` writer - Port n Reset Bit 5"] pub struct PR5_W<'a> { w: &'a mut W, } @@ -488,11 +499,11 @@ impl<'a> PR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `PR6`"] +#[doc = "Field `PR6` writer - Port n Reset Bit 6"] pub struct PR6_W<'a> { w: &'a mut W, } @@ -510,11 +521,11 @@ impl<'a> PR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Write proxy for field `PR7`"] +#[doc = "Field `PR7` writer - Port n Reset Bit 7"] pub struct PR7_W<'a> { w: &'a mut W, } @@ -532,11 +543,11 @@ impl<'a> PR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Write proxy for field `PR8`"] +#[doc = "Field `PR8` writer - Port n Reset Bit 8"] pub struct PR8_W<'a> { w: &'a mut W, } @@ -554,11 +565,11 @@ impl<'a> PR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Write proxy for field `PR9`"] +#[doc = "Field `PR9` writer - Port n Reset Bit 9"] pub struct PR9_W<'a> { w: &'a mut W, } @@ -576,11 +587,11 @@ impl<'a> PR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Write proxy for field `PR10`"] +#[doc = "Field `PR10` writer - Port n Reset Bit 10"] pub struct PR10_W<'a> { w: &'a mut W, } @@ -598,11 +609,11 @@ impl<'a> PR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `PR11`"] +#[doc = "Field `PR11` writer - Port n Reset Bit 11"] pub struct PR11_W<'a> { w: &'a mut W, } @@ -620,11 +631,11 @@ impl<'a> PR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `PR12`"] +#[doc = "Field `PR12` writer - Port n Reset Bit 12"] pub struct PR12_W<'a> { w: &'a mut W, } @@ -642,11 +653,11 @@ impl<'a> PR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `PR13`"] +#[doc = "Field `PR13` writer - Port n Reset Bit 13"] pub struct PR13_W<'a> { w: &'a mut W, } @@ -664,11 +675,11 @@ impl<'a> PR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Write proxy for field `PR14`"] +#[doc = "Field `PR14` writer - Port n Reset Bit 14"] pub struct PR14_W<'a> { w: &'a mut W, } @@ -686,11 +697,11 @@ impl<'a> PR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Write proxy for field `PR15`"] +#[doc = "Field `PR15` writer - Port n Reset Bit 15"] pub struct PR15_W<'a> { w: &'a mut W, } @@ -708,7 +719,7 @@ impl<'a> PR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -873,4 +884,26 @@ impl W { pub fn pr15(&mut self) -> PR15_W { PR15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Output Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [omr](index.html) module"] +pub struct OMR_SPEC; +impl crate::RegisterSpec for OMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +impl crate::Writable for OMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OMR to value 0"] +impl crate::Resettable for OMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port3/out.rs b/src/port3/out.rs index 234afddb..67f3c049 100644 --- a/src/port3/out.rs +++ b/src/port3/out.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OUT"] -pub type R = crate::R; -#[doc = "Writer for register OUT"] -pub type W = crate::W; -#[doc = "Register OUT `reset()`'s with value 0"] -impl crate::ResetValue for super::OUT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P0`"] -pub type P0_R = crate::R; +#[doc = "Field `P0` reader - Port n Output Bit 0"] +pub struct P0_R(crate::FieldReader); impl P0_R { + pub(crate) fn new(bits: bool) -> Self { + P0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P0_A { @@ -38,15 +65,22 @@ impl P0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P0_A::VALUE1 + **self == P0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P0_A::VALUE2 + **self == P0_A::VALUE2 } } -#[doc = "Write proxy for field `P0`"] +impl core::ops::Deref for P0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P0` writer - Port n Output Bit 0"] pub struct P0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> P0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P1`"] -pub type P1_R = crate::R; +#[doc = "Field `P1` reader - Port n Output Bit 1"] +pub struct P1_R(crate::FieldReader); impl P1_R { + pub(crate) fn new(bits: bool) -> Self { + P1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P1_A { @@ -113,15 +148,22 @@ impl P1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P1_A::VALUE1 + **self == P1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P1_A::VALUE2 + **self == P1_A::VALUE2 } } -#[doc = "Write proxy for field `P1`"] +impl core::ops::Deref for P1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P1` writer - Port n Output Bit 1"] pub struct P1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> P1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P2`"] -pub type P2_R = crate::R; +#[doc = "Field `P2` reader - Port n Output Bit 2"] +pub struct P2_R(crate::FieldReader); impl P2_R { + pub(crate) fn new(bits: bool) -> Self { + P2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P2_A { @@ -188,15 +231,22 @@ impl P2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P2_A::VALUE1 + **self == P2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P2_A::VALUE2 + **self == P2_A::VALUE2 + } +} +impl core::ops::Deref for P2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P2`"] +#[doc = "Field `P2` writer - Port n Output Bit 2"] pub struct P2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> P2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P3`"] -pub type P3_R = crate::R; +#[doc = "Field `P3` reader - Port n Output Bit 3"] +pub struct P3_R(crate::FieldReader); impl P3_R { + pub(crate) fn new(bits: bool) -> Self { + P3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P3_A { @@ -263,15 +314,22 @@ impl P3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P3_A::VALUE1 + **self == P3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P3_A::VALUE2 + **self == P3_A::VALUE2 + } +} +impl core::ops::Deref for P3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P3`"] +#[doc = "Field `P3` writer - Port n Output Bit 3"] pub struct P3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> P3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P4`"] -pub type P4_R = crate::R; +#[doc = "Field `P4` reader - Port n Output Bit 4"] +pub struct P4_R(crate::FieldReader); impl P4_R { + pub(crate) fn new(bits: bool) -> Self { + P4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P4_A { @@ -338,15 +397,22 @@ impl P4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P4_A::VALUE1 + **self == P4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P4_A::VALUE2 + **self == P4_A::VALUE2 + } +} +impl core::ops::Deref for P4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P4`"] +#[doc = "Field `P4` writer - Port n Output Bit 4"] pub struct P4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> P4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P5`"] -pub type P5_R = crate::R; +#[doc = "Field `P5` reader - Port n Output Bit 5"] +pub struct P5_R(crate::FieldReader); impl P5_R { + pub(crate) fn new(bits: bool) -> Self { + P5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P5_A { @@ -413,15 +480,22 @@ impl P5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P5_A::VALUE1 + **self == P5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P5_A::VALUE2 + **self == P5_A::VALUE2 + } +} +impl core::ops::Deref for P5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P5`"] +#[doc = "Field `P5` writer - Port n Output Bit 5"] pub struct P5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> P5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P6`"] -pub type P6_R = crate::R; +#[doc = "Field `P6` reader - Port n Output Bit 6"] +pub struct P6_R(crate::FieldReader); impl P6_R { + pub(crate) fn new(bits: bool) -> Self { + P6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P6_A { @@ -488,15 +563,22 @@ impl P6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P6_A::VALUE1 + **self == P6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P6_A::VALUE2 + **self == P6_A::VALUE2 } } -#[doc = "Write proxy for field `P6`"] +impl core::ops::Deref for P6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P6` writer - Port n Output Bit 6"] pub struct P6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> P6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P7`"] -pub type P7_R = crate::R; +#[doc = "Field `P7` reader - Port n Output Bit 7"] +pub struct P7_R(crate::FieldReader); impl P7_R { + pub(crate) fn new(bits: bool) -> Self { + P7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P7_A { @@ -563,15 +646,22 @@ impl P7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P7_A::VALUE1 + **self == P7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P7_A::VALUE2 + **self == P7_A::VALUE2 } } -#[doc = "Write proxy for field `P7`"] +impl core::ops::Deref for P7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P7` writer - Port n Output Bit 7"] pub struct P7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> P7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P8`"] -pub type P8_R = crate::R; +#[doc = "Field `P8` reader - Port n Output Bit 8"] +pub struct P8_R(crate::FieldReader); impl P8_R { + pub(crate) fn new(bits: bool) -> Self { + P8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P8_A { @@ -638,15 +729,22 @@ impl P8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P8_A::VALUE1 + **self == P8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P8_A::VALUE2 + **self == P8_A::VALUE2 } } -#[doc = "Write proxy for field `P8`"] +impl core::ops::Deref for P8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P8` writer - Port n Output Bit 8"] pub struct P8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> P8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P9`"] -pub type P9_R = crate::R; +#[doc = "Field `P9` reader - Port n Output Bit 9"] +pub struct P9_R(crate::FieldReader); impl P9_R { + pub(crate) fn new(bits: bool) -> Self { + P9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P9_A { @@ -713,15 +812,22 @@ impl P9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P9_A::VALUE1 + **self == P9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P9_A::VALUE2 + **self == P9_A::VALUE2 + } +} +impl core::ops::Deref for P9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P9`"] +#[doc = "Field `P9` writer - Port n Output Bit 9"] pub struct P9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> P9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P10`"] -pub type P10_R = crate::R; +#[doc = "Field `P10` reader - Port n Output Bit 10"] +pub struct P10_R(crate::FieldReader); impl P10_R { + pub(crate) fn new(bits: bool) -> Self { + P10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P10_A { @@ -788,15 +895,22 @@ impl P10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P10_A::VALUE1 + **self == P10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P10_A::VALUE2 + **self == P10_A::VALUE2 } } -#[doc = "Write proxy for field `P10`"] +impl core::ops::Deref for P10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P10` writer - Port n Output Bit 10"] pub struct P10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> P10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P11`"] -pub type P11_R = crate::R; +#[doc = "Field `P11` reader - Port n Output Bit 11"] +pub struct P11_R(crate::FieldReader); impl P11_R { + pub(crate) fn new(bits: bool) -> Self { + P11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P11_A { @@ -863,15 +978,22 @@ impl P11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P11_A::VALUE1 + **self == P11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P11_A::VALUE2 + **self == P11_A::VALUE2 } } -#[doc = "Write proxy for field `P11`"] +impl core::ops::Deref for P11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P11` writer - Port n Output Bit 11"] pub struct P11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> P11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P12`"] -pub type P12_R = crate::R; +#[doc = "Field `P12` reader - Port n Output Bit 12"] +pub struct P12_R(crate::FieldReader); impl P12_R { + pub(crate) fn new(bits: bool) -> Self { + P12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P12_A { @@ -938,15 +1061,22 @@ impl P12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P12_A::VALUE1 + **self == P12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P12_A::VALUE2 + **self == P12_A::VALUE2 + } +} +impl core::ops::Deref for P12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `P12`"] +#[doc = "Field `P12` writer - Port n Output Bit 12"] pub struct P12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> P12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P13`"] -pub type P13_R = crate::R; +#[doc = "Field `P13` reader - Port n Output Bit 13"] +pub struct P13_R(crate::FieldReader); impl P13_R { + pub(crate) fn new(bits: bool) -> Self { + P13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P13_A { @@ -1013,15 +1144,22 @@ impl P13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P13_A::VALUE1 + **self == P13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P13_A::VALUE2 + **self == P13_A::VALUE2 } } -#[doc = "Write proxy for field `P13`"] +impl core::ops::Deref for P13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P13` writer - Port n Output Bit 13"] pub struct P13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> P13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P14`"] -pub type P14_R = crate::R; +#[doc = "Field `P14` reader - Port n Output Bit 14"] +pub struct P14_R(crate::FieldReader); impl P14_R { + pub(crate) fn new(bits: bool) -> Self { + P14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P14_A { @@ -1088,15 +1227,22 @@ impl P14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P14_A::VALUE1 + **self == P14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P14_A::VALUE2 + **self == P14_A::VALUE2 } } -#[doc = "Write proxy for field `P14`"] +impl core::ops::Deref for P14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P14` writer - Port n Output Bit 14"] pub struct P14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> P14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `P15`"] -pub type P15_R = crate::R; +#[doc = "Field `P15` reader - Port n Output Bit 15"] +pub struct P15_R(crate::FieldReader); impl P15_R { + pub(crate) fn new(bits: bool) -> Self { + P15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> P15_A { @@ -1163,15 +1310,22 @@ impl P15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == P15_A::VALUE1 + **self == P15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == P15_A::VALUE2 + **self == P15_A::VALUE2 } } -#[doc = "Write proxy for field `P15`"] +impl core::ops::Deref for P15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `P15` writer - Port n Output Bit 15"] pub struct P15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: P15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The output level of Pn.x is 0."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> P15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn p15(&mut self) -> P15_W { P15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Output Register\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 [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/port3/pdisc.rs b/src/port3/pdisc.rs index dad72964..8972aaca 100644 --- a/src/port3/pdisc.rs +++ b/src/port3/pdisc.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PDISC"] -pub type R = crate::R; +#[doc = "Register `PDISC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PDIS0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS0`"] -pub type PDIS0_R = crate::R; +#[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] +pub struct PDIS0_R(crate::FieldReader); impl PDIS0_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS0_A { @@ -28,12 +44,19 @@ impl PDIS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS0_A::VALUE1 + **self == PDIS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS0_A::VALUE2 + **self == PDIS0_A::VALUE2 + } +} +impl core::ops::Deref for PDIS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 1\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS1`"] -pub type PDIS1_R = crate::R; +#[doc = "Field `PDIS1` reader - Pad Disable for Port n Pin 1"] +pub struct PDIS1_R(crate::FieldReader); impl PDIS1_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS1_A { @@ -64,12 +90,19 @@ impl PDIS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS1_A::VALUE1 + **self == PDIS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS1_A::VALUE2 + **self == PDIS1_A::VALUE2 + } +} +impl core::ops::Deref for PDIS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 2\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS2`"] -pub type PDIS2_R = crate::R; +#[doc = "Field `PDIS2` reader - Pad Disable for Port n Pin 2"] +pub struct PDIS2_R(crate::FieldReader); impl PDIS2_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS2_A { @@ -100,12 +136,19 @@ impl PDIS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS2_A::VALUE1 + **self == PDIS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS2_A::VALUE2 + **self == PDIS2_A::VALUE2 + } +} +impl core::ops::Deref for PDIS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 3\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS3`"] -pub type PDIS3_R = crate::R; +#[doc = "Field `PDIS3` reader - Pad Disable for Port n Pin 3"] +pub struct PDIS3_R(crate::FieldReader); impl PDIS3_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS3_A { @@ -136,12 +182,19 @@ impl PDIS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS3_A::VALUE1 + **self == PDIS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS3_A::VALUE2 + **self == PDIS3_A::VALUE2 + } +} +impl core::ops::Deref for PDIS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 4\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS4`"] -pub type PDIS4_R = crate::R; +#[doc = "Field `PDIS4` reader - Pad Disable for Port n Pin 4"] +pub struct PDIS4_R(crate::FieldReader); impl PDIS4_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS4_A { @@ -172,12 +228,19 @@ impl PDIS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS4_A::VALUE1 + **self == PDIS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS4_A::VALUE2 + **self == PDIS4_A::VALUE2 + } +} +impl core::ops::Deref for PDIS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 5\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS5`"] -pub type PDIS5_R = crate::R; +#[doc = "Field `PDIS5` reader - Pad Disable for Port n Pin 5"] +pub struct PDIS5_R(crate::FieldReader); impl PDIS5_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS5_A { @@ -208,12 +274,19 @@ impl PDIS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS5_A::VALUE1 + **self == PDIS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS5_A::VALUE2 + **self == PDIS5_A::VALUE2 + } +} +impl core::ops::Deref for PDIS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 6\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS6`"] -pub type PDIS6_R = crate::R; +#[doc = "Field `PDIS6` reader - Pad Disable for Port n Pin 6"] +pub struct PDIS6_R(crate::FieldReader); impl PDIS6_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS6_A { @@ -244,12 +320,19 @@ impl PDIS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS6_A::VALUE1 + **self == PDIS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS6_A::VALUE2 + **self == PDIS6_A::VALUE2 + } +} +impl core::ops::Deref for PDIS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 7\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS7`"] -pub type PDIS7_R = crate::R; +#[doc = "Field `PDIS7` reader - Pad Disable for Port n Pin 7"] +pub struct PDIS7_R(crate::FieldReader); impl PDIS7_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS7_A { @@ -280,12 +366,19 @@ impl PDIS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS7_A::VALUE1 + **self == PDIS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS7_A::VALUE2 + **self == PDIS7_A::VALUE2 + } +} +impl core::ops::Deref for PDIS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 8\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS8`"] -pub type PDIS8_R = crate::R; +#[doc = "Field `PDIS8` reader - Pad Disable for Port n Pin 8"] +pub struct PDIS8_R(crate::FieldReader); impl PDIS8_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS8_A { @@ -316,12 +412,19 @@ impl PDIS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS8_A::VALUE1 + **self == PDIS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS8_A::VALUE2 + **self == PDIS8_A::VALUE2 + } +} +impl core::ops::Deref for PDIS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 9\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS9`"] -pub type PDIS9_R = crate::R; +#[doc = "Field `PDIS9` reader - Pad Disable for Port n Pin 9"] +pub struct PDIS9_R(crate::FieldReader); impl PDIS9_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS9_A { @@ -352,12 +458,19 @@ impl PDIS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS9_A::VALUE1 + **self == PDIS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS9_A::VALUE2 + **self == PDIS9_A::VALUE2 + } +} +impl core::ops::Deref for PDIS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 10\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS10`"] -pub type PDIS10_R = crate::R; +#[doc = "Field `PDIS10` reader - Pad Disable for Port n Pin 10"] +pub struct PDIS10_R(crate::FieldReader); impl PDIS10_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS10_A { @@ -388,12 +504,19 @@ impl PDIS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS10_A::VALUE1 + **self == PDIS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS10_A::VALUE2 + **self == PDIS10_A::VALUE2 + } +} +impl core::ops::Deref for PDIS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 11\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS11`"] -pub type PDIS11_R = crate::R; +#[doc = "Field `PDIS11` reader - Pad Disable for Port n Pin 11"] +pub struct PDIS11_R(crate::FieldReader); impl PDIS11_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS11_A { @@ -424,12 +550,19 @@ impl PDIS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS11_A::VALUE1 + **self == PDIS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS11_A::VALUE2 + **self == PDIS11_A::VALUE2 + } +} +impl core::ops::Deref for PDIS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 12\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS12`"] -pub type PDIS12_R = crate::R; +#[doc = "Field `PDIS12` reader - Pad Disable for Port n Pin 12"] +pub struct PDIS12_R(crate::FieldReader); impl PDIS12_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS12_A { @@ -460,12 +596,19 @@ impl PDIS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS12_A::VALUE1 + **self == PDIS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS12_A::VALUE2 + **self == PDIS12_A::VALUE2 + } +} +impl core::ops::Deref for PDIS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 13\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS13`"] -pub type PDIS13_R = crate::R; +#[doc = "Field `PDIS13` reader - Pad Disable for Port n Pin 13"] +pub struct PDIS13_R(crate::FieldReader); impl PDIS13_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS13_A { @@ -496,12 +642,19 @@ impl PDIS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS13_A::VALUE1 + **self == PDIS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS13_A::VALUE2 + **self == PDIS13_A::VALUE2 + } +} +impl core::ops::Deref for PDIS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 14\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS14`"] -pub type PDIS14_R = crate::R; +#[doc = "Field `PDIS14` reader - Pad Disable for Port n Pin 14"] +pub struct PDIS14_R(crate::FieldReader); impl PDIS14_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS14_A { @@ -532,12 +688,19 @@ impl PDIS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS14_A::VALUE1 + **self == PDIS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS14_A::VALUE2 + **self == PDIS14_A::VALUE2 + } +} +impl core::ops::Deref for PDIS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Pad Disable for Port n Pin 15\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDIS15`"] -pub type PDIS15_R = crate::R; +#[doc = "Field `PDIS15` reader - Pad Disable for Port n Pin 15"] +pub struct PDIS15_R(crate::FieldReader); impl PDIS15_R { + pub(crate) fn new(bits: bool) -> Self { + PDIS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDIS15_A { @@ -568,12 +734,19 @@ impl PDIS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDIS15_A::VALUE1 + **self == PDIS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDIS15_A::VALUE2 + **self == PDIS15_A::VALUE2 + } +} +impl core::ops::Deref for PDIS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -658,3 +831,19 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Port 3 Pin Function Decision Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdisc](index.html) module"] +pub struct PDISC_SPEC; +impl crate::RegisterSpec for PDISC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdisc::R](R) reader structure"] +impl crate::Readable for PDISC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PDISC to value 0"] +impl crate::Resettable for PDISC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/port3/pdr0.rs b/src/port3/pdr0.rs index 0923fc4a..afc83fcf 100644 --- a/src/port3/pdr0.rs +++ b/src/port3/pdr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PDR0"] -pub type R = crate::R; -#[doc = "Writer for register PDR0"] -pub type W = crate::W; -#[doc = "Register PDR0 `reset()`'s with value 0x2222_2222"] -impl crate::ResetValue for super::PDR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x2222_2222 +#[doc = "Register `PDR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] +pub struct PD0_R(crate::FieldReader); +impl PD0_R { + pub(crate) fn new(bits: u8) -> Self { + PD0_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `PD0`"] -pub type PD0_R = crate::R; -#[doc = "Write proxy for field `PD0`"] +impl core::ops::Deref for PD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] pub struct PD0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PD0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `PD1`"] -pub type PD1_R = crate::R; -#[doc = "Write proxy for field `PD1`"] +#[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] +pub struct PD1_R(crate::FieldReader); +impl PD1_R { + pub(crate) fn new(bits: u8) -> Self { + PD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] pub struct PD1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PD1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `PD2`"] -pub type PD2_R = crate::R; -#[doc = "Write proxy for field `PD2`"] +#[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] +pub struct PD2_R(crate::FieldReader); +impl PD2_R { + pub(crate) fn new(bits: u8) -> Self { + PD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] pub struct PD2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PD2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `PD3`"] -pub type PD3_R = crate::R; -#[doc = "Write proxy for field `PD3`"] +#[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] +pub struct PD3_R(crate::FieldReader); +impl PD3_R { + pub(crate) fn new(bits: u8) -> Self { + PD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] pub struct PD3_W<'a> { w: &'a mut W, } @@ -62,13 +134,25 @@ impl<'a> PD3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PD4`"] -pub type PD4_R = crate::R; -#[doc = "Write proxy for field `PD4`"] +#[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] +pub struct PD4_R(crate::FieldReader); +impl PD4_R { + pub(crate) fn new(bits: u8) -> Self { + PD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] pub struct PD4_W<'a> { w: &'a mut W, } @@ -76,13 +160,25 @@ impl<'a> PD4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } -#[doc = "Reader of field `PD5`"] -pub type PD5_R = crate::R; -#[doc = "Write proxy for field `PD5`"] +#[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] +pub struct PD5_R(crate::FieldReader); +impl PD5_R { + pub(crate) fn new(bits: u8) -> Self { + PD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] pub struct PD5_W<'a> { w: &'a mut W, } @@ -90,13 +186,25 @@ impl<'a> PD5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20); + self.w.bits = (self.w.bits & !(0x07 << 20)) | ((value as u32 & 0x07) << 20); self.w } } -#[doc = "Reader of field `PD6`"] -pub type PD6_R = crate::R; -#[doc = "Write proxy for field `PD6`"] +#[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] +pub struct PD6_R(crate::FieldReader); +impl PD6_R { + pub(crate) fn new(bits: u8) -> Self { + PD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] pub struct PD6_W<'a> { w: &'a mut W, } @@ -104,13 +212,25 @@ impl<'a> PD6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } -#[doc = "Reader of field `PD7`"] -pub type PD7_R = crate::R; -#[doc = "Write proxy for field `PD7`"] +#[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] +pub struct PD7_R(crate::FieldReader); +impl PD7_R { + pub(crate) fn new(bits: u8) -> Self { + PD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] pub struct PD7_W<'a> { w: &'a mut W, } @@ -118,7 +238,7 @@ impl<'a> PD7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -205,4 +325,30 @@ impl W { pub fn pd7(&mut self) -> PD7_W { PD7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Pad Driver Mode 0 Register\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 [pdr0](index.html) module"] +pub struct PDR0_SPEC; +impl crate::RegisterSpec for PDR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdr0::R](R) reader structure"] +impl crate::Readable for PDR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdr0::W](W) writer structure"] +impl crate::Writable for PDR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDR0 to value 0x2222_2222"] +impl crate::Resettable for PDR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2222_2222 + } } diff --git a/src/port3/pps.rs b/src/port3/pps.rs index b45c5930..97cc03e1 100644 --- a/src/port3/pps.rs +++ b/src/port3/pps.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PPS"] -pub type R = crate::R; -#[doc = "Writer for register PPS"] -pub type W = crate::W; -#[doc = "Register PPS `reset()`'s with value 0"] -impl crate::ResetValue for super::PPS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS0`"] -pub type PPS0_R = crate::R; +#[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] +pub struct PPS0_R(crate::FieldReader); impl PPS0_R { + pub(crate) fn new(bits: bool) -> Self { + PPS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS0_A { @@ -38,15 +65,22 @@ impl PPS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS0_A::VALUE1 + **self == PPS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS0_A::VALUE2 + **self == PPS0_A::VALUE2 } } -#[doc = "Write proxy for field `PPS0`"] +impl core::ops::Deref for PPS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] pub struct PPS0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PPS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS1`"] -pub type PPS1_R = crate::R; +#[doc = "Field `PPS1` reader - Port n Pin Power Save Bit 1"] +pub struct PPS1_R(crate::FieldReader); impl PPS1_R { + pub(crate) fn new(bits: bool) -> Self { + PPS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS1_A { @@ -113,15 +148,22 @@ impl PPS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS1_A::VALUE1 + **self == PPS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS1_A::VALUE2 + **self == PPS1_A::VALUE2 } } -#[doc = "Write proxy for field `PPS1`"] +impl core::ops::Deref for PPS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] pub struct PPS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PPS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS2`"] -pub type PPS2_R = crate::R; +#[doc = "Field `PPS2` reader - Port n Pin Power Save Bit 2"] +pub struct PPS2_R(crate::FieldReader); impl PPS2_R { + pub(crate) fn new(bits: bool) -> Self { + PPS2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS2_A { @@ -188,15 +231,22 @@ impl PPS2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS2_A::VALUE1 + **self == PPS2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS2_A::VALUE2 + **self == PPS2_A::VALUE2 + } +} +impl core::ops::Deref for PPS2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS2`"] +#[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] pub struct PPS2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PPS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS3`"] -pub type PPS3_R = crate::R; +#[doc = "Field `PPS3` reader - Port n Pin Power Save Bit 3"] +pub struct PPS3_R(crate::FieldReader); impl PPS3_R { + pub(crate) fn new(bits: bool) -> Self { + PPS3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS3_A { @@ -263,15 +314,22 @@ impl PPS3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS3_A::VALUE1 + **self == PPS3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS3_A::VALUE2 + **self == PPS3_A::VALUE2 + } +} +impl core::ops::Deref for PPS3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS3`"] +#[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] pub struct PPS3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PPS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS4`"] -pub type PPS4_R = crate::R; +#[doc = "Field `PPS4` reader - Port n Pin Power Save Bit 4"] +pub struct PPS4_R(crate::FieldReader); impl PPS4_R { + pub(crate) fn new(bits: bool) -> Self { + PPS4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS4_A { @@ -338,15 +397,22 @@ impl PPS4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS4_A::VALUE1 + **self == PPS4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS4_A::VALUE2 + **self == PPS4_A::VALUE2 + } +} +impl core::ops::Deref for PPS4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS4`"] +#[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] pub struct PPS4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PPS4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS5`"] -pub type PPS5_R = crate::R; +#[doc = "Field `PPS5` reader - Port n Pin Power Save Bit 5"] +pub struct PPS5_R(crate::FieldReader); impl PPS5_R { + pub(crate) fn new(bits: bool) -> Self { + PPS5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS5_A { @@ -413,15 +480,22 @@ impl PPS5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS5_A::VALUE1 + **self == PPS5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS5_A::VALUE2 + **self == PPS5_A::VALUE2 + } +} +impl core::ops::Deref for PPS5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS5`"] +#[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] pub struct PPS5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPS5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS6`"] -pub type PPS6_R = crate::R; +#[doc = "Field `PPS6` reader - Port n Pin Power Save Bit 6"] +pub struct PPS6_R(crate::FieldReader); impl PPS6_R { + pub(crate) fn new(bits: bool) -> Self { + PPS6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS6_A { @@ -488,15 +563,22 @@ impl PPS6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS6_A::VALUE1 + **self == PPS6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS6_A::VALUE2 + **self == PPS6_A::VALUE2 } } -#[doc = "Write proxy for field `PPS6`"] +impl core::ops::Deref for PPS6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] pub struct PPS6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PPS6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS7`"] -pub type PPS7_R = crate::R; +#[doc = "Field `PPS7` reader - Port n Pin Power Save Bit 7"] +pub struct PPS7_R(crate::FieldReader); impl PPS7_R { + pub(crate) fn new(bits: bool) -> Self { + PPS7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS7_A { @@ -563,15 +646,22 @@ impl PPS7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS7_A::VALUE1 + **self == PPS7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS7_A::VALUE2 + **self == PPS7_A::VALUE2 } } -#[doc = "Write proxy for field `PPS7`"] +impl core::ops::Deref for PPS7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] pub struct PPS7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PPS7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS8`"] -pub type PPS8_R = crate::R; +#[doc = "Field `PPS8` reader - Port n Pin Power Save Bit 8"] +pub struct PPS8_R(crate::FieldReader); impl PPS8_R { + pub(crate) fn new(bits: bool) -> Self { + PPS8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS8_A { @@ -638,15 +729,22 @@ impl PPS8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS8_A::VALUE1 + **self == PPS8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS8_A::VALUE2 + **self == PPS8_A::VALUE2 } } -#[doc = "Write proxy for field `PPS8`"] +impl core::ops::Deref for PPS8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] pub struct PPS8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> PPS8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS9`"] -pub type PPS9_R = crate::R; +#[doc = "Field `PPS9` reader - Port n Pin Power Save Bit 9"] +pub struct PPS9_R(crate::FieldReader); impl PPS9_R { + pub(crate) fn new(bits: bool) -> Self { + PPS9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS9_A { @@ -713,15 +812,22 @@ impl PPS9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS9_A::VALUE1 + **self == PPS9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS9_A::VALUE2 + **self == PPS9_A::VALUE2 + } +} +impl core::ops::Deref for PPS9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS9`"] +#[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] pub struct PPS9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> PPS9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS10`"] -pub type PPS10_R = crate::R; +#[doc = "Field `PPS10` reader - Port n Pin Power Save Bit 10"] +pub struct PPS10_R(crate::FieldReader); impl PPS10_R { + pub(crate) fn new(bits: bool) -> Self { + PPS10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS10_A { @@ -788,15 +895,22 @@ impl PPS10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS10_A::VALUE1 + **self == PPS10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS10_A::VALUE2 + **self == PPS10_A::VALUE2 } } -#[doc = "Write proxy for field `PPS10`"] +impl core::ops::Deref for PPS10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] pub struct PPS10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> PPS10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS11`"] -pub type PPS11_R = crate::R; +#[doc = "Field `PPS11` reader - Port n Pin Power Save Bit 11"] +pub struct PPS11_R(crate::FieldReader); impl PPS11_R { + pub(crate) fn new(bits: bool) -> Self { + PPS11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS11_A { @@ -863,15 +978,22 @@ impl PPS11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS11_A::VALUE1 + **self == PPS11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS11_A::VALUE2 + **self == PPS11_A::VALUE2 } } -#[doc = "Write proxy for field `PPS11`"] +impl core::ops::Deref for PPS11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] pub struct PPS11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> PPS11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS12`"] -pub type PPS12_R = crate::R; +#[doc = "Field `PPS12` reader - Port n Pin Power Save Bit 12"] +pub struct PPS12_R(crate::FieldReader); impl PPS12_R { + pub(crate) fn new(bits: bool) -> Self { + PPS12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS12_A { @@ -938,15 +1061,22 @@ impl PPS12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS12_A::VALUE1 + **self == PPS12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS12_A::VALUE2 + **self == PPS12_A::VALUE2 + } +} +impl core::ops::Deref for PPS12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPS12`"] +#[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] pub struct PPS12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> PPS12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS13`"] -pub type PPS13_R = crate::R; +#[doc = "Field `PPS13` reader - Port n Pin Power Save Bit 13"] +pub struct PPS13_R(crate::FieldReader); impl PPS13_R { + pub(crate) fn new(bits: bool) -> Self { + PPS13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS13_A { @@ -1013,15 +1144,22 @@ impl PPS13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS13_A::VALUE1 + **self == PPS13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS13_A::VALUE2 + **self == PPS13_A::VALUE2 } } -#[doc = "Write proxy for field `PPS13`"] +impl core::ops::Deref for PPS13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] pub struct PPS13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> PPS13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS14`"] -pub type PPS14_R = crate::R; +#[doc = "Field `PPS14` reader - Port n Pin Power Save Bit 14"] +pub struct PPS14_R(crate::FieldReader); impl PPS14_R { + pub(crate) fn new(bits: bool) -> Self { + PPS14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS14_A { @@ -1088,15 +1227,22 @@ impl PPS14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS14_A::VALUE1 + **self == PPS14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS14_A::VALUE2 + **self == PPS14_A::VALUE2 } } -#[doc = "Write proxy for field `PPS14`"] +impl core::ops::Deref for PPS14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] pub struct PPS14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> PPS14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPS15`"] -pub type PPS15_R = crate::R; +#[doc = "Field `PPS15` reader - Port n Pin Power Save Bit 15"] +pub struct PPS15_R(crate::FieldReader); impl PPS15_R { + pub(crate) fn new(bits: bool) -> Self { + PPS15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPS15_A { @@ -1163,15 +1310,22 @@ impl PPS15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPS15_A::VALUE1 + **self == PPS15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPS15_A::VALUE2 + **self == PPS15_A::VALUE2 } } -#[doc = "Write proxy for field `PPS15`"] +impl core::ops::Deref for PPS15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] pub struct PPS15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPS15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> PPS15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn pps15(&mut self) -> PPS15_W { PPS15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Port 3 Pin Power Save Register\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 [pps](index.html) module"] +pub struct PPS_SPEC; +impl crate::RegisterSpec for PPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pps::R](R) reader structure"] +impl crate::Readable for PPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pps::W](W) writer structure"] +impl crate::Writable for PPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PPS to value 0"] +impl crate::Resettable for PPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0.rs b/src/posif0.rs index f0cd3c75..cd0838ba 100644 --- a/src/posif0.rs +++ b/src/posif0.rs @@ -2,230 +2,123 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Service Request Processing configuration"] - pub pconf: PCONF, + pub pconf: crate::Reg, #[doc = "0x04 - Service Request Processing Suspend Config"] - pub psus: PSUS, + pub psus: crate::Reg, #[doc = "0x08 - Service Request Processing Run Bit Set"] - pub pruns: PRUNS, + pub pruns: crate::Reg, #[doc = "0x0c - Service Request Processing Run Bit Clear"] - pub prunc: PRUNC, + pub prunc: crate::Reg, #[doc = "0x10 - Service Request Processing Run Bit Status"] - pub prun: PRUN, - _reserved5: [u8; 12usize], + pub prun: crate::Reg, + _reserved5: [u8; 0x0c], #[doc = "0x20 - Module Identification register"] - pub midr: MIDR, - _reserved6: [u8; 12usize], + pub midr: crate::Reg, + _reserved6: [u8; 0x0c], #[doc = "0x30 - Hall Sensor Patterns"] - pub halp: HALP, + pub halp: crate::Reg, #[doc = "0x34 - Hall Sensor Shadow Patterns"] - pub halps: HALPS, - _reserved8: [u8; 8usize], + pub halps: crate::Reg, + _reserved8: [u8; 0x08], #[doc = "0x40 - Multi-Channel Pattern"] - pub mcm: MCM, + pub mcm: crate::Reg, #[doc = "0x44 - Multi-Channel Shadow Pattern"] - pub mcsm: MCSM, + pub mcsm: crate::Reg, #[doc = "0x48 - Multi-Channel Pattern Control set"] - pub mcms: MCMS, + pub mcms: crate::Reg, #[doc = "0x4c - Multi-Channel Pattern Control clear"] - pub mcmc: MCMC, + pub mcmc: crate::Reg, #[doc = "0x50 - Multi-Channel Pattern Control flag"] - pub mcmf: MCMF, - _reserved13: [u8; 12usize], + pub mcmf: crate::Reg, + _reserved13: [u8; 0x0c], #[doc = "0x60 - Quadrature Decoder Control"] - pub qdc: QDC, - _reserved14: [u8; 12usize], + pub qdc: crate::Reg, + _reserved14: [u8; 0x0c], #[doc = "0x70 - Service Request Processing Interrupt Flags"] - pub pflg: PFLG, + pub pflg: crate::Reg, #[doc = "0x74 - Service Request Processing Interrupt Enable"] - pub pflge: PFLGE, + pub pflge: crate::Reg, #[doc = "0x78 - Service Request Processing Interrupt Set"] - pub spflg: SPFLG, + pub spflg: crate::Reg, #[doc = "0x7c - Service Request Processing Interrupt Clear"] - pub rpflg: RPFLG, - _reserved18: [u8; 128usize], + pub rpflg: crate::Reg, + _reserved18: [u8; 0x80], #[doc = "0x100 - POSIF Debug register"] - pub pdbg: PDBG, + pub pdbg: crate::Reg, } -#[doc = "Service Request Processing configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pconf](pconf) module"] -pub type PCONF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCONF; -#[doc = "`read()` method returns [pconf::R](pconf::R) reader structure"] -impl crate::Readable for PCONF {} -#[doc = "`write(|w| ..)` method takes [pconf::W](pconf::W) writer structure"] -impl crate::Writable for PCONF {} +#[doc = "PCONF register accessor: an alias for `Reg`"] +pub type PCONF = crate::Reg; #[doc = "Service Request Processing configuration"] pub mod pconf; -#[doc = "Service Request Processing Suspend Config\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psus](psus) module"] -pub type PSUS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSUS; -#[doc = "`read()` method returns [psus::R](psus::R) reader structure"] -impl crate::Readable for PSUS {} -#[doc = "`write(|w| ..)` method takes [psus::W](psus::W) writer structure"] -impl crate::Writable for PSUS {} +#[doc = "PSUS register accessor: an alias for `Reg`"] +pub type PSUS = crate::Reg; #[doc = "Service Request Processing Suspend Config"] pub mod psus; -#[doc = "Service Request Processing Run Bit Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pruns](pruns) module"] -pub type PRUNS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRUNS; -#[doc = "`write(|w| ..)` method takes [pruns::W](pruns::W) writer structure"] -impl crate::Writable for PRUNS {} +#[doc = "PRUNS register accessor: an alias for `Reg`"] +pub type PRUNS = crate::Reg; #[doc = "Service Request Processing Run Bit Set"] pub mod pruns; -#[doc = "Service Request Processing Run Bit Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prunc](prunc) module"] -pub type PRUNC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRUNC; -#[doc = "`write(|w| ..)` method takes [prunc::W](prunc::W) writer structure"] -impl crate::Writable for PRUNC {} +#[doc = "PRUNC register accessor: an alias for `Reg`"] +pub type PRUNC = crate::Reg; #[doc = "Service Request Processing Run Bit Clear"] pub mod prunc; -#[doc = "Service Request Processing Run Bit Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prun](prun) module"] -pub type PRUN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRUN; -#[doc = "`read()` method returns [prun::R](prun::R) reader structure"] -impl crate::Readable for PRUN {} +#[doc = "PRUN register accessor: an alias for `Reg`"] +pub type PRUN = crate::Reg; #[doc = "Service Request Processing Run Bit Status"] pub mod prun; -#[doc = "Module Identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](midr) module"] -pub type MIDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIDR; -#[doc = "`read()` method returns [midr::R](midr::R) reader structure"] -impl crate::Readable for MIDR {} +#[doc = "MIDR register accessor: an alias for `Reg`"] +pub type MIDR = crate::Reg; #[doc = "Module Identification register"] pub mod midr; -#[doc = "Hall Sensor Patterns\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [halp](halp) module"] -pub type HALP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HALP; -#[doc = "`read()` method returns [halp::R](halp::R) reader structure"] -impl crate::Readable for HALP {} +#[doc = "HALP register accessor: an alias for `Reg`"] +pub type HALP = crate::Reg; #[doc = "Hall Sensor Patterns"] pub mod halp; -#[doc = "Hall Sensor Shadow Patterns\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [halps](halps) module"] -pub type HALPS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HALPS; -#[doc = "`read()` method returns [halps::R](halps::R) reader structure"] -impl crate::Readable for HALPS {} -#[doc = "`write(|w| ..)` method takes [halps::W](halps::W) writer structure"] -impl crate::Writable for HALPS {} +#[doc = "HALPS register accessor: an alias for `Reg`"] +pub type HALPS = crate::Reg; #[doc = "Hall Sensor Shadow Patterns"] pub mod halps; -#[doc = "Multi-Channel Pattern\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcm](mcm) module"] -pub type MCM = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCM; -#[doc = "`read()` method returns [mcm::R](mcm::R) reader structure"] -impl crate::Readable for MCM {} +#[doc = "MCM register accessor: an alias for `Reg`"] +pub type MCM = crate::Reg; #[doc = "Multi-Channel Pattern"] pub mod mcm; -#[doc = "Multi-Channel Shadow Pattern\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcsm](mcsm) module"] -pub type MCSM = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCSM; -#[doc = "`read()` method returns [mcsm::R](mcsm::R) reader structure"] -impl crate::Readable for MCSM {} -#[doc = "`write(|w| ..)` method takes [mcsm::W](mcsm::W) writer structure"] -impl crate::Writable for MCSM {} +#[doc = "MCSM register accessor: an alias for `Reg`"] +pub type MCSM = crate::Reg; #[doc = "Multi-Channel Shadow Pattern"] pub mod mcsm; -#[doc = "Multi-Channel Pattern Control set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcms](mcms) module"] -pub type MCMS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCMS; -#[doc = "`write(|w| ..)` method takes [mcms::W](mcms::W) writer structure"] -impl crate::Writable for MCMS {} +#[doc = "MCMS register accessor: an alias for `Reg`"] +pub type MCMS = crate::Reg; #[doc = "Multi-Channel Pattern Control set"] pub mod mcms; -#[doc = "Multi-Channel Pattern Control clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcmc](mcmc) module"] -pub type MCMC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCMC; -#[doc = "`write(|w| ..)` method takes [mcmc::W](mcmc::W) writer structure"] -impl crate::Writable for MCMC {} +#[doc = "MCMC register accessor: an alias for `Reg`"] +pub type MCMC = crate::Reg; #[doc = "Multi-Channel Pattern Control clear"] pub mod mcmc; -#[doc = "Multi-Channel Pattern Control flag\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcmf](mcmf) module"] -pub type MCMF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCMF; -#[doc = "`read()` method returns [mcmf::R](mcmf::R) reader structure"] -impl crate::Readable for MCMF {} +#[doc = "MCMF register accessor: an alias for `Reg`"] +pub type MCMF = crate::Reg; #[doc = "Multi-Channel Pattern Control flag"] pub mod mcmf; -#[doc = "Quadrature Decoder Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qdc](qdc) module"] -pub type QDC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QDC; -#[doc = "`read()` method returns [qdc::R](qdc::R) reader structure"] -impl crate::Readable for QDC {} -#[doc = "`write(|w| ..)` method takes [qdc::W](qdc::W) writer structure"] -impl crate::Writable for QDC {} +#[doc = "QDC register accessor: an alias for `Reg`"] +pub type QDC = crate::Reg; #[doc = "Quadrature Decoder Control"] pub mod qdc; -#[doc = "Service Request Processing Interrupt Flags\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pflg](pflg) module"] -pub type PFLG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PFLG; -#[doc = "`read()` method returns [pflg::R](pflg::R) reader structure"] -impl crate::Readable for PFLG {} +#[doc = "PFLG register accessor: an alias for `Reg`"] +pub type PFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Flags"] pub mod pflg; -#[doc = "Service Request Processing Interrupt Enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pflge](pflge) module"] -pub type PFLGE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PFLGE; -#[doc = "`read()` method returns [pflge::R](pflge::R) reader structure"] -impl crate::Readable for PFLGE {} -#[doc = "`write(|w| ..)` method takes [pflge::W](pflge::W) writer structure"] -impl crate::Writable for PFLGE {} +#[doc = "PFLGE register accessor: an alias for `Reg`"] +pub type PFLGE = crate::Reg; #[doc = "Service Request Processing Interrupt Enable"] pub mod pflge; -#[doc = "Service Request Processing Interrupt Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spflg](spflg) module"] -pub type SPFLG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SPFLG; -#[doc = "`write(|w| ..)` method takes [spflg::W](spflg::W) writer structure"] -impl crate::Writable for SPFLG {} +#[doc = "SPFLG register accessor: an alias for `Reg`"] +pub type SPFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Set"] pub mod spflg; -#[doc = "Service Request Processing Interrupt Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rpflg](rpflg) module"] -pub type RPFLG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RPFLG; -#[doc = "`write(|w| ..)` method takes [rpflg::W](rpflg::W) writer structure"] -impl crate::Writable for RPFLG {} +#[doc = "RPFLG register accessor: an alias for `Reg`"] +pub type RPFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Clear"] pub mod rpflg; -#[doc = "POSIF Debug register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdbg](pdbg) module"] -pub type PDBG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PDBG; -#[doc = "`read()` method returns [pdbg::R](pdbg::R) reader structure"] -impl crate::Readable for PDBG {} +#[doc = "PDBG register accessor: an alias for `Reg`"] +pub type PDBG = crate::Reg; #[doc = "POSIF Debug register"] pub mod pdbg; diff --git a/src/posif0/halp.rs b/src/posif0/halp.rs index a6b7ac3e..76e9cfe1 100644 --- a/src/posif0/halp.rs +++ b/src/posif0/halp.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register HALP"] -pub type R = crate::R; -#[doc = "Reader of field `HCP`"] -pub type HCP_R = crate::R; -#[doc = "Reader of field `HEP`"] -pub type HEP_R = crate::R; +#[doc = "Register `HALP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `HCP` reader - Hall Current Pattern"] +pub struct HCP_R(crate::FieldReader); +impl HCP_R { + pub(crate) fn new(bits: u8) -> Self { + HCP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HCP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HEP` reader - Hall Expected Pattern"] +pub struct HEP_R(crate::FieldReader); +impl HEP_R { + pub(crate) fn new(bits: u8) -> Self { + HEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:2 - Hall Current Pattern"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { HEP_R::new(((self.bits >> 3) & 0x07) as u8) } } +#[doc = "Hall Sensor Patterns\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [halp](index.html) module"] +pub struct HALP_SPEC; +impl crate::RegisterSpec for HALP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [halp::R](R) reader structure"] +impl crate::Readable for HALP_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HALP to value 0"] +impl crate::Resettable for HALP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/halps.rs b/src/posif0/halps.rs index 927867bc..145ce578 100644 --- a/src/posif0/halps.rs +++ b/src/posif0/halps.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register HALPS"] -pub type R = crate::R; -#[doc = "Writer for register HALPS"] -pub type W = crate::W; -#[doc = "Register HALPS `reset()`'s with value 0"] -impl crate::ResetValue for super::HALPS { - type Type = u32; +#[doc = "Register `HALPS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HALPS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `HCPS` reader - Shadow Hall Current Pattern"] +pub struct HCPS_R(crate::FieldReader); +impl HCPS_R { + pub(crate) fn new(bits: u8) -> Self { + HCPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HCPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `HCPS`"] -pub type HCPS_R = crate::R; -#[doc = "Write proxy for field `HCPS`"] +#[doc = "Field `HCPS` writer - Shadow Hall Current Pattern"] pub struct HCPS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> HCPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `HEPS`"] -pub type HEPS_R = crate::R; -#[doc = "Write proxy for field `HEPS`"] +#[doc = "Field `HEPS` reader - Shadow Hall expected Pattern"] +pub struct HEPS_R(crate::FieldReader); +impl HEPS_R { + pub(crate) fn new(bits: u8) -> Self { + HEPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HEPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HEPS` writer - Shadow Hall expected Pattern"] pub struct HEPS_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> HEPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 3)) | (((value as u32) & 0x07) << 3); + self.w.bits = (self.w.bits & !(0x07 << 3)) | ((value as u32 & 0x07) << 3); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn heps(&mut self) -> HEPS_W { HEPS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hall Sensor Shadow Patterns\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 [halps](index.html) module"] +pub struct HALPS_SPEC; +impl crate::RegisterSpec for HALPS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [halps::R](R) reader structure"] +impl crate::Readable for HALPS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [halps::W](W) writer structure"] +impl crate::Writable for HALPS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HALPS to value 0"] +impl crate::Resettable for HALPS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/mcm.rs b/src/posif0/mcm.rs index d90ea16b..7fd620e1 100644 --- a/src/posif0/mcm.rs +++ b/src/posif0/mcm.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register MCM"] -pub type R = crate::R; -#[doc = "Reader of field `MCMP`"] -pub type MCMP_R = crate::R; +#[doc = "Register `MCM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MCMP` reader - Multi-Channel Pattern"] +pub struct MCMP_R(crate::FieldReader); +impl MCMP_R { + pub(crate) fn new(bits: u16) -> Self { + MCMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Multi-Channel Pattern"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { MCMP_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Multi-Channel Pattern\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcm](index.html) module"] +pub struct MCM_SPEC; +impl crate::RegisterSpec for MCM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mcm::R](R) reader structure"] +impl crate::Readable for MCM_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MCM to value 0"] +impl crate::Resettable for MCM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/mcmc.rs b/src/posif0/mcmc.rs index bed5b110..fcddb5a1 100644 --- a/src/posif0/mcmc.rs +++ b/src/posif0/mcmc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register MCMC"] -pub type W = crate::W; -#[doc = "Register MCMC `reset()`'s with value 0"] -impl crate::ResetValue for super::MCMC { - type Type = u32; +#[doc = "Register `MCMC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `MNPC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MNPC` writer - Multi-Channel Pattern Update Enable Clear"] pub struct MNPC_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> MNPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `MPC`"] +#[doc = "Field `MPC` writer - Multi-Channel Pattern clear"] pub struct MPC_W<'a> { w: &'a mut W, } @@ -48,7 +59,7 @@ impl<'a> MPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -63,4 +74,26 @@ impl W { pub fn mpc(&mut self) -> MPC_W { MPC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Multi-Channel Pattern Control clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcmc](index.html) module"] +pub struct MCMC_SPEC; +impl crate::RegisterSpec for MCMC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [mcmc::W](W) writer structure"] +impl crate::Writable for MCMC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCMC to value 0"] +impl crate::Resettable for MCMC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/mcmf.rs b/src/posif0/mcmf.rs index eb861e9b..81517962 100644 --- a/src/posif0/mcmf.rs +++ b/src/posif0/mcmf.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register MCMF"] -pub type R = crate::R; +#[doc = "Register `MCMF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Multi-Channel Pattern update status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum MSS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSS`"] -pub type MSS_R = crate::R; +#[doc = "Field `MSS` reader - Multi-Channel Pattern update status"] +pub struct MSS_R(crate::FieldReader); impl MSS_R { + pub(crate) fn new(bits: bool) -> Self { + MSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSS_A { @@ -28,12 +44,19 @@ impl MSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSS_A::VALUE1 + **self == MSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSS_A::VALUE2 + **self == MSS_A::VALUE2 + } +} +impl core::ops::Deref for MSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { MSS_R::new((self.bits & 0x01) != 0) } } +#[doc = "Multi-Channel Pattern Control flag\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcmf](index.html) module"] +pub struct MCMF_SPEC; +impl crate::RegisterSpec for MCMF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mcmf::R](R) reader structure"] +impl crate::Readable for MCMF_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MCMF to value 0"] +impl crate::Resettable for MCMF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/mcms.rs b/src/posif0/mcms.rs index 9bf9374e..8c703beb 100644 --- a/src/posif0/mcms.rs +++ b/src/posif0/mcms.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register MCMS"] -pub type W = crate::W; -#[doc = "Register MCMS `reset()`'s with value 0"] -impl crate::ResetValue for super::MCMS { - type Type = u32; +#[doc = "Register `MCMS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `MNPS`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MNPS` writer - Multi-Channel Pattern Update Enable Set"] pub struct MNPS_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> MNPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `STHR`"] +#[doc = "Field `STHR` writer - Hall Pattern Shadow Transfer Request"] pub struct STHR_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> STHR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `STMR`"] +#[doc = "Field `STMR` writer - Multi-Channel Shadow Transfer Request"] pub struct STMR_W<'a> { w: &'a mut W, } @@ -70,7 +81,7 @@ impl<'a> STMR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -90,4 +101,26 @@ impl W { pub fn stmr(&mut self) -> STMR_W { STMR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Multi-Channel Pattern Control set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcms](index.html) module"] +pub struct MCMS_SPEC; +impl crate::RegisterSpec for MCMS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [mcms::W](W) writer structure"] +impl crate::Writable for MCMS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCMS to value 0"] +impl crate::Resettable for MCMS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/mcsm.rs b/src/posif0/mcsm.rs index c9b0a0c0..48956a75 100644 --- a/src/posif0/mcsm.rs +++ b/src/posif0/mcsm.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MCSM"] -pub type R = crate::R; -#[doc = "Writer for register MCSM"] -pub type W = crate::W; -#[doc = "Register MCSM `reset()`'s with value 0"] -impl crate::ResetValue for super::MCSM { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MCSM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCSM` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `MCMPS`"] -pub type MCMPS_R = crate::R; -#[doc = "Write proxy for field `MCMPS`"] +#[doc = "Field `MCMPS` reader - Shadow Multi-Channel Pattern"] +pub struct MCMPS_R(crate::FieldReader); +impl MCMPS_R { + pub(crate) fn new(bits: u16) -> Self { + MCMPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCMPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCMPS` writer - Shadow Multi-Channel Pattern"] pub struct MCMPS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> MCMPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn mcmps(&mut self) -> MCMPS_W { MCMPS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Multi-Channel Shadow Pattern\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 [mcsm](index.html) module"] +pub struct MCSM_SPEC; +impl crate::RegisterSpec for MCSM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mcsm::R](R) reader structure"] +impl crate::Readable for MCSM_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mcsm::W](W) writer structure"] +impl crate::Writable for MCSM_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCSM to value 0"] +impl crate::Resettable for MCSM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/midr.rs b/src/posif0/midr.rs index ca2a62bb..92b00445 100644 --- a/src/posif0/midr.rs +++ b/src/posif0/midr.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register MIDR"] -pub type R = crate::R; -#[doc = "Reader of field `MODR`"] -pub type MODR_R = crate::R; -#[doc = "Reader of field `MODT`"] -pub type MODT_R = crate::R; -#[doc = "Reader of field `MODN`"] -pub type MODN_R = crate::R; +#[doc = "Register `MIDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MODR` reader - Module Revision"] +pub struct MODR_R(crate::FieldReader); +impl MODR_R { + pub(crate) fn new(bits: u8) -> Self { + MODR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODT` reader - Module Type"] +pub struct MODT_R(crate::FieldReader); +impl MODT_R { + pub(crate) fn new(bits: u8) -> Self { + MODT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODN` reader - Module Number"] +pub struct MODN_R(crate::FieldReader); +impl MODN_R { + pub(crate) fn new(bits: u16) -> Self { + MODN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MODN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MODN_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [midr](index.html) module"] +pub struct MIDR_SPEC; +impl crate::RegisterSpec for MIDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [midr::R](R) reader structure"] +impl crate::Readable for MIDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIDR to value 0x00a8_c000"] +impl crate::Resettable for MIDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a8_c000 + } +} diff --git a/src/posif0/pconf.rs b/src/posif0/pconf.rs index dd7e4d5a..e9b76324 100644 --- a/src/posif0/pconf.rs +++ b/src/posif0/pconf.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PCONF"] -pub type R = crate::R; -#[doc = "Writer for register PCONF"] -pub type W = crate::W; -#[doc = "Register PCONF `reset()`'s with value 0"] -impl crate::ResetValue for super::PCONF { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCONF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCONF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Function Selector\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `FSEL`"] -pub type FSEL_R = crate::R; +#[doc = "Field `FSEL` reader - Function Selector"] +pub struct FSEL_R(crate::FieldReader); impl FSEL_R { + pub(crate) fn new(bits: u8) -> Self { + FSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FSEL_A { @@ -46,25 +73,32 @@ impl FSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FSEL_A::VALUE1 + **self == FSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FSEL_A::VALUE2 + **self == FSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == FSEL_A::VALUE3 + **self == FSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == FSEL_A::VALUE4 + **self == FSEL_A::VALUE4 } } -#[doc = "Write proxy for field `FSEL`"] +impl core::ops::Deref for FSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FSEL` writer - Function Selector"] pub struct FSEL_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> FSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Hall Sensor Mode enabled"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> FSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -117,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `QDCM`"] -pub type QDCM_R = crate::R; +#[doc = "Field `QDCM` reader - Position Decoder Mode selection"] +pub struct QDCM_R(crate::FieldReader); impl QDCM_R { + pub(crate) fn new(bits: bool) -> Self { + QDCM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> QDCM_A { @@ -131,15 +166,22 @@ impl QDCM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == QDCM_A::VALUE1 + **self == QDCM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == QDCM_A::VALUE2 + **self == QDCM_A::VALUE2 } } -#[doc = "Write proxy for field `QDCM`"] +impl core::ops::Deref for QDCM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `QDCM` writer - Position Decoder Mode selection"] pub struct QDCM_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> QDCM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: QDCM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Position encoder is in Quadrature Mode"] #[inline(always)] @@ -174,13 +214,25 @@ impl<'a> QDCM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `HIDG`"] -pub type HIDG_R = crate::R; -#[doc = "Write proxy for field `HIDG`"] +#[doc = "Field `HIDG` reader - Idle generation enable"] +pub struct HIDG_R(crate::FieldReader); +impl HIDG_R { + pub(crate) fn new(bits: bool) -> Self { + HIDG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HIDG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HIDG` writer - Idle generation enable"] pub struct HIDG_W<'a> { w: &'a mut W, } @@ -198,7 +250,7 @@ impl<'a> HIDG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -216,9 +268,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCUE`"] -pub type MCUE_R = crate::R; +#[doc = "Field `MCUE` reader - Multi-Channel Pattern SW update enable"] +pub struct MCUE_R(crate::FieldReader); impl MCUE_R { + pub(crate) fn new(bits: bool) -> Self { + MCUE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCUE_A { @@ -230,15 +285,22 @@ impl MCUE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCUE_A::VALUE1 + **self == MCUE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCUE_A::VALUE2 + **self == MCUE_A::VALUE2 + } +} +impl core::ops::Deref for MCUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MCUE`"] +#[doc = "Field `MCUE` writer - Multi-Channel Pattern SW update enable"] pub struct MCUE_W<'a> { w: &'a mut W, } @@ -246,9 +308,7 @@ impl<'a> MCUE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCUE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Multi-Channel pattern update is controlled via HW"] #[inline(always)] @@ -273,7 +333,7 @@ impl<'a> MCUE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -296,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `INSEL0`"] -pub type INSEL0_R = crate::R; +#[doc = "Field `INSEL0` reader - PhaseA/Hal input 1 selector"] +pub struct INSEL0_R(crate::FieldReader); impl INSEL0_R { + pub(crate) fn new(bits: u8) -> Self { + INSEL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSEL0_A { @@ -313,25 +376,32 @@ impl INSEL0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSEL0_A::VALUE1 + **self == INSEL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSEL0_A::VALUE2 + **self == INSEL0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == INSEL0_A::VALUE3 + **self == INSEL0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == INSEL0_A::VALUE4 + **self == INSEL0_A::VALUE4 + } +} +impl core::ops::Deref for INSEL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `INSEL0`"] +#[doc = "Field `INSEL0` writer - PhaseA/Hal input 1 selector"] pub struct INSEL0_W<'a> { w: &'a mut W, } @@ -339,9 +409,7 @@ impl<'a> INSEL0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSEL0_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.IN0A"] #[inline(always)] @@ -366,7 +434,7 @@ impl<'a> INSEL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -389,9 +457,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `INSEL1`"] -pub type INSEL1_R = crate::R; +#[doc = "Field `INSEL1` reader - PhaseB/Hall input 2 selector"] +pub struct INSEL1_R(crate::FieldReader); impl INSEL1_R { + pub(crate) fn new(bits: u8) -> Self { + INSEL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSEL1_A { @@ -406,25 +477,32 @@ impl INSEL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSEL1_A::VALUE1 + **self == INSEL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSEL1_A::VALUE2 + **self == INSEL1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == INSEL1_A::VALUE3 + **self == INSEL1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == INSEL1_A::VALUE4 + **self == INSEL1_A::VALUE4 + } +} +impl core::ops::Deref for INSEL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `INSEL1`"] +#[doc = "Field `INSEL1` writer - PhaseB/Hall input 2 selector"] pub struct INSEL1_W<'a> { w: &'a mut W, } @@ -432,9 +510,7 @@ impl<'a> INSEL1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSEL1_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.IN1A"] #[inline(always)] @@ -459,7 +535,7 @@ impl<'a> INSEL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -482,9 +558,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `INSEL2`"] -pub type INSEL2_R = crate::R; +#[doc = "Field `INSEL2` reader - Index/Hall input 3 selector"] +pub struct INSEL2_R(crate::FieldReader); impl INSEL2_R { + pub(crate) fn new(bits: u8) -> Self { + INSEL2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSEL2_A { @@ -499,25 +578,32 @@ impl INSEL2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSEL2_A::VALUE1 + **self == INSEL2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSEL2_A::VALUE2 + **self == INSEL2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == INSEL2_A::VALUE3 + **self == INSEL2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == INSEL2_A::VALUE4 + **self == INSEL2_A::VALUE4 } } -#[doc = "Write proxy for field `INSEL2`"] +impl core::ops::Deref for INSEL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSEL2` writer - Index/Hall input 3 selector"] pub struct INSEL2_W<'a> { w: &'a mut W, } @@ -525,9 +611,7 @@ impl<'a> INSEL2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSEL2_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.IN2A"] #[inline(always)] @@ -552,7 +636,7 @@ impl<'a> INSEL2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); self.w } } @@ -570,9 +654,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Delay Pin selector"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: bool) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -584,15 +671,22 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Delay Pin selector"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -600,9 +694,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "POSIFx.HSDA"] #[inline(always)] @@ -627,7 +719,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -645,9 +737,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SPES`"] -pub type SPES_R = crate::R; +#[doc = "Field `SPES` reader - Edge selector for the sampling trigger"] +pub struct SPES_R(crate::FieldReader); impl SPES_R { + pub(crate) fn new(bits: bool) -> Self { + SPES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SPES_A { @@ -659,15 +754,22 @@ impl SPES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SPES_A::VALUE1 + **self == SPES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SPES_A::VALUE2 + **self == SPES_A::VALUE2 } } -#[doc = "Write proxy for field `SPES`"] +impl core::ops::Deref for SPES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPES` writer - Edge selector for the sampling trigger"] pub struct SPES_W<'a> { w: &'a mut W, } @@ -675,9 +777,7 @@ impl<'a> SPES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SPES_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Rising edge"] #[inline(always)] @@ -702,7 +802,7 @@ impl<'a> SPES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -733,9 +833,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MSETS`"] -pub type MSETS_R = crate::R; +#[doc = "Field `MSETS` reader - Pattern update signal select"] +pub struct MSETS_R(crate::FieldReader); impl MSETS_R { + pub(crate) fn new(bits: u8) -> Self { + MSETS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSETS_A { @@ -754,45 +857,52 @@ impl MSETS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSETS_A::VALUE1 + **self == MSETS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSETS_A::VALUE2 + **self == MSETS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MSETS_A::VALUE3 + **self == MSETS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MSETS_A::VALUE4 + **self == MSETS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == MSETS_A::VALUE5 + **self == MSETS_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == MSETS_A::VALUE6 + **self == MSETS_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == MSETS_A::VALUE7 + **self == MSETS_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == MSETS_A::VALUE8 + **self == MSETS_A::VALUE8 + } +} +impl core::ops::Deref for MSETS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSETS`"] +#[doc = "Field `MSETS` writer - Pattern update signal select"] pub struct MSETS_W<'a> { w: &'a mut W, } @@ -800,9 +910,7 @@ impl<'a> MSETS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSETS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.MSETA"] #[inline(always)] @@ -847,7 +955,7 @@ impl<'a> MSETS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 18)) | (((value as u32) & 0x07) << 18); + self.w.bits = (self.w.bits & !(0x07 << 18)) | ((value as u32 & 0x07) << 18); self.w } } @@ -865,9 +973,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSES`"] -pub type MSES_R = crate::R; +#[doc = "Field `MSES` reader - Multi-Channel pattern update trigger edge"] +pub struct MSES_R(crate::FieldReader); impl MSES_R { + pub(crate) fn new(bits: bool) -> Self { + MSES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSES_A { @@ -879,15 +990,22 @@ impl MSES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSES_A::VALUE1 + **self == MSES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSES_A::VALUE2 + **self == MSES_A::VALUE2 } } -#[doc = "Write proxy for field `MSES`"] +impl core::ops::Deref for MSES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSES` writer - Multi-Channel pattern update trigger edge"] pub struct MSES_W<'a> { w: &'a mut W, } @@ -895,9 +1013,7 @@ impl<'a> MSES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSES_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The signal used to enable a pattern update is active on the rising edge"] #[inline(always)] @@ -922,7 +1038,7 @@ impl<'a> MSES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -945,9 +1061,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MSYNS`"] -pub type MSYNS_R = crate::R; +#[doc = "Field `MSYNS` reader - PWM synchronization signal selector"] +pub struct MSYNS_R(crate::FieldReader); impl MSYNS_R { + pub(crate) fn new(bits: u8) -> Self { + MSYNS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSYNS_A { @@ -962,25 +1081,32 @@ impl MSYNS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSYNS_A::VALUE1 + **self == MSYNS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSYNS_A::VALUE2 + **self == MSYNS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MSYNS_A::VALUE3 + **self == MSYNS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MSYNS_A::VALUE4 + **self == MSYNS_A::VALUE4 } } -#[doc = "Write proxy for field `MSYNS`"] +impl core::ops::Deref for MSYNS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSYNS` writer - PWM synchronization signal selector"] pub struct MSYNS_W<'a> { w: &'a mut W, } @@ -988,9 +1114,7 @@ impl<'a> MSYNS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSYNS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.MSYNCA"] #[inline(always)] @@ -1015,7 +1139,7 @@ impl<'a> MSYNS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -1038,9 +1162,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EWIS`"] -pub type EWIS_R = crate::R; +#[doc = "Field `EWIS` reader - Wrong Hall Event selection"] +pub struct EWIS_R(crate::FieldReader); impl EWIS_R { + pub(crate) fn new(bits: u8) -> Self { + EWIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EWIS_A { @@ -1055,25 +1182,32 @@ impl EWIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EWIS_A::VALUE1 + **self == EWIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EWIS_A::VALUE2 + **self == EWIS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EWIS_A::VALUE3 + **self == EWIS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EWIS_A::VALUE4 + **self == EWIS_A::VALUE4 + } +} +impl core::ops::Deref for EWIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EWIS`"] +#[doc = "Field `EWIS` writer - Wrong Hall Event selection"] pub struct EWIS_W<'a> { w: &'a mut W, } @@ -1081,9 +1215,7 @@ impl<'a> EWIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EWIS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "POSIFx.EWHEA"] #[inline(always)] @@ -1108,7 +1240,7 @@ impl<'a> EWIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -1126,9 +1258,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EWIE`"] -pub type EWIE_R = crate::R; +#[doc = "Field `EWIE` reader - External Wrong Hall Event enable"] +pub struct EWIE_R(crate::FieldReader); impl EWIE_R { + pub(crate) fn new(bits: bool) -> Self { + EWIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EWIE_A { @@ -1140,15 +1275,22 @@ impl EWIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EWIE_A::VALUE1 + **self == EWIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EWIE_A::VALUE2 + **self == EWIE_A::VALUE2 } } -#[doc = "Write proxy for field `EWIE`"] +impl core::ops::Deref for EWIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EWIE` writer - External Wrong Hall Event enable"] pub struct EWIE_W<'a> { w: &'a mut W, } @@ -1156,9 +1298,7 @@ impl<'a> EWIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EWIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External wrong hall event emulation signal, POSIFx.EWHE\\[D...A\\], is disabled"] #[inline(always)] @@ -1183,7 +1323,7 @@ impl<'a> EWIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1203,9 +1343,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EWIL`"] -pub type EWIL_R = crate::R; +#[doc = "Field `EWIL` reader - External Wrong Hall Event active level"] +pub struct EWIL_R(crate::FieldReader); impl EWIL_R { + pub(crate) fn new(bits: bool) -> Self { + EWIL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EWIL_A { @@ -1217,15 +1360,22 @@ impl EWIL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EWIL_A::VALUE1 + **self == EWIL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EWIL_A::VALUE2 + **self == EWIL_A::VALUE2 } } -#[doc = "Write proxy for field `EWIL`"] +impl core::ops::Deref for EWIL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EWIL` writer - External Wrong Hall Event active level"] pub struct EWIL_W<'a> { w: &'a mut W, } @@ -1233,9 +1383,7 @@ impl<'a> EWIL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EWIL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "POSIFx.EWHE\\[D...A\\] signal is active HIGH"] @@ -1262,7 +1410,7 @@ signal is active LOW"] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1293,9 +1441,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `LPC`"] -pub type LPC_R = crate::R; +#[doc = "Field `LPC` reader - Low Pass Filters Configuration"] +pub struct LPC_R(crate::FieldReader); impl LPC_R { + pub(crate) fn new(bits: u8) -> Self { + LPC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPC_A { @@ -1314,45 +1465,52 @@ impl LPC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPC_A::VALUE1 + **self == LPC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPC_A::VALUE2 + **self == LPC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == LPC_A::VALUE3 + **self == LPC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == LPC_A::VALUE4 + **self == LPC_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == LPC_A::VALUE5 + **self == LPC_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == LPC_A::VALUE6 + **self == LPC_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == LPC_A::VALUE7 + **self == LPC_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == LPC_A::VALUE8 + **self == LPC_A::VALUE8 } } -#[doc = "Write proxy for field `LPC`"] +impl core::ops::Deref for LPC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPC` writer - Low Pass Filters Configuration"] pub struct LPC_W<'a> { w: &'a mut W, } @@ -1360,9 +1518,7 @@ impl<'a> LPC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Low pass filter disabled"] #[inline(always)] @@ -1407,7 +1563,7 @@ impl<'a> LPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28); + self.w.bits = (self.w.bits & !(0x07 << 28)) | ((value as u32 & 0x07) << 28); self.w } } @@ -1574,4 +1730,30 @@ impl W { pub fn lpc(&mut self) -> LPC_W { LPC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing configuration\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 [pconf](index.html) module"] +pub struct PCONF_SPEC; +impl crate::RegisterSpec for PCONF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pconf::R](R) reader structure"] +impl crate::Readable for PCONF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pconf::W](W) writer structure"] +impl crate::Writable for PCONF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCONF to value 0"] +impl crate::Resettable for PCONF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/pdbg.rs b/src/posif0/pdbg.rs index c7d5b84f..32881b4a 100644 --- a/src/posif0/pdbg.rs +++ b/src/posif0/pdbg.rs @@ -1,19 +1,116 @@ -#[doc = "Reader of register PDBG"] -pub type R = crate::R; -#[doc = "Reader of field `QCSV`"] -pub type QCSV_R = crate::R; -#[doc = "Reader of field `QPSV`"] -pub type QPSV_R = crate::R; -#[doc = "Reader of field `IVAL`"] -pub type IVAL_R = crate::R; -#[doc = "Reader of field `HSP`"] -pub type HSP_R = crate::R; -#[doc = "Reader of field `LPP0`"] -pub type LPP0_R = crate::R; -#[doc = "Reader of field `LPP1`"] -pub type LPP1_R = crate::R; -#[doc = "Reader of field `LPP2`"] -pub type LPP2_R = crate::R; +#[doc = "Register `PDBG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `QCSV` reader - Quadrature Decoder Current state"] +pub struct QCSV_R(crate::FieldReader); +impl QCSV_R { + pub(crate) fn new(bits: u8) -> Self { + QCSV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for QCSV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `QPSV` reader - Quadrature Decoder Previous state"] +pub struct QPSV_R(crate::FieldReader); +impl QPSV_R { + pub(crate) fn new(bits: u8) -> Self { + QPSV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for QPSV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IVAL` reader - Current Index Value"] +pub struct IVAL_R(crate::FieldReader); +impl IVAL_R { + pub(crate) fn new(bits: bool) -> Self { + IVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HSP` reader - Hall Current Sampled Pattern"] +pub struct HSP_R(crate::FieldReader); +impl HSP_R { + pub(crate) fn new(bits: u8) -> Self { + HSP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPP0` reader - Actual count of the Low Pass Filter for POSI0"] +pub struct LPP0_R(crate::FieldReader); +impl LPP0_R { + pub(crate) fn new(bits: u8) -> Self { + LPP0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LPP0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPP1` reader - Actual count of the Low Pass Filter for POSI1"] +pub struct LPP1_R(crate::FieldReader); +impl LPP1_R { + pub(crate) fn new(bits: u8) -> Self { + LPP1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LPP1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPP2` reader - Actual count of the Low Pass Filter for POSI2"] +pub struct LPP2_R(crate::FieldReader); +impl LPP2_R { + pub(crate) fn new(bits: u8) -> Self { + LPP2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LPP2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:1 - Quadrature Decoder Current state"] #[inline(always)] @@ -51,3 +148,19 @@ impl R { LPP2_R::new(((self.bits >> 22) & 0x3f) as u8) } } +#[doc = "POSIF Debug register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdbg](index.html) module"] +pub struct PDBG_SPEC; +impl crate::RegisterSpec for PDBG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdbg::R](R) reader structure"] +impl crate::Readable for PDBG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PDBG to value 0"] +impl crate::Resettable for PDBG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/pflg.rs b/src/posif0/pflg.rs index df7ea85f..759f27f5 100644 --- a/src/posif0/pflg.rs +++ b/src/posif0/pflg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PFLG"] -pub type R = crate::R; +#[doc = "Register `PFLG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Correct Hall Event Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CHES_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHES`"] -pub type CHES_R = crate::R; +#[doc = "Field `CHES` reader - Correct Hall Event Status"] +pub struct CHES_R(crate::FieldReader); impl CHES_R { + pub(crate) fn new(bits: bool) -> Self { + CHES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHES_A { @@ -28,12 +44,19 @@ impl CHES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHES_A::VALUE1 + **self == CHES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHES_A::VALUE2 + **self == CHES_A::VALUE2 + } +} +impl core::ops::Deref for CHES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wrong Hall Event Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WHES`"] -pub type WHES_R = crate::R; +#[doc = "Field `WHES` reader - Wrong Hall Event Status"] +pub struct WHES_R(crate::FieldReader); impl WHES_R { + pub(crate) fn new(bits: bool) -> Self { + WHES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WHES_A { @@ -64,12 +90,19 @@ impl WHES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WHES_A::VALUE1 + **self == WHES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WHES_A::VALUE2 + **self == WHES_A::VALUE2 + } +} +impl core::ops::Deref for WHES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Hall Inputs Update Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIES`"] -pub type HIES_R = crate::R; +#[doc = "Field `HIES` reader - Hall Inputs Update Status"] +pub struct HIES_R(crate::FieldReader); impl HIES_R { + pub(crate) fn new(bits: bool) -> Self { + HIES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIES_A { @@ -100,12 +136,19 @@ impl HIES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIES_A::VALUE1 + **self == HIES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIES_A::VALUE2 + **self == HIES_A::VALUE2 + } +} +impl core::ops::Deref for HIES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Multi-Channel pattern shadow transfer status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSTS`"] -pub type MSTS_R = crate::R; +#[doc = "Field `MSTS` reader - Multi-Channel pattern shadow transfer status"] +pub struct MSTS_R(crate::FieldReader); impl MSTS_R { + pub(crate) fn new(bits: bool) -> Self { + MSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSTS_A { @@ -136,12 +182,19 @@ impl MSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSTS_A::VALUE1 + **self == MSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSTS_A::VALUE2 + **self == MSTS_A::VALUE2 + } +} +impl core::ops::Deref for MSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Quadrature Index Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INDXS`"] -pub type INDXS_R = crate::R; +#[doc = "Field `INDXS` reader - Quadrature Index Status"] +pub struct INDXS_R(crate::FieldReader); impl INDXS_R { + pub(crate) fn new(bits: bool) -> Self { + INDXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INDXS_A { @@ -172,12 +228,19 @@ impl INDXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INDXS_A::VALUE1 + **self == INDXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INDXS_A::VALUE2 + **self == INDXS_A::VALUE2 + } +} +impl core::ops::Deref for INDXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Quadrature Phase Error Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERRS`"] -pub type ERRS_R = crate::R; +#[doc = "Field `ERRS` reader - Quadrature Phase Error Status"] +pub struct ERRS_R(crate::FieldReader); impl ERRS_R { + pub(crate) fn new(bits: bool) -> Self { + ERRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERRS_A { @@ -208,12 +274,19 @@ impl ERRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERRS_A::VALUE1 + **self == ERRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERRS_A::VALUE2 + **self == ERRS_A::VALUE2 + } +} +impl core::ops::Deref for ERRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Quadrature CLK Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CNTS`"] -pub type CNTS_R = crate::R; +#[doc = "Field `CNTS` reader - Quadrature CLK Status"] +pub struct CNTS_R(crate::FieldReader); impl CNTS_R { + pub(crate) fn new(bits: bool) -> Self { + CNTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CNTS_A { @@ -244,12 +320,19 @@ impl CNTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CNTS_A::VALUE1 + **self == CNTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CNTS_A::VALUE2 + **self == CNTS_A::VALUE2 + } +} +impl core::ops::Deref for CNTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Quadrature Direction Change\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIRS`"] -pub type DIRS_R = crate::R; +#[doc = "Field `DIRS` reader - Quadrature Direction Change"] +pub struct DIRS_R(crate::FieldReader); impl DIRS_R { + pub(crate) fn new(bits: bool) -> Self { + DIRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIRS_A { @@ -280,12 +366,19 @@ impl DIRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIRS_A::VALUE1 + **self == DIRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIRS_A::VALUE2 + **self == DIRS_A::VALUE2 + } +} +impl core::ops::Deref for DIRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Quadrature Period Clk Status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCLKS`"] -pub type PCLKS_R = crate::R; +#[doc = "Field `PCLKS` reader - Quadrature Period Clk Status"] +pub struct PCLKS_R(crate::FieldReader); impl PCLKS_R { + pub(crate) fn new(bits: bool) -> Self { + PCLKS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCLKS_A { @@ -316,12 +412,19 @@ impl PCLKS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCLKS_A::VALUE1 + **self == PCLKS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCLKS_A::VALUE2 + **self == PCLKS_A::VALUE2 + } +} +impl core::ops::Deref for PCLKS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { PCLKS_R::new(((self.bits >> 12) & 0x01) != 0) } } +#[doc = "Service Request Processing Interrupt Flags\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pflg](index.html) module"] +pub struct PFLG_SPEC; +impl crate::RegisterSpec for PFLG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pflg::R](R) reader structure"] +impl crate::Readable for PFLG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PFLG to value 0"] +impl crate::Resettable for PFLG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/pflge.rs b/src/posif0/pflge.rs index 999b56d3..1b3987eb 100644 --- a/src/posif0/pflge.rs +++ b/src/posif0/pflge.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PFLGE"] -pub type R = crate::R; -#[doc = "Writer for register PFLGE"] -pub type W = crate::W; -#[doc = "Register PFLGE `reset()`'s with value 0"] -impl crate::ResetValue for super::PFLGE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PFLGE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PFLGE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Correct Hall Event Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ECHE`"] -pub type ECHE_R = crate::R; +#[doc = "Field `ECHE` reader - Correct Hall Event Enable"] +pub struct ECHE_R(crate::FieldReader); impl ECHE_R { + pub(crate) fn new(bits: bool) -> Self { + ECHE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ECHE_A { @@ -38,15 +65,22 @@ impl ECHE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ECHE_A::VALUE1 + **self == ECHE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ECHE_A::VALUE2 + **self == ECHE_A::VALUE2 } } -#[doc = "Write proxy for field `ECHE`"] +impl core::ops::Deref for ECHE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ECHE` writer - Correct Hall Event Enable"] pub struct ECHE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ECHE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ECHE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Correct Hall Event interrupt disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ECHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EWHE`"] -pub type EWHE_R = crate::R; +#[doc = "Field `EWHE` reader - Wrong Hall Event Enable"] +pub struct EWHE_R(crate::FieldReader); impl EWHE_R { + pub(crate) fn new(bits: bool) -> Self { + EWHE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EWHE_A { @@ -113,15 +148,22 @@ impl EWHE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EWHE_A::VALUE1 + **self == EWHE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EWHE_A::VALUE2 + **self == EWHE_A::VALUE2 + } +} +impl core::ops::Deref for EWHE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EWHE`"] +#[doc = "Field `EWHE` writer - Wrong Hall Event Enable"] pub struct EWHE_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> EWHE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EWHE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wrong Hall Event interrupt disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> EWHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EHIE`"] -pub type EHIE_R = crate::R; +#[doc = "Field `EHIE` reader - Hall Input Update Enable"] +pub struct EHIE_R(crate::FieldReader); impl EHIE_R { + pub(crate) fn new(bits: bool) -> Self { + EHIE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EHIE_A { @@ -188,15 +231,22 @@ impl EHIE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EHIE_A::VALUE1 + **self == EHIE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EHIE_A::VALUE2 + **self == EHIE_A::VALUE2 } } -#[doc = "Write proxy for field `EHIE`"] +impl core::ops::Deref for EHIE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EHIE` writer - Hall Input Update Enable"] pub struct EHIE_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> EHIE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EHIE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Update of the Hall Inputs interrupt is disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> EHIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMST`"] -pub type EMST_R = crate::R; +#[doc = "Field `EMST` reader - Multi-Channel pattern shadow transfer enable"] +pub struct EMST_R(crate::FieldReader); impl EMST_R { + pub(crate) fn new(bits: bool) -> Self { + EMST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMST_A { @@ -263,15 +314,22 @@ impl EMST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMST_A::VALUE1 + **self == EMST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMST_A::VALUE2 + **self == EMST_A::VALUE2 + } +} +impl core::ops::Deref for EMST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EMST`"] +#[doc = "Field `EMST` writer - Multi-Channel pattern shadow transfer enable"] pub struct EMST_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> EMST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shadow transfer event interrupt disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> EMST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EINDX`"] -pub type EINDX_R = crate::R; +#[doc = "Field `EINDX` reader - Quadrature Index Event Enable"] +pub struct EINDX_R(crate::FieldReader); impl EINDX_R { + pub(crate) fn new(bits: bool) -> Self { + EINDX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EINDX_A { @@ -338,15 +397,22 @@ impl EINDX_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EINDX_A::VALUE1 + **self == EINDX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EINDX_A::VALUE2 + **self == EINDX_A::VALUE2 + } +} +impl core::ops::Deref for EINDX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EINDX`"] +#[doc = "Field `EINDX` writer - Quadrature Index Event Enable"] pub struct EINDX_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> EINDX_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EINDX_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Index event interrupt disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> EINDX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EERR`"] -pub type EERR_R = crate::R; +#[doc = "Field `EERR` reader - Quadrature Phase Error Enable"] +pub struct EERR_R(crate::FieldReader); impl EERR_R { + pub(crate) fn new(bits: bool) -> Self { + EERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EERR_A { @@ -413,15 +480,22 @@ impl EERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EERR_A::VALUE1 + **self == EERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EERR_A::VALUE2 + **self == EERR_A::VALUE2 + } +} +impl core::ops::Deref for EERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EERR`"] +#[doc = "Field `EERR` writer - Quadrature Phase Error Enable"] pub struct EERR_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> EERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Phase error event interrupt disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> EERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ECNT`"] -pub type ECNT_R = crate::R; +#[doc = "Field `ECNT` reader - Quadrature CLK interrupt Enable"] +pub struct ECNT_R(crate::FieldReader); impl ECNT_R { + pub(crate) fn new(bits: bool) -> Self { + ECNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ECNT_A { @@ -488,15 +563,22 @@ impl ECNT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ECNT_A::VALUE1 + **self == ECNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ECNT_A::VALUE2 + **self == ECNT_A::VALUE2 } } -#[doc = "Write proxy for field `ECNT`"] +impl core::ops::Deref for ECNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ECNT` writer - Quadrature CLK interrupt Enable"] pub struct ECNT_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> ECNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ECNT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature CLK event interrupt disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> ECNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EDIR`"] -pub type EDIR_R = crate::R; +#[doc = "Field `EDIR` reader - Quadrature direction change interrupt Enable"] +pub struct EDIR_R(crate::FieldReader); impl EDIR_R { + pub(crate) fn new(bits: bool) -> Self { + EDIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EDIR_A { @@ -563,15 +646,22 @@ impl EDIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EDIR_A::VALUE1 + **self == EDIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EDIR_A::VALUE2 + **self == EDIR_A::VALUE2 } } -#[doc = "Write proxy for field `EDIR`"] +impl core::ops::Deref for EDIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDIR` writer - Quadrature direction change interrupt Enable"] pub struct EDIR_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> EDIR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EDIR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Direction change event interrupt disabled"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> EDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EPCLK`"] -pub type EPCLK_R = crate::R; +#[doc = "Field `EPCLK` reader - Quadrature Period CLK interrupt Enable"] +pub struct EPCLK_R(crate::FieldReader); impl EPCLK_R { + pub(crate) fn new(bits: bool) -> Self { + EPCLK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPCLK_A { @@ -638,15 +729,22 @@ impl EPCLK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPCLK_A::VALUE1 + **self == EPCLK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPCLK_A::VALUE2 + **self == EPCLK_A::VALUE2 } } -#[doc = "Write proxy for field `EPCLK`"] +impl core::ops::Deref for EPCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPCLK` writer - Quadrature Period CLK interrupt Enable"] pub struct EPCLK_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> EPCLK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPCLK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Period CLK event interrupt disabled"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> EPCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHESEL`"] -pub type CHESEL_R = crate::R; +#[doc = "Field `CHESEL` reader - Correct Hall Event Service Request Selector"] +pub struct CHESEL_R(crate::FieldReader); impl CHESEL_R { + pub(crate) fn new(bits: bool) -> Self { + CHESEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHESEL_A { @@ -713,15 +812,22 @@ impl CHESEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHESEL_A::VALUE1 + **self == CHESEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHESEL_A::VALUE2 + **self == CHESEL_A::VALUE2 } } -#[doc = "Write proxy for field `CHESEL`"] +impl core::ops::Deref for CHESEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHESEL` writer - Correct Hall Event Service Request Selector"] pub struct CHESEL_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> CHESEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHESEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Correct Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> CHESEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WHESEL`"] -pub type WHESEL_R = crate::R; +#[doc = "Field `WHESEL` reader - Wrong Hall Event Service Request Selector"] +pub struct WHESEL_R(crate::FieldReader); impl WHESEL_R { + pub(crate) fn new(bits: bool) -> Self { + WHESEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WHESEL_A { @@ -788,15 +895,22 @@ impl WHESEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WHESEL_A::VALUE1 + **self == WHESEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WHESEL_A::VALUE2 + **self == WHESEL_A::VALUE2 + } +} +impl core::ops::Deref for WHESEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WHESEL`"] +#[doc = "Field `WHESEL` writer - Wrong Hall Event Service Request Selector"] pub struct WHESEL_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> WHESEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WHESEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wrong Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> WHESEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIESEL`"] -pub type HIESEL_R = crate::R; +#[doc = "Field `HIESEL` reader - Hall Inputs Update Event Service Request Selector"] +pub struct HIESEL_R(crate::FieldReader); impl HIESEL_R { + pub(crate) fn new(bits: bool) -> Self { + HIESEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIESEL_A { @@ -863,15 +978,22 @@ impl HIESEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIESEL_A::VALUE1 + **self == HIESEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIESEL_A::VALUE2 + **self == HIESEL_A::VALUE2 + } +} +impl core::ops::Deref for HIESEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HIESEL`"] +#[doc = "Field `HIESEL` writer - Hall Inputs Update Event Service Request Selector"] pub struct HIESEL_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> HIESEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIESEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Hall Inputs Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> HIESEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSTSEL`"] -pub type MSTSEL_R = crate::R; +#[doc = "Field `MSTSEL` reader - Multi-Channel pattern Update Event Service Request Selector"] +pub struct MSTSEL_R(crate::FieldReader); impl MSTSEL_R { + pub(crate) fn new(bits: bool) -> Self { + MSTSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSTSEL_A { @@ -938,15 +1061,22 @@ impl MSTSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSTSEL_A::VALUE1 + **self == MSTSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSTSEL_A::VALUE2 + **self == MSTSEL_A::VALUE2 + } +} +impl core::ops::Deref for MSTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSTSEL`"] +#[doc = "Field `MSTSEL` writer - Multi-Channel pattern Update Event Service Request Selector"] pub struct MSTSEL_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> MSTSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSTSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Multi-Channel pattern Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> MSTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INDSEL`"] -pub type INDSEL_R = crate::R; +#[doc = "Field `INDSEL` reader - Quadrature Index Event Service Request Selector"] +pub struct INDSEL_R(crate::FieldReader); impl INDSEL_R { + pub(crate) fn new(bits: bool) -> Self { + INDSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INDSEL_A { @@ -1013,15 +1144,22 @@ impl INDSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INDSEL_A::VALUE1 + **self == INDSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INDSEL_A::VALUE2 + **self == INDSEL_A::VALUE2 } } -#[doc = "Write proxy for field `INDSEL`"] +impl core::ops::Deref for INDSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INDSEL` writer - Quadrature Index Event Service Request Selector"] pub struct INDSEL_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> INDSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INDSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Index Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> INDSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERRSEL`"] -pub type ERRSEL_R = crate::R; +#[doc = "Field `ERRSEL` reader - Quadrature Phase Error Event Service Request Selector"] +pub struct ERRSEL_R(crate::FieldReader); impl ERRSEL_R { + pub(crate) fn new(bits: bool) -> Self { + ERRSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERRSEL_A { @@ -1088,15 +1227,22 @@ impl ERRSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERRSEL_A::VALUE1 + **self == ERRSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERRSEL_A::VALUE2 + **self == ERRSEL_A::VALUE2 } } -#[doc = "Write proxy for field `ERRSEL`"] +impl core::ops::Deref for ERRSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERRSEL` writer - Quadrature Phase Error Event Service Request Selector"] pub struct ERRSEL_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> ERRSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERRSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Phase error Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> ERRSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CNTSEL`"] -pub type CNTSEL_R = crate::R; +#[doc = "Field `CNTSEL` reader - Quadrature Clock Event Service Request Selector"] +pub struct CNTSEL_R(crate::FieldReader); impl CNTSEL_R { + pub(crate) fn new(bits: bool) -> Self { + CNTSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CNTSEL_A { @@ -1163,15 +1310,22 @@ impl CNTSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CNTSEL_A::VALUE1 + **self == CNTSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CNTSEL_A::VALUE2 + **self == CNTSEL_A::VALUE2 + } +} +impl core::ops::Deref for CNTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CNTSEL`"] +#[doc = "Field `CNTSEL` writer - Quadrature Clock Event Service Request Selector"] pub struct CNTSEL_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> CNTSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CNTSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> CNTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1224,9 +1376,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIRSEL`"] -pub type DIRSEL_R = crate::R; +#[doc = "Field `DIRSEL` reader - Quadrature Direction Update Event Service Request Selector"] +pub struct DIRSEL_R(crate::FieldReader); impl DIRSEL_R { + pub(crate) fn new(bits: bool) -> Self { + DIRSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIRSEL_A { @@ -1238,15 +1393,22 @@ impl DIRSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIRSEL_A::VALUE1 + **self == DIRSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIRSEL_A::VALUE2 + **self == DIRSEL_A::VALUE2 } } -#[doc = "Write proxy for field `DIRSEL`"] +impl core::ops::Deref for DIRSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIRSEL` writer - Quadrature Direction Update Event Service Request Selector"] pub struct DIRSEL_W<'a> { w: &'a mut W, } @@ -1254,9 +1416,7 @@ impl<'a> DIRSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIRSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Direction Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -1281,7 +1441,7 @@ impl<'a> DIRSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1299,9 +1459,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCLSEL`"] -pub type PCLSEL_R = crate::R; +#[doc = "Field `PCLSEL` reader - Quadrature Period clock Event Service Request Selector"] +pub struct PCLSEL_R(crate::FieldReader); impl PCLSEL_R { + pub(crate) fn new(bits: bool) -> Self { + PCLSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCLSEL_A { @@ -1313,15 +1476,22 @@ impl PCLSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCLSEL_A::VALUE1 + **self == PCLSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCLSEL_A::VALUE2 + **self == PCLSEL_A::VALUE2 + } +} +impl core::ops::Deref for PCLSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PCLSEL`"] +#[doc = "Field `PCLSEL` writer - Quadrature Period clock Event Service Request Selector"] pub struct PCLSEL_W<'a> { w: &'a mut W, } @@ -1329,9 +1499,7 @@ impl<'a> PCLSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCLSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Quadrature Period clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] @@ -1356,7 +1524,7 @@ impl<'a> PCLSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -1543,4 +1711,30 @@ impl W { pub fn pclsel(&mut self) -> PCLSEL_W { PCLSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Interrupt Enable\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 [pflge](index.html) module"] +pub struct PFLGE_SPEC; +impl crate::RegisterSpec for PFLGE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pflge::R](R) reader structure"] +impl crate::Readable for PFLGE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pflge::W](W) writer structure"] +impl crate::Writable for PFLGE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PFLGE to value 0"] +impl crate::Resettable for PFLGE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/prun.rs b/src/posif0/prun.rs index 728163fe..6d272a5d 100644 --- a/src/posif0/prun.rs +++ b/src/posif0/prun.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PRUN"] -pub type R = crate::R; +#[doc = "Register `PRUN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Run Bit\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RB_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RB`"] -pub type RB_R = crate::R; +#[doc = "Field `RB` reader - Run Bit"] +pub struct RB_R(crate::FieldReader); impl RB_R { + pub(crate) fn new(bits: bool) -> Self { + RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RB_A { @@ -28,12 +44,19 @@ impl RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RB_A::VALUE1 + **self == RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RB_A::VALUE2 + **self == RB_A::VALUE2 + } +} +impl core::ops::Deref for RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { RB_R::new((self.bits & 0x01) != 0) } } +#[doc = "Service Request Processing Run Bit Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prun](index.html) module"] +pub struct PRUN_SPEC; +impl crate::RegisterSpec for PRUN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prun::R](R) reader structure"] +impl crate::Readable for PRUN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PRUN to value 0"] +impl crate::Resettable for PRUN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/posif0/prunc.rs b/src/posif0/prunc.rs index 2c898e1f..0d9bc54a 100644 --- a/src/posif0/prunc.rs +++ b/src/posif0/prunc.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register PRUNC"] -pub type W = crate::W; -#[doc = "Register PRUNC `reset()`'s with value 0"] -impl crate::ResetValue for super::PRUNC { - type Type = u32; +#[doc = "Register `PRUNC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `CRB`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CRB` writer - Clear Run bit"] pub struct CRB_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> CRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `CSM`"] +#[doc = "Field `CSM` writer - Clear Current internal status"] pub struct CSM_W<'a> { w: &'a mut W, } @@ -48,7 +59,7 @@ impl<'a> CSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -63,4 +74,26 @@ impl W { pub fn csm(&mut self) -> CSM_W { CSM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Run Bit Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prunc](index.html) module"] +pub struct PRUNC_SPEC; +impl crate::RegisterSpec for PRUNC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prunc::W](W) writer structure"] +impl crate::Writable for PRUNC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRUNC to value 0"] +impl crate::Resettable for PRUNC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/pruns.rs b/src/posif0/pruns.rs index f9b4c294..39b805b8 100644 --- a/src/posif0/pruns.rs +++ b/src/posif0/pruns.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register PRUNS"] -pub type W = crate::W; -#[doc = "Register PRUNS `reset()`'s with value 0"] -impl crate::ResetValue for super::PRUNS { - type Type = u32; +#[doc = "Register `PRUNS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SRB`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SRB` writer - Set Run bit"] pub struct SRB_W<'a> { w: &'a mut W, } @@ -26,7 +37,7 @@ impl<'a> SRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -36,4 +47,26 @@ impl W { pub fn srb(&mut self) -> SRB_W { SRB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Run Bit Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pruns](index.html) module"] +pub struct PRUNS_SPEC; +impl crate::RegisterSpec for PRUNS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [pruns::W](W) writer structure"] +impl crate::Writable for PRUNS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRUNS to value 0"] +impl crate::Resettable for PRUNS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/psus.rs b/src/posif0/psus.rs index 6e673bd2..abc4cc19 100644 --- a/src/posif0/psus.rs +++ b/src/posif0/psus.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSUS"] -pub type R = crate::R; -#[doc = "Writer for register PSUS"] -pub type W = crate::W; -#[doc = "Register PSUS `reset()`'s with value 0"] -impl crate::ResetValue for super::PSUS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSUS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Quadrature Mode Suspend Config\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `QSUS`"] -pub type QSUS_R = crate::R; +#[doc = "Field `QSUS` reader - Quadrature Mode Suspend Config"] +pub struct QSUS_R(crate::FieldReader); impl QSUS_R { + pub(crate) fn new(bits: u8) -> Self { + QSUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> QSUS_A { @@ -46,25 +73,32 @@ impl QSUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == QSUS_A::VALUE1 + **self == QSUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == QSUS_A::VALUE2 + **self == QSUS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == QSUS_A::VALUE3 + **self == QSUS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == QSUS_A::VALUE4 + **self == QSUS_A::VALUE4 } } -#[doc = "Write proxy for field `QSUS`"] +impl core::ops::Deref for QSUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `QSUS` writer - Quadrature Mode Suspend Config"] pub struct QSUS_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> QSUS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: QSUS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Suspend request ignored"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> QSUS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -122,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MSUS`"] -pub type MSUS_R = crate::R; +#[doc = "Field `MSUS` reader - Multi-Channel Mode Suspend Config"] +pub struct MSUS_R(crate::FieldReader); impl MSUS_R { + pub(crate) fn new(bits: u8) -> Self { + MSUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSUS_A { @@ -139,25 +174,32 @@ impl MSUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSUS_A::VALUE1 + **self == MSUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSUS_A::VALUE2 + **self == MSUS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MSUS_A::VALUE3 + **self == MSUS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MSUS_A::VALUE4 + **self == MSUS_A::VALUE4 + } +} +impl core::ops::Deref for MSUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSUS`"] +#[doc = "Field `MSUS` writer - Multi-Channel Mode Suspend Config"] pub struct MSUS_W<'a> { w: &'a mut W, } @@ -165,9 +207,7 @@ impl<'a> MSUS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSUS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Suspend request ignored"] #[inline(always)] @@ -192,7 +232,7 @@ impl<'a> MSUS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -219,4 +259,30 @@ impl W { pub fn msus(&mut self) -> MSUS_W { MSUS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Suspend Config\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 [psus](index.html) module"] +pub struct PSUS_SPEC; +impl crate::RegisterSpec for PSUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psus::R](R) reader structure"] +impl crate::Readable for PSUS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psus::W](W) writer structure"] +impl crate::Writable for PSUS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSUS to value 0"] +impl crate::Resettable for PSUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/qdc.rs b/src/posif0/qdc.rs index 36211240..be4f7818 100644 --- a/src/posif0/qdc.rs +++ b/src/posif0/qdc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register QDC"] -pub type R = crate::R; -#[doc = "Writer for register QDC"] -pub type W = crate::W; -#[doc = "Register QDC `reset()`'s with value 0"] -impl crate::ResetValue for super::QDC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `QDC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `QDC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Phase A Level selector\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PALS`"] -pub type PALS_R = crate::R; +#[doc = "Field `PALS` reader - Phase A Level selector"] +pub struct PALS_R(crate::FieldReader); impl PALS_R { + pub(crate) fn new(bits: bool) -> Self { + PALS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PALS_A { @@ -38,15 +65,22 @@ impl PALS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PALS_A::VALUE1 + **self == PALS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PALS_A::VALUE2 + **self == PALS_A::VALUE2 + } +} +impl core::ops::Deref for PALS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PALS`"] +#[doc = "Field `PALS` writer - Phase A Level selector"] pub struct PALS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PALS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PALS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Phase A is active HIGH"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PALS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PBLS`"] -pub type PBLS_R = crate::R; +#[doc = "Field `PBLS` reader - Phase B Level selector"] +pub struct PBLS_R(crate::FieldReader); impl PBLS_R { + pub(crate) fn new(bits: bool) -> Self { + PBLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PBLS_A { @@ -113,15 +148,22 @@ impl PBLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PBLS_A::VALUE1 + **self == PBLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PBLS_A::VALUE2 + **self == PBLS_A::VALUE2 + } +} +impl core::ops::Deref for PBLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PBLS`"] +#[doc = "Field `PBLS` writer - Phase B Level selector"] pub struct PBLS_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PBLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PBLS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Phase B is active HIGH"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PBLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PHS`"] -pub type PHS_R = crate::R; +#[doc = "Field `PHS` reader - Phase signals swap"] +pub struct PHS_R(crate::FieldReader); impl PHS_R { + pub(crate) fn new(bits: bool) -> Self { + PHS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PHS_A { @@ -188,15 +231,22 @@ impl PHS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PHS_A::VALUE1 + **self == PHS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PHS_A::VALUE2 + **self == PHS_A::VALUE2 + } +} +impl core::ops::Deref for PHS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PHS`"] +#[doc = "Field `PHS` writer - Phase signals swap"] pub struct PHS_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PHS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PHS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Phase A is the leading signal for clockwise rotation"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PHS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -252,37 +300,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ICM`"] -pub type ICM_R = crate::R; +#[doc = "Field `ICM` reader - Index Marker generations control"] +pub struct ICM_R(crate::FieldReader); impl ICM_R { + pub(crate) fn new(bits: u8) -> Self { + ICM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ICM_A::VALUE1), - 1 => Val(ICM_A::VALUE2), - 2 => Val(ICM_A::VALUE3), - i => Res(i), + 0 => Some(ICM_A::VALUE1), + 1 => Some(ICM_A::VALUE2), + 2 => Some(ICM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ICM_A::VALUE1 + **self == ICM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ICM_A::VALUE2 + **self == ICM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ICM_A::VALUE3 + **self == ICM_A::VALUE3 + } +} +impl core::ops::Deref for ICM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ICM`"] +#[doc = "Field `ICM` writer - Index Marker generations control"] pub struct ICM_W<'a> { w: &'a mut W, } @@ -310,7 +367,7 @@ impl<'a> ICM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -328,9 +385,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DVAL`"] -pub type DVAL_R = crate::R; +#[doc = "Field `DVAL` reader - Current rotation direction"] +pub struct DVAL_R(crate::FieldReader); impl DVAL_R { + pub(crate) fn new(bits: bool) -> Self { + DVAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DVAL_A { @@ -342,12 +402,19 @@ impl DVAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DVAL_A::VALUE1 + **self == DVAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DVAL_A::VALUE2 + **self == DVAL_A::VALUE2 + } +} +impl core::ops::Deref for DVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -398,4 +465,30 @@ impl W { pub fn icm(&mut self) -> ICM_W { ICM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Quadrature Decoder Control\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 [qdc](index.html) module"] +pub struct QDC_SPEC; +impl crate::RegisterSpec for QDC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [qdc::R](R) reader structure"] +impl crate::Readable for QDC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [qdc::W](W) writer structure"] +impl crate::Writable for QDC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets QDC to value 0"] +impl crate::Resettable for QDC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/rpflg.rs b/src/posif0/rpflg.rs index f426e81b..5605880a 100644 --- a/src/posif0/rpflg.rs +++ b/src/posif0/rpflg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register RPFLG"] -pub type W = crate::W; -#[doc = "Register RPFLG `reset()`'s with value 0"] -impl crate::ResetValue for super::RPFLG { - type Type = u32; +#[doc = "Register `RPFLG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `RCHE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RCHE` writer - Correct Hall Event flag clear"] pub struct RCHE_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> RCHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `RWHE`"] +#[doc = "Field `RWHE` writer - Wrong Hall Event flag clear"] pub struct RWHE_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> RWHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `RHIE`"] +#[doc = "Field `RHIE` writer - Hall Inputs Update Event flag clear"] pub struct RHIE_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> RHIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `RMST`"] +#[doc = "Field `RMST` writer - Multi-Channel Pattern shadow transfer flag clear"] pub struct RMST_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> RMST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `RINDX`"] +#[doc = "Field `RINDX` writer - Quadrature Index flag clear"] pub struct RINDX_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> RINDX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `RERR`"] +#[doc = "Field `RERR` writer - Quadrature Phase Error flag clear"] pub struct RERR_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> RERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `RCNT`"] +#[doc = "Field `RCNT` writer - Quadrature CLK flag clear"] pub struct RCNT_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> RCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `RDIR`"] +#[doc = "Field `RDIR` writer - Quadrature Direction flag clear"] pub struct RDIR_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> RDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `RPCLK`"] +#[doc = "Field `RPCLK` writer - Quadrature period clock flag clear"] pub struct RPCLK_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> RPCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn rpclk(&mut self) -> RPCLK_W { RPCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Interrupt Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rpflg](index.html) module"] +pub struct RPFLG_SPEC; +impl crate::RegisterSpec for RPFLG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [rpflg::W](W) writer structure"] +impl crate::Writable for RPFLG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RPFLG to value 0"] +impl crate::Resettable for RPFLG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/posif0/spflg.rs b/src/posif0/spflg.rs index cde4e706..65553fc5 100644 --- a/src/posif0/spflg.rs +++ b/src/posif0/spflg.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SPFLG"] -pub type W = crate::W; -#[doc = "Register SPFLG `reset()`'s with value 0"] -impl crate::ResetValue for super::SPFLG { - type Type = u32; +#[doc = "Register `SPFLG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SCHE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SCHE` writer - Correct Hall Event flag set"] pub struct SCHE_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> SCHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `SWHE`"] +#[doc = "Field `SWHE` writer - Wrong Hall Event flag set"] pub struct SWHE_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> SWHE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `SHIE`"] +#[doc = "Field `SHIE` writer - Hall Inputs Update Event flag set"] pub struct SHIE_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> SHIE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `SMST`"] +#[doc = "Field `SMST` writer - Multi-Channel Pattern shadow transfer flag set"] pub struct SMST_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> SMST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `SINDX`"] +#[doc = "Field `SINDX` writer - Quadrature Index flag set"] pub struct SINDX_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> SINDX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SERR`"] +#[doc = "Field `SERR` writer - Quadrature Phase Error flag set"] pub struct SERR_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> SERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `SCNT`"] +#[doc = "Field `SCNT` writer - Quadrature CLK flag set"] pub struct SCNT_W<'a> { w: &'a mut W, } @@ -158,11 +169,11 @@ impl<'a> SCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Write proxy for field `SDIR`"] +#[doc = "Field `SDIR` writer - Quadrature Direction flag set"] pub struct SDIR_W<'a> { w: &'a mut W, } @@ -180,11 +191,11 @@ impl<'a> SDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Write proxy for field `SPCLK`"] +#[doc = "Field `SPCLK` writer - Quadrature period clock flag set"] pub struct SPCLK_W<'a> { w: &'a mut W, } @@ -202,7 +213,7 @@ impl<'a> SPCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -252,4 +263,26 @@ impl W { pub fn spclk(&mut self) -> SPCLK_W { SPCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Processing Interrupt Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spflg](index.html) module"] +pub struct SPFLG_SPEC; +impl crate::RegisterSpec for SPFLG_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [spflg::W](W) writer structure"] +impl crate::Writable for SPFLG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SPFLG to value 0"] +impl crate::Resettable for SPFLG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb.rs b/src/ppb.rs index b2013768..0534ab6a 100644 --- a/src/ppb.rs +++ b/src/ppb.rs @@ -1,1104 +1,522 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved0: [u8; 8usize], + _reserved0: [u8; 0x08], #[doc = "0x08 - Auxiliary Control Register"] - pub actlr: ACTLR, - _reserved1: [u8; 4usize], + pub actlr: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x10 - SysTick Control and Status Register"] - pub syst_csr: SYST_CSR, + pub syst_csr: crate::Reg, #[doc = "0x14 - SysTick Reload Value Register"] - pub syst_rvr: SYST_RVR, + pub syst_rvr: crate::Reg, #[doc = "0x18 - SysTick Current Value Register"] - pub syst_cvr: SYST_CVR, + pub syst_cvr: crate::Reg, #[doc = "0x1c - SysTick Calibration Value Register r"] - pub syst_calib: SYST_CALIB, - _reserved5: [u8; 224usize], + pub syst_calib: crate::Reg, + _reserved5: [u8; 0xe0], #[doc = "0x100 - Interrupt Set-enable Register 0"] - pub nvic_iser0: NVIC_ISER0, + pub nvic_iser0: crate::Reg, #[doc = "0x104 - Interrupt Set-enable Register 1"] - pub nvic_iser1: NVIC_ISER1, + pub nvic_iser1: crate::Reg, #[doc = "0x108 - Interrupt Set-enable Register 2"] - pub nvic_iser2: NVIC_ISER2, + pub nvic_iser2: crate::Reg, #[doc = "0x10c - Interrupt Set-enable Register 3"] - pub nvic_iser3: NVIC_ISER3, - _reserved9: [u8; 112usize], + pub nvic_iser3: crate::Reg, + _reserved9: [u8; 0x70], #[doc = "0x180 - Interrupt Clear-enable Register 0"] - pub nvic_icer0: NVIC_ICER0, + pub nvic_icer0: crate::Reg, #[doc = "0x184 - Interrupt Clear-enable Register 1"] - pub nvic_icer1: NVIC_ICER1, + pub nvic_icer1: crate::Reg, #[doc = "0x188 - Interrupt Clear-enable Register 2"] - pub nvic_icer2: NVIC_ICER2, + pub nvic_icer2: crate::Reg, #[doc = "0x18c - Interrupt Clear-enable Register 3"] - pub nvic_icer3: NVIC_ICER3, - _reserved13: [u8; 112usize], + pub nvic_icer3: crate::Reg, + _reserved13: [u8; 0x70], #[doc = "0x200 - Interrupt Set-pending Register 0"] - pub nvic_ispr0: NVIC_ISPR0, + pub nvic_ispr0: crate::Reg, #[doc = "0x204 - Interrupt Set-pending Register 1"] - pub nvic_ispr1: NVIC_ISPR1, + pub nvic_ispr1: crate::Reg, #[doc = "0x208 - Interrupt Set-pending Register 2"] - pub nvic_ispr2: NVIC_ISPR2, + pub nvic_ispr2: crate::Reg, #[doc = "0x20c - Interrupt Set-pending Register 3"] - pub nvic_ispr3: NVIC_ISPR3, - _reserved17: [u8; 112usize], + pub nvic_ispr3: crate::Reg, + _reserved17: [u8; 0x70], #[doc = "0x280 - Interrupt Clear-pending Register 0"] - pub nvic_icpr0: NVIC_ICPR0, + pub nvic_icpr0: crate::Reg, #[doc = "0x284 - Interrupt Clear-pending Register 1"] - pub nvic_icpr1: NVIC_ICPR1, + pub nvic_icpr1: crate::Reg, #[doc = "0x288 - Interrupt Clear-pending Register 2"] - pub nvic_icpr2: NVIC_ICPR2, + pub nvic_icpr2: crate::Reg, #[doc = "0x28c - Interrupt Clear-pending Register 3"] - pub nvic_icpr3: NVIC_ICPR3, - _reserved21: [u8; 112usize], + pub nvic_icpr3: crate::Reg, + _reserved21: [u8; 0x70], #[doc = "0x300 - Interrupt Active Bit Register 0"] - pub nvic_iabr0: NVIC_IABR0, + pub nvic_iabr0: crate::Reg, #[doc = "0x304 - Interrupt Active Bit Register 1"] - pub nvic_iabr1: NVIC_IABR1, + pub nvic_iabr1: crate::Reg, #[doc = "0x308 - Interrupt Active Bit Register 2"] - pub nvic_iabr2: NVIC_IABR2, + pub nvic_iabr2: crate::Reg, #[doc = "0x30c - Interrupt Active Bit Register 3"] - pub nvic_iabr3: NVIC_IABR3, - _reserved25: [u8; 240usize], + pub nvic_iabr3: crate::Reg, + _reserved25: [u8; 0xf0], #[doc = "0x400 - Interrupt Priority Register 0"] - pub nvic_ipr0: NVIC_IPR0, + pub nvic_ipr0: crate::Reg, #[doc = "0x404 - Interrupt Priority Register 1"] - pub nvic_ipr1: NVIC_IPR1, + pub nvic_ipr1: crate::Reg, #[doc = "0x408 - Interrupt Priority Register 2"] - pub nvic_ipr2: NVIC_IPR2, + pub nvic_ipr2: crate::Reg, #[doc = "0x40c - Interrupt Priority Register 3"] - pub nvic_ipr3: NVIC_IPR3, + pub nvic_ipr3: crate::Reg, #[doc = "0x410 - Interrupt Priority Register 4"] - pub nvic_ipr4: NVIC_IPR4, + pub nvic_ipr4: crate::Reg, #[doc = "0x414 - Interrupt Priority Register 5"] - pub nvic_ipr5: NVIC_IPR5, + pub nvic_ipr5: crate::Reg, #[doc = "0x418 - Interrupt Priority Register 6"] - pub nvic_ipr6: NVIC_IPR6, + pub nvic_ipr6: crate::Reg, #[doc = "0x41c - Interrupt Priority Register 7"] - pub nvic_ipr7: NVIC_IPR7, + pub nvic_ipr7: crate::Reg, #[doc = "0x420 - Interrupt Priority Register 8"] - pub nvic_ipr8: NVIC_IPR8, + pub nvic_ipr8: crate::Reg, #[doc = "0x424 - Interrupt Priority Register 9"] - pub nvic_ipr9: NVIC_IPR9, + pub nvic_ipr9: crate::Reg, #[doc = "0x428 - Interrupt Priority Register 10"] - pub nvic_ipr10: NVIC_IPR10, + pub nvic_ipr10: crate::Reg, #[doc = "0x42c - Interrupt Priority Register 11"] - pub nvic_ipr11: NVIC_IPR11, + pub nvic_ipr11: crate::Reg, #[doc = "0x430 - Interrupt Priority Register 12"] - pub nvic_ipr12: NVIC_IPR12, + pub nvic_ipr12: crate::Reg, #[doc = "0x434 - Interrupt Priority Register 13"] - pub nvic_ipr13: NVIC_IPR13, + pub nvic_ipr13: crate::Reg, #[doc = "0x438 - Interrupt Priority Register 14"] - pub nvic_ipr14: NVIC_IPR14, + pub nvic_ipr14: crate::Reg, #[doc = "0x43c - Interrupt Priority Register 15"] - pub nvic_ipr15: NVIC_IPR15, + pub nvic_ipr15: crate::Reg, #[doc = "0x440 - Interrupt Priority Register 16"] - pub nvic_ipr16: NVIC_IPR16, + pub nvic_ipr16: crate::Reg, #[doc = "0x444 - Interrupt Priority Register 17"] - pub nvic_ipr17: NVIC_IPR17, + pub nvic_ipr17: crate::Reg, #[doc = "0x448 - Interrupt Priority Register 18"] - pub nvic_ipr18: NVIC_IPR18, + pub nvic_ipr18: crate::Reg, #[doc = "0x44c - Interrupt Priority Register 19"] - pub nvic_ipr19: NVIC_IPR19, + pub nvic_ipr19: crate::Reg, #[doc = "0x450 - Interrupt Priority Register 20"] - pub nvic_ipr20: NVIC_IPR20, + pub nvic_ipr20: crate::Reg, #[doc = "0x454 - Interrupt Priority Register 21"] - pub nvic_ipr21: NVIC_IPR21, + pub nvic_ipr21: crate::Reg, #[doc = "0x458 - Interrupt Priority Register 22"] - pub nvic_ipr22: NVIC_IPR22, + pub nvic_ipr22: crate::Reg, #[doc = "0x45c - Interrupt Priority Register 23"] - pub nvic_ipr23: NVIC_IPR23, + pub nvic_ipr23: crate::Reg, #[doc = "0x460 - Interrupt Priority Register 24"] - pub nvic_ipr24: NVIC_IPR24, + pub nvic_ipr24: crate::Reg, #[doc = "0x464 - Interrupt Priority Register 25"] - pub nvic_ipr25: NVIC_IPR25, + pub nvic_ipr25: crate::Reg, #[doc = "0x468 - Interrupt Priority Register 26"] - pub nvic_ipr26: NVIC_IPR26, + pub nvic_ipr26: crate::Reg, #[doc = "0x46c - Interrupt Priority Register 27"] - pub nvic_ipr27: NVIC_IPR27, - _reserved53: [u8; 2192usize], + pub nvic_ipr27: crate::Reg, + _reserved53: [u8; 0x0890], #[doc = "0xd00 - CPUID Base Register"] - pub cpuid: CPUID, + pub cpuid: crate::Reg, #[doc = "0xd04 - Interrupt Control and State Register"] - pub icsr: ICSR, + pub icsr: crate::Reg, #[doc = "0xd08 - Vector Table Offset Register"] - pub vtor: VTOR, + pub vtor: crate::Reg, #[doc = "0xd0c - Application Interrupt and Reset Control Register"] - pub aircr: AIRCR, + pub aircr: crate::Reg, #[doc = "0xd10 - System Control Register"] - pub scr: SCR, + pub scr: crate::Reg, #[doc = "0xd14 - Configuration and Control Register"] - pub ccr: CCR, + pub ccr: crate::Reg, #[doc = "0xd18 - System Handler Priority Register 1"] - pub shpr1: SHPR1, + pub shpr1: crate::Reg, #[doc = "0xd1c - System Handler Priority Register 2"] - pub shpr2: SHPR2, + pub shpr2: crate::Reg, #[doc = "0xd20 - System Handler Priority Register 3"] - pub shpr3: SHPR3, + pub shpr3: crate::Reg, #[doc = "0xd24 - System Handler Control and State Register"] - pub shcsr: SHCSR, + pub shcsr: crate::Reg, #[doc = "0xd28 - Configurable Fault Status Register"] - pub cfsr: CFSR, + pub cfsr: crate::Reg, #[doc = "0xd2c - HardFault Status Register"] - pub hfsr: HFSR, - _reserved65: [u8; 4usize], + pub hfsr: crate::Reg, + _reserved65: [u8; 0x04], #[doc = "0xd34 - MemManage Fault Address Register"] - pub mmfar: MMFAR, + pub mmfar: crate::Reg, #[doc = "0xd38 - BusFault Address Register"] - pub bfar: BFAR, + pub bfar: crate::Reg, #[doc = "0xd3c - Auxiliary Fault Status Register"] - pub afsr: AFSR, - _reserved68: [u8; 72usize], + pub afsr: crate::Reg, + _reserved68: [u8; 0x48], #[doc = "0xd88 - Coprocessor Access Control Register"] - pub cpacr: CPACR, - _reserved69: [u8; 4usize], + pub cpacr: crate::Reg, + _reserved69: [u8; 0x04], #[doc = "0xd90 - MPU Type Register"] - pub mpu_type: MPU_TYPE, + pub mpu_type: crate::Reg, #[doc = "0xd94 - MPU Control Register"] - pub mpu_ctrl: MPU_CTRL, + pub mpu_ctrl: crate::Reg, #[doc = "0xd98 - MPU Region Number Register"] - pub mpu_rnr: MPU_RNR, + pub mpu_rnr: crate::Reg, #[doc = "0xd9c - MPU Region Base Address Register"] - pub mpu_rbar: MPU_RBAR, + pub mpu_rbar: crate::Reg, #[doc = "0xda0 - MPU Region Attribute and Size Register"] - pub mpu_rasr: MPU_RASR, + pub mpu_rasr: crate::Reg, #[doc = "0xda4 - MPU Region Base Address Register A1"] - pub mpu_rbar_a1: MPU_RBAR_A1, + pub mpu_rbar_a1: crate::Reg, #[doc = "0xda8 - MPU Region Attribute and Size Register A1"] - pub mpu_rasr_a1: MPU_RASR_A1, + pub mpu_rasr_a1: crate::Reg, #[doc = "0xdac - MPU Region Base Address Register A2"] - pub mpu_rbar_a2: MPU_RBAR_A2, + pub mpu_rbar_a2: crate::Reg, #[doc = "0xdb0 - MPU Region Attribute and Size Register A2"] - pub mpu_rasr_a2: MPU_RASR_A2, + pub mpu_rasr_a2: crate::Reg, #[doc = "0xdb4 - MPU Region Base Address Register A3"] - pub mpu_rbar_a3: MPU_RBAR_A3, + pub mpu_rbar_a3: crate::Reg, #[doc = "0xdb8 - MPU Region Attribute and Size Register A3"] - pub mpu_rasr_a3: MPU_RASR_A3, - _reserved80: [u8; 324usize], + pub mpu_rasr_a3: crate::Reg, + _reserved80: [u8; 0x0144], #[doc = "0xf00 - Software Trigger Interrupt Register"] - pub stir: STIR, - _reserved81: [u8; 48usize], + pub stir: crate::Reg, + _reserved81: [u8; 0x30], #[doc = "0xf34 - Floating-point Context Control Register"] - pub fpccr: FPCCR, + pub fpccr: crate::Reg, #[doc = "0xf38 - Floating-point Context Address Register"] - pub fpcar: FPCAR, + pub fpcar: crate::Reg, #[doc = "0xf3c - Floating-point Default Status Control Register"] - pub fpdscr: FPDSCR, + pub fpdscr: crate::Reg, } -#[doc = "Auxiliary Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [actlr](actlr) module"] -pub type ACTLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ACTLR; -#[doc = "`read()` method returns [actlr::R](actlr::R) reader structure"] -impl crate::Readable for ACTLR {} -#[doc = "`write(|w| ..)` method takes [actlr::W](actlr::W) writer structure"] -impl crate::Writable for ACTLR {} +#[doc = "ACTLR register accessor: an alias for `Reg`"] +pub type ACTLR = crate::Reg; #[doc = "Auxiliary Control Register"] pub mod actlr; -#[doc = "SysTick Control and Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [syst_csr](syst_csr) module"] -pub type SYST_CSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYST_CSR; -#[doc = "`read()` method returns [syst_csr::R](syst_csr::R) reader structure"] -impl crate::Readable for SYST_CSR {} -#[doc = "`write(|w| ..)` method takes [syst_csr::W](syst_csr::W) writer structure"] -impl crate::Writable for SYST_CSR {} +#[doc = "SYST_CSR register accessor: an alias for `Reg`"] +pub type SYST_CSR = crate::Reg; #[doc = "SysTick Control and Status Register"] pub mod syst_csr; -#[doc = "SysTick Reload Value Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [syst_rvr](syst_rvr) module"] -pub type SYST_RVR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYST_RVR; -#[doc = "`read()` method returns [syst_rvr::R](syst_rvr::R) reader structure"] -impl crate::Readable for SYST_RVR {} -#[doc = "`write(|w| ..)` method takes [syst_rvr::W](syst_rvr::W) writer structure"] -impl crate::Writable for SYST_RVR {} +#[doc = "SYST_RVR register accessor: an alias for `Reg`"] +pub type SYST_RVR = crate::Reg; #[doc = "SysTick Reload Value Register"] pub mod syst_rvr; -#[doc = "SysTick Current Value Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [syst_cvr](syst_cvr) module"] -pub type SYST_CVR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYST_CVR; -#[doc = "`read()` method returns [syst_cvr::R](syst_cvr::R) reader structure"] -impl crate::Readable for SYST_CVR {} -#[doc = "`write(|w| ..)` method takes [syst_cvr::W](syst_cvr::W) writer structure"] -impl crate::Writable for SYST_CVR {} +#[doc = "SYST_CVR register accessor: an alias for `Reg`"] +pub type SYST_CVR = crate::Reg; #[doc = "SysTick Current Value Register"] pub mod syst_cvr; -#[doc = "SysTick Calibration Value Register r\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [syst_calib](syst_calib) module"] -pub type SYST_CALIB = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYST_CALIB; -#[doc = "`read()` method returns [syst_calib::R](syst_calib::R) reader structure"] -impl crate::Readable for SYST_CALIB {} -#[doc = "`write(|w| ..)` method takes [syst_calib::W](syst_calib::W) writer structure"] -impl crate::Writable for SYST_CALIB {} +#[doc = "SYST_CALIB register accessor: an alias for `Reg`"] +pub type SYST_CALIB = crate::Reg; #[doc = "SysTick Calibration Value Register r"] pub mod syst_calib; -#[doc = "Interrupt Set-enable Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iser0](nvic_iser0) module"] -pub type NVIC_ISER0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISER0; -#[doc = "`read()` method returns [nvic_iser0::R](nvic_iser0::R) reader structure"] -impl crate::Readable for NVIC_ISER0 {} -#[doc = "`write(|w| ..)` method takes [nvic_iser0::W](nvic_iser0::W) writer structure"] -impl crate::Writable for NVIC_ISER0 {} +#[doc = "NVIC_ISER0 register accessor: an alias for `Reg`"] +pub type NVIC_ISER0 = crate::Reg; #[doc = "Interrupt Set-enable Register 0"] pub mod nvic_iser0; -#[doc = "Interrupt Set-enable Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iser1](nvic_iser1) module"] -pub type NVIC_ISER1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISER1; -#[doc = "`read()` method returns [nvic_iser1::R](nvic_iser1::R) reader structure"] -impl crate::Readable for NVIC_ISER1 {} -#[doc = "`write(|w| ..)` method takes [nvic_iser1::W](nvic_iser1::W) writer structure"] -impl crate::Writable for NVIC_ISER1 {} +#[doc = "NVIC_ISER1 register accessor: an alias for `Reg`"] +pub type NVIC_ISER1 = crate::Reg; #[doc = "Interrupt Set-enable Register 1"] pub mod nvic_iser1; -#[doc = "Interrupt Set-enable Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iser2](nvic_iser2) module"] -pub type NVIC_ISER2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISER2; -#[doc = "`read()` method returns [nvic_iser2::R](nvic_iser2::R) reader structure"] -impl crate::Readable for NVIC_ISER2 {} -#[doc = "`write(|w| ..)` method takes [nvic_iser2::W](nvic_iser2::W) writer structure"] -impl crate::Writable for NVIC_ISER2 {} +#[doc = "NVIC_ISER2 register accessor: an alias for `Reg`"] +pub type NVIC_ISER2 = crate::Reg; #[doc = "Interrupt Set-enable Register 2"] pub mod nvic_iser2; -#[doc = "Interrupt Set-enable Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iser3](nvic_iser3) module"] -pub type NVIC_ISER3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISER3; -#[doc = "`read()` method returns [nvic_iser3::R](nvic_iser3::R) reader structure"] -impl crate::Readable for NVIC_ISER3 {} -#[doc = "`write(|w| ..)` method takes [nvic_iser3::W](nvic_iser3::W) writer structure"] -impl crate::Writable for NVIC_ISER3 {} +#[doc = "NVIC_ISER3 register accessor: an alias for `Reg`"] +pub type NVIC_ISER3 = crate::Reg; #[doc = "Interrupt Set-enable Register 3"] pub mod nvic_iser3; -#[doc = "Interrupt Clear-enable Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icer0](nvic_icer0) module"] -pub type NVIC_ICER0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICER0; -#[doc = "`read()` method returns [nvic_icer0::R](nvic_icer0::R) reader structure"] -impl crate::Readable for NVIC_ICER0 {} -#[doc = "`write(|w| ..)` method takes [nvic_icer0::W](nvic_icer0::W) writer structure"] -impl crate::Writable for NVIC_ICER0 {} +#[doc = "NVIC_ICER0 register accessor: an alias for `Reg`"] +pub type NVIC_ICER0 = crate::Reg; #[doc = "Interrupt Clear-enable Register 0"] pub mod nvic_icer0; -#[doc = "Interrupt Clear-enable Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icer1](nvic_icer1) module"] -pub type NVIC_ICER1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICER1; -#[doc = "`read()` method returns [nvic_icer1::R](nvic_icer1::R) reader structure"] -impl crate::Readable for NVIC_ICER1 {} -#[doc = "`write(|w| ..)` method takes [nvic_icer1::W](nvic_icer1::W) writer structure"] -impl crate::Writable for NVIC_ICER1 {} +#[doc = "NVIC_ICER1 register accessor: an alias for `Reg`"] +pub type NVIC_ICER1 = crate::Reg; #[doc = "Interrupt Clear-enable Register 1"] pub mod nvic_icer1; -#[doc = "Interrupt Clear-enable Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icer2](nvic_icer2) module"] -pub type NVIC_ICER2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICER2; -#[doc = "`read()` method returns [nvic_icer2::R](nvic_icer2::R) reader structure"] -impl crate::Readable for NVIC_ICER2 {} -#[doc = "`write(|w| ..)` method takes [nvic_icer2::W](nvic_icer2::W) writer structure"] -impl crate::Writable for NVIC_ICER2 {} +#[doc = "NVIC_ICER2 register accessor: an alias for `Reg`"] +pub type NVIC_ICER2 = crate::Reg; #[doc = "Interrupt Clear-enable Register 2"] pub mod nvic_icer2; -#[doc = "Interrupt Clear-enable Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icer3](nvic_icer3) module"] -pub type NVIC_ICER3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICER3; -#[doc = "`read()` method returns [nvic_icer3::R](nvic_icer3::R) reader structure"] -impl crate::Readable for NVIC_ICER3 {} -#[doc = "`write(|w| ..)` method takes [nvic_icer3::W](nvic_icer3::W) writer structure"] -impl crate::Writable for NVIC_ICER3 {} +#[doc = "NVIC_ICER3 register accessor: an alias for `Reg`"] +pub type NVIC_ICER3 = crate::Reg; #[doc = "Interrupt Clear-enable Register 3"] pub mod nvic_icer3; -#[doc = "Interrupt Set-pending Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ispr0](nvic_ispr0) module"] -pub type NVIC_ISPR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISPR0; -#[doc = "`read()` method returns [nvic_ispr0::R](nvic_ispr0::R) reader structure"] -impl crate::Readable for NVIC_ISPR0 {} -#[doc = "`write(|w| ..)` method takes [nvic_ispr0::W](nvic_ispr0::W) writer structure"] -impl crate::Writable for NVIC_ISPR0 {} +#[doc = "NVIC_ISPR0 register accessor: an alias for `Reg`"] +pub type NVIC_ISPR0 = crate::Reg; #[doc = "Interrupt Set-pending Register 0"] pub mod nvic_ispr0; -#[doc = "Interrupt Set-pending Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ispr1](nvic_ispr1) module"] -pub type NVIC_ISPR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISPR1; -#[doc = "`read()` method returns [nvic_ispr1::R](nvic_ispr1::R) reader structure"] -impl crate::Readable for NVIC_ISPR1 {} -#[doc = "`write(|w| ..)` method takes [nvic_ispr1::W](nvic_ispr1::W) writer structure"] -impl crate::Writable for NVIC_ISPR1 {} +#[doc = "NVIC_ISPR1 register accessor: an alias for `Reg`"] +pub type NVIC_ISPR1 = crate::Reg; #[doc = "Interrupt Set-pending Register 1"] pub mod nvic_ispr1; -#[doc = "Interrupt Set-pending Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ispr2](nvic_ispr2) module"] -pub type NVIC_ISPR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISPR2; -#[doc = "`read()` method returns [nvic_ispr2::R](nvic_ispr2::R) reader structure"] -impl crate::Readable for NVIC_ISPR2 {} -#[doc = "`write(|w| ..)` method takes [nvic_ispr2::W](nvic_ispr2::W) writer structure"] -impl crate::Writable for NVIC_ISPR2 {} +#[doc = "NVIC_ISPR2 register accessor: an alias for `Reg`"] +pub type NVIC_ISPR2 = crate::Reg; #[doc = "Interrupt Set-pending Register 2"] pub mod nvic_ispr2; -#[doc = "Interrupt Set-pending Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ispr3](nvic_ispr3) module"] -pub type NVIC_ISPR3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ISPR3; -#[doc = "`read()` method returns [nvic_ispr3::R](nvic_ispr3::R) reader structure"] -impl crate::Readable for NVIC_ISPR3 {} -#[doc = "`write(|w| ..)` method takes [nvic_ispr3::W](nvic_ispr3::W) writer structure"] -impl crate::Writable for NVIC_ISPR3 {} +#[doc = "NVIC_ISPR3 register accessor: an alias for `Reg`"] +pub type NVIC_ISPR3 = crate::Reg; #[doc = "Interrupt Set-pending Register 3"] pub mod nvic_ispr3; -#[doc = "Interrupt Clear-pending Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icpr0](nvic_icpr0) module"] -pub type NVIC_ICPR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICPR0; -#[doc = "`read()` method returns [nvic_icpr0::R](nvic_icpr0::R) reader structure"] -impl crate::Readable for NVIC_ICPR0 {} -#[doc = "`write(|w| ..)` method takes [nvic_icpr0::W](nvic_icpr0::W) writer structure"] -impl crate::Writable for NVIC_ICPR0 {} +#[doc = "NVIC_ICPR0 register accessor: an alias for `Reg`"] +pub type NVIC_ICPR0 = crate::Reg; #[doc = "Interrupt Clear-pending Register 0"] pub mod nvic_icpr0; -#[doc = "Interrupt Clear-pending Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icpr1](nvic_icpr1) module"] -pub type NVIC_ICPR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICPR1; -#[doc = "`read()` method returns [nvic_icpr1::R](nvic_icpr1::R) reader structure"] -impl crate::Readable for NVIC_ICPR1 {} -#[doc = "`write(|w| ..)` method takes [nvic_icpr1::W](nvic_icpr1::W) writer structure"] -impl crate::Writable for NVIC_ICPR1 {} +#[doc = "NVIC_ICPR1 register accessor: an alias for `Reg`"] +pub type NVIC_ICPR1 = crate::Reg; #[doc = "Interrupt Clear-pending Register 1"] pub mod nvic_icpr1; -#[doc = "Interrupt Clear-pending Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icpr2](nvic_icpr2) module"] -pub type NVIC_ICPR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICPR2; -#[doc = "`read()` method returns [nvic_icpr2::R](nvic_icpr2::R) reader structure"] -impl crate::Readable for NVIC_ICPR2 {} -#[doc = "`write(|w| ..)` method takes [nvic_icpr2::W](nvic_icpr2::W) writer structure"] -impl crate::Writable for NVIC_ICPR2 {} +#[doc = "NVIC_ICPR2 register accessor: an alias for `Reg`"] +pub type NVIC_ICPR2 = crate::Reg; #[doc = "Interrupt Clear-pending Register 2"] pub mod nvic_icpr2; -#[doc = "Interrupt Clear-pending Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icpr3](nvic_icpr3) module"] -pub type NVIC_ICPR3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_ICPR3; -#[doc = "`read()` method returns [nvic_icpr3::R](nvic_icpr3::R) reader structure"] -impl crate::Readable for NVIC_ICPR3 {} -#[doc = "`write(|w| ..)` method takes [nvic_icpr3::W](nvic_icpr3::W) writer structure"] -impl crate::Writable for NVIC_ICPR3 {} +#[doc = "NVIC_ICPR3 register accessor: an alias for `Reg`"] +pub type NVIC_ICPR3 = crate::Reg; #[doc = "Interrupt Clear-pending Register 3"] pub mod nvic_icpr3; -#[doc = "Interrupt Active Bit Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iabr0](nvic_iabr0) module"] -pub type NVIC_IABR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IABR0; -#[doc = "`read()` method returns [nvic_iabr0::R](nvic_iabr0::R) reader structure"] -impl crate::Readable for NVIC_IABR0 {} -#[doc = "`write(|w| ..)` method takes [nvic_iabr0::W](nvic_iabr0::W) writer structure"] -impl crate::Writable for NVIC_IABR0 {} +#[doc = "NVIC_IABR0 register accessor: an alias for `Reg`"] +pub type NVIC_IABR0 = crate::Reg; #[doc = "Interrupt Active Bit Register 0"] pub mod nvic_iabr0; -#[doc = "Interrupt Active Bit Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iabr1](nvic_iabr1) module"] -pub type NVIC_IABR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IABR1; -#[doc = "`read()` method returns [nvic_iabr1::R](nvic_iabr1::R) reader structure"] -impl crate::Readable for NVIC_IABR1 {} -#[doc = "`write(|w| ..)` method takes [nvic_iabr1::W](nvic_iabr1::W) writer structure"] -impl crate::Writable for NVIC_IABR1 {} +#[doc = "NVIC_IABR1 register accessor: an alias for `Reg`"] +pub type NVIC_IABR1 = crate::Reg; #[doc = "Interrupt Active Bit Register 1"] pub mod nvic_iabr1; -#[doc = "Interrupt Active Bit Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iabr2](nvic_iabr2) module"] -pub type NVIC_IABR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IABR2; -#[doc = "`read()` method returns [nvic_iabr2::R](nvic_iabr2::R) reader structure"] -impl crate::Readable for NVIC_IABR2 {} -#[doc = "`write(|w| ..)` method takes [nvic_iabr2::W](nvic_iabr2::W) writer structure"] -impl crate::Writable for NVIC_IABR2 {} +#[doc = "NVIC_IABR2 register accessor: an alias for `Reg`"] +pub type NVIC_IABR2 = crate::Reg; #[doc = "Interrupt Active Bit Register 2"] pub mod nvic_iabr2; -#[doc = "Interrupt Active Bit Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_iabr3](nvic_iabr3) module"] -pub type NVIC_IABR3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IABR3; -#[doc = "`read()` method returns [nvic_iabr3::R](nvic_iabr3::R) reader structure"] -impl crate::Readable for NVIC_IABR3 {} -#[doc = "`write(|w| ..)` method takes [nvic_iabr3::W](nvic_iabr3::W) writer structure"] -impl crate::Writable for NVIC_IABR3 {} +#[doc = "NVIC_IABR3 register accessor: an alias for `Reg`"] +pub type NVIC_IABR3 = crate::Reg; #[doc = "Interrupt Active Bit Register 3"] pub mod nvic_iabr3; -#[doc = "Interrupt Priority Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr0](nvic_ipr0) module"] -pub type NVIC_IPR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR0; -#[doc = "`read()` method returns [nvic_ipr0::R](nvic_ipr0::R) reader structure"] -impl crate::Readable for NVIC_IPR0 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr0::W](nvic_ipr0::W) writer structure"] -impl crate::Writable for NVIC_IPR0 {} +#[doc = "NVIC_IPR0 register accessor: an alias for `Reg`"] +pub type NVIC_IPR0 = crate::Reg; #[doc = "Interrupt Priority Register 0"] pub mod nvic_ipr0; -#[doc = "Interrupt Priority Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr1](nvic_ipr1) module"] -pub type NVIC_IPR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR1; -#[doc = "`read()` method returns [nvic_ipr1::R](nvic_ipr1::R) reader structure"] -impl crate::Readable for NVIC_IPR1 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr1::W](nvic_ipr1::W) writer structure"] -impl crate::Writable for NVIC_IPR1 {} +#[doc = "NVIC_IPR1 register accessor: an alias for `Reg`"] +pub type NVIC_IPR1 = crate::Reg; #[doc = "Interrupt Priority Register 1"] pub mod nvic_ipr1; -#[doc = "Interrupt Priority Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr2](nvic_ipr2) module"] -pub type NVIC_IPR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR2; -#[doc = "`read()` method returns [nvic_ipr2::R](nvic_ipr2::R) reader structure"] -impl crate::Readable for NVIC_IPR2 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr2::W](nvic_ipr2::W) writer structure"] -impl crate::Writable for NVIC_IPR2 {} +#[doc = "NVIC_IPR2 register accessor: an alias for `Reg`"] +pub type NVIC_IPR2 = crate::Reg; #[doc = "Interrupt Priority Register 2"] pub mod nvic_ipr2; -#[doc = "Interrupt Priority Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr3](nvic_ipr3) module"] -pub type NVIC_IPR3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR3; -#[doc = "`read()` method returns [nvic_ipr3::R](nvic_ipr3::R) reader structure"] -impl crate::Readable for NVIC_IPR3 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr3::W](nvic_ipr3::W) writer structure"] -impl crate::Writable for NVIC_IPR3 {} +#[doc = "NVIC_IPR3 register accessor: an alias for `Reg`"] +pub type NVIC_IPR3 = crate::Reg; #[doc = "Interrupt Priority Register 3"] pub mod nvic_ipr3; -#[doc = "Interrupt Priority Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr4](nvic_ipr4) module"] -pub type NVIC_IPR4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR4; -#[doc = "`read()` method returns [nvic_ipr4::R](nvic_ipr4::R) reader structure"] -impl crate::Readable for NVIC_IPR4 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr4::W](nvic_ipr4::W) writer structure"] -impl crate::Writable for NVIC_IPR4 {} +#[doc = "NVIC_IPR4 register accessor: an alias for `Reg`"] +pub type NVIC_IPR4 = crate::Reg; #[doc = "Interrupt Priority Register 4"] pub mod nvic_ipr4; -#[doc = "Interrupt Priority Register 5\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr5](nvic_ipr5) module"] -pub type NVIC_IPR5 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR5; -#[doc = "`read()` method returns [nvic_ipr5::R](nvic_ipr5::R) reader structure"] -impl crate::Readable for NVIC_IPR5 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr5::W](nvic_ipr5::W) writer structure"] -impl crate::Writable for NVIC_IPR5 {} +#[doc = "NVIC_IPR5 register accessor: an alias for `Reg`"] +pub type NVIC_IPR5 = crate::Reg; #[doc = "Interrupt Priority Register 5"] pub mod nvic_ipr5; -#[doc = "Interrupt Priority Register 6\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr6](nvic_ipr6) module"] -pub type NVIC_IPR6 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR6; -#[doc = "`read()` method returns [nvic_ipr6::R](nvic_ipr6::R) reader structure"] -impl crate::Readable for NVIC_IPR6 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr6::W](nvic_ipr6::W) writer structure"] -impl crate::Writable for NVIC_IPR6 {} +#[doc = "NVIC_IPR6 register accessor: an alias for `Reg`"] +pub type NVIC_IPR6 = crate::Reg; #[doc = "Interrupt Priority Register 6"] pub mod nvic_ipr6; -#[doc = "Interrupt Priority Register 7\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr7](nvic_ipr7) module"] -pub type NVIC_IPR7 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR7; -#[doc = "`read()` method returns [nvic_ipr7::R](nvic_ipr7::R) reader structure"] -impl crate::Readable for NVIC_IPR7 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr7::W](nvic_ipr7::W) writer structure"] -impl crate::Writable for NVIC_IPR7 {} +#[doc = "NVIC_IPR7 register accessor: an alias for `Reg`"] +pub type NVIC_IPR7 = crate::Reg; #[doc = "Interrupt Priority Register 7"] pub mod nvic_ipr7; -#[doc = "Interrupt Priority Register 8\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr8](nvic_ipr8) module"] -pub type NVIC_IPR8 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR8; -#[doc = "`read()` method returns [nvic_ipr8::R](nvic_ipr8::R) reader structure"] -impl crate::Readable for NVIC_IPR8 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr8::W](nvic_ipr8::W) writer structure"] -impl crate::Writable for NVIC_IPR8 {} +#[doc = "NVIC_IPR8 register accessor: an alias for `Reg`"] +pub type NVIC_IPR8 = crate::Reg; #[doc = "Interrupt Priority Register 8"] pub mod nvic_ipr8; -#[doc = "Interrupt Priority Register 9\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr9](nvic_ipr9) module"] -pub type NVIC_IPR9 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR9; -#[doc = "`read()` method returns [nvic_ipr9::R](nvic_ipr9::R) reader structure"] -impl crate::Readable for NVIC_IPR9 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr9::W](nvic_ipr9::W) writer structure"] -impl crate::Writable for NVIC_IPR9 {} +#[doc = "NVIC_IPR9 register accessor: an alias for `Reg`"] +pub type NVIC_IPR9 = crate::Reg; #[doc = "Interrupt Priority Register 9"] pub mod nvic_ipr9; -#[doc = "Interrupt Priority Register 10\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr10](nvic_ipr10) module"] -pub type NVIC_IPR10 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR10; -#[doc = "`read()` method returns [nvic_ipr10::R](nvic_ipr10::R) reader structure"] -impl crate::Readable for NVIC_IPR10 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr10::W](nvic_ipr10::W) writer structure"] -impl crate::Writable for NVIC_IPR10 {} +#[doc = "NVIC_IPR10 register accessor: an alias for `Reg`"] +pub type NVIC_IPR10 = crate::Reg; #[doc = "Interrupt Priority Register 10"] pub mod nvic_ipr10; -#[doc = "Interrupt Priority Register 11\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr11](nvic_ipr11) module"] -pub type NVIC_IPR11 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR11; -#[doc = "`read()` method returns [nvic_ipr11::R](nvic_ipr11::R) reader structure"] -impl crate::Readable for NVIC_IPR11 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr11::W](nvic_ipr11::W) writer structure"] -impl crate::Writable for NVIC_IPR11 {} +#[doc = "NVIC_IPR11 register accessor: an alias for `Reg`"] +pub type NVIC_IPR11 = crate::Reg; #[doc = "Interrupt Priority Register 11"] pub mod nvic_ipr11; -#[doc = "Interrupt Priority Register 12\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr12](nvic_ipr12) module"] -pub type NVIC_IPR12 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR12; -#[doc = "`read()` method returns [nvic_ipr12::R](nvic_ipr12::R) reader structure"] -impl crate::Readable for NVIC_IPR12 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr12::W](nvic_ipr12::W) writer structure"] -impl crate::Writable for NVIC_IPR12 {} +#[doc = "NVIC_IPR12 register accessor: an alias for `Reg`"] +pub type NVIC_IPR12 = crate::Reg; #[doc = "Interrupt Priority Register 12"] pub mod nvic_ipr12; -#[doc = "Interrupt Priority Register 13\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr13](nvic_ipr13) module"] -pub type NVIC_IPR13 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR13; -#[doc = "`read()` method returns [nvic_ipr13::R](nvic_ipr13::R) reader structure"] -impl crate::Readable for NVIC_IPR13 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr13::W](nvic_ipr13::W) writer structure"] -impl crate::Writable for NVIC_IPR13 {} +#[doc = "NVIC_IPR13 register accessor: an alias for `Reg`"] +pub type NVIC_IPR13 = crate::Reg; #[doc = "Interrupt Priority Register 13"] pub mod nvic_ipr13; -#[doc = "Interrupt Priority Register 14\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr14](nvic_ipr14) module"] -pub type NVIC_IPR14 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR14; -#[doc = "`read()` method returns [nvic_ipr14::R](nvic_ipr14::R) reader structure"] -impl crate::Readable for NVIC_IPR14 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr14::W](nvic_ipr14::W) writer structure"] -impl crate::Writable for NVIC_IPR14 {} +#[doc = "NVIC_IPR14 register accessor: an alias for `Reg`"] +pub type NVIC_IPR14 = crate::Reg; #[doc = "Interrupt Priority Register 14"] pub mod nvic_ipr14; -#[doc = "Interrupt Priority Register 15\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr15](nvic_ipr15) module"] -pub type NVIC_IPR15 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR15; -#[doc = "`read()` method returns [nvic_ipr15::R](nvic_ipr15::R) reader structure"] -impl crate::Readable for NVIC_IPR15 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr15::W](nvic_ipr15::W) writer structure"] -impl crate::Writable for NVIC_IPR15 {} +#[doc = "NVIC_IPR15 register accessor: an alias for `Reg`"] +pub type NVIC_IPR15 = crate::Reg; #[doc = "Interrupt Priority Register 15"] pub mod nvic_ipr15; -#[doc = "Interrupt Priority Register 16\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr16](nvic_ipr16) module"] -pub type NVIC_IPR16 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR16; -#[doc = "`read()` method returns [nvic_ipr16::R](nvic_ipr16::R) reader structure"] -impl crate::Readable for NVIC_IPR16 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr16::W](nvic_ipr16::W) writer structure"] -impl crate::Writable for NVIC_IPR16 {} +#[doc = "NVIC_IPR16 register accessor: an alias for `Reg`"] +pub type NVIC_IPR16 = crate::Reg; #[doc = "Interrupt Priority Register 16"] pub mod nvic_ipr16; -#[doc = "Interrupt Priority Register 17\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr17](nvic_ipr17) module"] -pub type NVIC_IPR17 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR17; -#[doc = "`read()` method returns [nvic_ipr17::R](nvic_ipr17::R) reader structure"] -impl crate::Readable for NVIC_IPR17 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr17::W](nvic_ipr17::W) writer structure"] -impl crate::Writable for NVIC_IPR17 {} +#[doc = "NVIC_IPR17 register accessor: an alias for `Reg`"] +pub type NVIC_IPR17 = crate::Reg; #[doc = "Interrupt Priority Register 17"] pub mod nvic_ipr17; -#[doc = "Interrupt Priority Register 18\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr18](nvic_ipr18) module"] -pub type NVIC_IPR18 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR18; -#[doc = "`read()` method returns [nvic_ipr18::R](nvic_ipr18::R) reader structure"] -impl crate::Readable for NVIC_IPR18 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr18::W](nvic_ipr18::W) writer structure"] -impl crate::Writable for NVIC_IPR18 {} +#[doc = "NVIC_IPR18 register accessor: an alias for `Reg`"] +pub type NVIC_IPR18 = crate::Reg; #[doc = "Interrupt Priority Register 18"] pub mod nvic_ipr18; -#[doc = "Interrupt Priority Register 19\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr19](nvic_ipr19) module"] -pub type NVIC_IPR19 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR19; -#[doc = "`read()` method returns [nvic_ipr19::R](nvic_ipr19::R) reader structure"] -impl crate::Readable for NVIC_IPR19 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr19::W](nvic_ipr19::W) writer structure"] -impl crate::Writable for NVIC_IPR19 {} +#[doc = "NVIC_IPR19 register accessor: an alias for `Reg`"] +pub type NVIC_IPR19 = crate::Reg; #[doc = "Interrupt Priority Register 19"] pub mod nvic_ipr19; -#[doc = "Interrupt Priority Register 20\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr20](nvic_ipr20) module"] -pub type NVIC_IPR20 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR20; -#[doc = "`read()` method returns [nvic_ipr20::R](nvic_ipr20::R) reader structure"] -impl crate::Readable for NVIC_IPR20 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr20::W](nvic_ipr20::W) writer structure"] -impl crate::Writable for NVIC_IPR20 {} +#[doc = "NVIC_IPR20 register accessor: an alias for `Reg`"] +pub type NVIC_IPR20 = crate::Reg; #[doc = "Interrupt Priority Register 20"] pub mod nvic_ipr20; -#[doc = "Interrupt Priority Register 21\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr21](nvic_ipr21) module"] -pub type NVIC_IPR21 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR21; -#[doc = "`read()` method returns [nvic_ipr21::R](nvic_ipr21::R) reader structure"] -impl crate::Readable for NVIC_IPR21 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr21::W](nvic_ipr21::W) writer structure"] -impl crate::Writable for NVIC_IPR21 {} +#[doc = "NVIC_IPR21 register accessor: an alias for `Reg`"] +pub type NVIC_IPR21 = crate::Reg; #[doc = "Interrupt Priority Register 21"] pub mod nvic_ipr21; -#[doc = "Interrupt Priority Register 22\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr22](nvic_ipr22) module"] -pub type NVIC_IPR22 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR22; -#[doc = "`read()` method returns [nvic_ipr22::R](nvic_ipr22::R) reader structure"] -impl crate::Readable for NVIC_IPR22 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr22::W](nvic_ipr22::W) writer structure"] -impl crate::Writable for NVIC_IPR22 {} +#[doc = "NVIC_IPR22 register accessor: an alias for `Reg`"] +pub type NVIC_IPR22 = crate::Reg; #[doc = "Interrupt Priority Register 22"] pub mod nvic_ipr22; -#[doc = "Interrupt Priority Register 23\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr23](nvic_ipr23) module"] -pub type NVIC_IPR23 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR23; -#[doc = "`read()` method returns [nvic_ipr23::R](nvic_ipr23::R) reader structure"] -impl crate::Readable for NVIC_IPR23 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr23::W](nvic_ipr23::W) writer structure"] -impl crate::Writable for NVIC_IPR23 {} +#[doc = "NVIC_IPR23 register accessor: an alias for `Reg`"] +pub type NVIC_IPR23 = crate::Reg; #[doc = "Interrupt Priority Register 23"] pub mod nvic_ipr23; -#[doc = "Interrupt Priority Register 24\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr24](nvic_ipr24) module"] -pub type NVIC_IPR24 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR24; -#[doc = "`read()` method returns [nvic_ipr24::R](nvic_ipr24::R) reader structure"] -impl crate::Readable for NVIC_IPR24 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr24::W](nvic_ipr24::W) writer structure"] -impl crate::Writable for NVIC_IPR24 {} +#[doc = "NVIC_IPR24 register accessor: an alias for `Reg`"] +pub type NVIC_IPR24 = crate::Reg; #[doc = "Interrupt Priority Register 24"] pub mod nvic_ipr24; -#[doc = "Interrupt Priority Register 25\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr25](nvic_ipr25) module"] -pub type NVIC_IPR25 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR25; -#[doc = "`read()` method returns [nvic_ipr25::R](nvic_ipr25::R) reader structure"] -impl crate::Readable for NVIC_IPR25 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr25::W](nvic_ipr25::W) writer structure"] -impl crate::Writable for NVIC_IPR25 {} +#[doc = "NVIC_IPR25 register accessor: an alias for `Reg`"] +pub type NVIC_IPR25 = crate::Reg; #[doc = "Interrupt Priority Register 25"] pub mod nvic_ipr25; -#[doc = "Interrupt Priority Register 26\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr26](nvic_ipr26) module"] -pub type NVIC_IPR26 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR26; -#[doc = "`read()` method returns [nvic_ipr26::R](nvic_ipr26::R) reader structure"] -impl crate::Readable for NVIC_IPR26 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr26::W](nvic_ipr26::W) writer structure"] -impl crate::Writable for NVIC_IPR26 {} +#[doc = "NVIC_IPR26 register accessor: an alias for `Reg`"] +pub type NVIC_IPR26 = crate::Reg; #[doc = "Interrupt Priority Register 26"] pub mod nvic_ipr26; -#[doc = "Interrupt Priority Register 27\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_ipr27](nvic_ipr27) module"] -pub type NVIC_IPR27 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NVIC_IPR27; -#[doc = "`read()` method returns [nvic_ipr27::R](nvic_ipr27::R) reader structure"] -impl crate::Readable for NVIC_IPR27 {} -#[doc = "`write(|w| ..)` method takes [nvic_ipr27::W](nvic_ipr27::W) writer structure"] -impl crate::Writable for NVIC_IPR27 {} +#[doc = "NVIC_IPR27 register accessor: an alias for `Reg`"] +pub type NVIC_IPR27 = crate::Reg; #[doc = "Interrupt Priority Register 27"] pub mod nvic_ipr27; -#[doc = "CPUID Base Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cpuid](cpuid) module"] -pub type CPUID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CPUID; -#[doc = "`read()` method returns [cpuid::R](cpuid::R) reader structure"] -impl crate::Readable for CPUID {} +#[doc = "CPUID register accessor: an alias for `Reg`"] +pub type CPUID = crate::Reg; #[doc = "CPUID Base Register"] pub mod cpuid; -#[doc = "Interrupt Control and State Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [icsr](icsr) module"] -pub type ICSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ICSR; -#[doc = "`read()` method returns [icsr::R](icsr::R) reader structure"] -impl crate::Readable for ICSR {} -#[doc = "`write(|w| ..)` method takes [icsr::W](icsr::W) writer structure"] -impl crate::Writable for ICSR {} +#[doc = "ICSR register accessor: an alias for `Reg`"] +pub type ICSR = crate::Reg; #[doc = "Interrupt Control and State Register"] pub mod icsr; -#[doc = "Vector Table Offset Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [vtor](vtor) module"] -pub type VTOR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _VTOR; -#[doc = "`read()` method returns [vtor::R](vtor::R) reader structure"] -impl crate::Readable for VTOR {} -#[doc = "`write(|w| ..)` method takes [vtor::W](vtor::W) writer structure"] -impl crate::Writable for VTOR {} +#[doc = "VTOR register accessor: an alias for `Reg`"] +pub type VTOR = crate::Reg; #[doc = "Vector Table Offset Register"] pub mod vtor; -#[doc = "Application Interrupt and Reset Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [aircr](aircr) module"] -pub type AIRCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _AIRCR; -#[doc = "`read()` method returns [aircr::R](aircr::R) reader structure"] -impl crate::Readable for AIRCR {} -#[doc = "`write(|w| ..)` method takes [aircr::W](aircr::W) writer structure"] -impl crate::Writable for AIRCR {} +#[doc = "AIRCR register accessor: an alias for `Reg`"] +pub type AIRCR = crate::Reg; #[doc = "Application Interrupt and Reset Control Register"] pub mod aircr; -#[doc = "System Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scr](scr) module"] -pub type SCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SCR; -#[doc = "`read()` method returns [scr::R](scr::R) reader structure"] -impl crate::Readable for SCR {} -#[doc = "`write(|w| ..)` method takes [scr::W](scr::W) writer structure"] -impl crate::Writable for SCR {} +#[doc = "SCR register accessor: an alias for `Reg`"] +pub type SCR = crate::Reg; #[doc = "System Control Register"] pub mod scr; -#[doc = "Configuration and Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccr](ccr) module"] -pub type CCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CCR; -#[doc = "`read()` method returns [ccr::R](ccr::R) reader structure"] -impl crate::Readable for CCR {} -#[doc = "`write(|w| ..)` method takes [ccr::W](ccr::W) writer structure"] -impl crate::Writable for CCR {} +#[doc = "CCR register accessor: an alias for `Reg`"] +pub type CCR = crate::Reg; #[doc = "Configuration and Control Register"] pub mod ccr; -#[doc = "System Handler Priority Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shpr1](shpr1) module"] -pub type SHPR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SHPR1; -#[doc = "`read()` method returns [shpr1::R](shpr1::R) reader structure"] -impl crate::Readable for SHPR1 {} -#[doc = "`write(|w| ..)` method takes [shpr1::W](shpr1::W) writer structure"] -impl crate::Writable for SHPR1 {} +#[doc = "SHPR1 register accessor: an alias for `Reg`"] +pub type SHPR1 = crate::Reg; #[doc = "System Handler Priority Register 1"] pub mod shpr1; -#[doc = "System Handler Priority Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shpr2](shpr2) module"] -pub type SHPR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SHPR2; -#[doc = "`read()` method returns [shpr2::R](shpr2::R) reader structure"] -impl crate::Readable for SHPR2 {} -#[doc = "`write(|w| ..)` method takes [shpr2::W](shpr2::W) writer structure"] -impl crate::Writable for SHPR2 {} +#[doc = "SHPR2 register accessor: an alias for `Reg`"] +pub type SHPR2 = crate::Reg; #[doc = "System Handler Priority Register 2"] pub mod shpr2; -#[doc = "System Handler Priority Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shpr3](shpr3) module"] -pub type SHPR3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SHPR3; -#[doc = "`read()` method returns [shpr3::R](shpr3::R) reader structure"] -impl crate::Readable for SHPR3 {} -#[doc = "`write(|w| ..)` method takes [shpr3::W](shpr3::W) writer structure"] -impl crate::Writable for SHPR3 {} +#[doc = "SHPR3 register accessor: an alias for `Reg`"] +pub type SHPR3 = crate::Reg; #[doc = "System Handler Priority Register 3"] pub mod shpr3; -#[doc = "System Handler Control and State Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shcsr](shcsr) module"] -pub type SHCSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SHCSR; -#[doc = "`read()` method returns [shcsr::R](shcsr::R) reader structure"] -impl crate::Readable for SHCSR {} -#[doc = "`write(|w| ..)` method takes [shcsr::W](shcsr::W) writer structure"] -impl crate::Writable for SHCSR {} +#[doc = "SHCSR register accessor: an alias for `Reg`"] +pub type SHCSR = crate::Reg; #[doc = "System Handler Control and State Register"] pub mod shcsr; -#[doc = "Configurable Fault Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cfsr](cfsr) module"] -pub type CFSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CFSR; -#[doc = "`read()` method returns [cfsr::R](cfsr::R) reader structure"] -impl crate::Readable for CFSR {} -#[doc = "`write(|w| ..)` method takes [cfsr::W](cfsr::W) writer structure"] -impl crate::Writable for CFSR {} +#[doc = "CFSR register accessor: an alias for `Reg`"] +pub type CFSR = crate::Reg; #[doc = "Configurable Fault Status Register"] pub mod cfsr; -#[doc = "HardFault Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hfsr](hfsr) module"] -pub type HFSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HFSR; -#[doc = "`read()` method returns [hfsr::R](hfsr::R) reader structure"] -impl crate::Readable for HFSR {} -#[doc = "`write(|w| ..)` method takes [hfsr::W](hfsr::W) writer structure"] -impl crate::Writable for HFSR {} +#[doc = "HFSR register accessor: an alias for `Reg`"] +pub type HFSR = crate::Reg; #[doc = "HardFault Status Register"] pub mod hfsr; -#[doc = "MemManage Fault Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mmfar](mmfar) module"] -pub type MMFAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MMFAR; -#[doc = "`read()` method returns [mmfar::R](mmfar::R) reader structure"] -impl crate::Readable for MMFAR {} -#[doc = "`write(|w| ..)` method takes [mmfar::W](mmfar::W) writer structure"] -impl crate::Writable for MMFAR {} +#[doc = "MMFAR register accessor: an alias for `Reg`"] +pub type MMFAR = crate::Reg; #[doc = "MemManage Fault Address Register"] pub mod mmfar; -#[doc = "BusFault Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bfar](bfar) module"] -pub type BFAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BFAR; -#[doc = "`read()` method returns [bfar::R](bfar::R) reader structure"] -impl crate::Readable for BFAR {} -#[doc = "`write(|w| ..)` method takes [bfar::W](bfar::W) writer structure"] -impl crate::Writable for BFAR {} +#[doc = "BFAR register accessor: an alias for `Reg`"] +pub type BFAR = crate::Reg; #[doc = "BusFault Address Register"] pub mod bfar; -#[doc = "Auxiliary Fault Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [afsr](afsr) module"] -pub type AFSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _AFSR; -#[doc = "`read()` method returns [afsr::R](afsr::R) reader structure"] -impl crate::Readable for AFSR {} -#[doc = "`write(|w| ..)` method takes [afsr::W](afsr::W) writer structure"] -impl crate::Writable for AFSR {} +#[doc = "AFSR register accessor: an alias for `Reg`"] +pub type AFSR = crate::Reg; #[doc = "Auxiliary Fault Status Register"] pub mod afsr; -#[doc = "Coprocessor Access Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cpacr](cpacr) module"] -pub type CPACR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CPACR; -#[doc = "`read()` method returns [cpacr::R](cpacr::R) reader structure"] -impl crate::Readable for CPACR {} -#[doc = "`write(|w| ..)` method takes [cpacr::W](cpacr::W) writer structure"] -impl crate::Writable for CPACR {} +#[doc = "CPACR register accessor: an alias for `Reg`"] +pub type CPACR = crate::Reg; #[doc = "Coprocessor Access Control Register"] pub mod cpacr; -#[doc = "MPU Type Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_type](mpu_type) module"] -pub type MPU_TYPE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_TYPE; -#[doc = "`read()` method returns [mpu_type::R](mpu_type::R) reader structure"] -impl crate::Readable for MPU_TYPE {} +#[doc = "MPU_TYPE register accessor: an alias for `Reg`"] +pub type MPU_TYPE = crate::Reg; #[doc = "MPU Type Register"] pub mod mpu_type; -#[doc = "MPU Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_ctrl](mpu_ctrl) module"] -pub type MPU_CTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_CTRL; -#[doc = "`read()` method returns [mpu_ctrl::R](mpu_ctrl::R) reader structure"] -impl crate::Readable for MPU_CTRL {} -#[doc = "`write(|w| ..)` method takes [mpu_ctrl::W](mpu_ctrl::W) writer structure"] -impl crate::Writable for MPU_CTRL {} +#[doc = "MPU_CTRL register accessor: an alias for `Reg`"] +pub type MPU_CTRL = crate::Reg; #[doc = "MPU Control Register"] pub mod mpu_ctrl; -#[doc = "MPU Region Number Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rnr](mpu_rnr) module"] -pub type MPU_RNR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RNR; -#[doc = "`read()` method returns [mpu_rnr::R](mpu_rnr::R) reader structure"] -impl crate::Readable for MPU_RNR {} -#[doc = "`write(|w| ..)` method takes [mpu_rnr::W](mpu_rnr::W) writer structure"] -impl crate::Writable for MPU_RNR {} +#[doc = "MPU_RNR register accessor: an alias for `Reg`"] +pub type MPU_RNR = crate::Reg; #[doc = "MPU Region Number Register"] pub mod mpu_rnr; -#[doc = "MPU Region Base Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rbar](mpu_rbar) module"] -pub type MPU_RBAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RBAR; -#[doc = "`read()` method returns [mpu_rbar::R](mpu_rbar::R) reader structure"] -impl crate::Readable for MPU_RBAR {} -#[doc = "`write(|w| ..)` method takes [mpu_rbar::W](mpu_rbar::W) writer structure"] -impl crate::Writable for MPU_RBAR {} +#[doc = "MPU_RBAR register accessor: an alias for `Reg`"] +pub type MPU_RBAR = crate::Reg; #[doc = "MPU Region Base Address Register"] pub mod mpu_rbar; -#[doc = "MPU Region Attribute and Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rasr](mpu_rasr) module"] -pub type MPU_RASR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RASR; -#[doc = "`read()` method returns [mpu_rasr::R](mpu_rasr::R) reader structure"] -impl crate::Readable for MPU_RASR {} -#[doc = "`write(|w| ..)` method takes [mpu_rasr::W](mpu_rasr::W) writer structure"] -impl crate::Writable for MPU_RASR {} +#[doc = "MPU_RASR register accessor: an alias for `Reg`"] +pub type MPU_RASR = crate::Reg; #[doc = "MPU Region Attribute and Size Register"] pub mod mpu_rasr; -#[doc = "MPU Region Base Address Register A1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rbar_a1](mpu_rbar_a1) module"] -pub type MPU_RBAR_A1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RBAR_A1; -#[doc = "`read()` method returns [mpu_rbar_a1::R](mpu_rbar_a1::R) reader structure"] -impl crate::Readable for MPU_RBAR_A1 {} -#[doc = "`write(|w| ..)` method takes [mpu_rbar_a1::W](mpu_rbar_a1::W) writer structure"] -impl crate::Writable for MPU_RBAR_A1 {} +#[doc = "MPU_RBAR_A1 register accessor: an alias for `Reg`"] +pub type MPU_RBAR_A1 = crate::Reg; #[doc = "MPU Region Base Address Register A1"] pub mod mpu_rbar_a1; -#[doc = "MPU Region Attribute and Size Register A1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rasr_a1](mpu_rasr_a1) module"] -pub type MPU_RASR_A1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RASR_A1; -#[doc = "`read()` method returns [mpu_rasr_a1::R](mpu_rasr_a1::R) reader structure"] -impl crate::Readable for MPU_RASR_A1 {} -#[doc = "`write(|w| ..)` method takes [mpu_rasr_a1::W](mpu_rasr_a1::W) writer structure"] -impl crate::Writable for MPU_RASR_A1 {} +#[doc = "MPU_RASR_A1 register accessor: an alias for `Reg`"] +pub type MPU_RASR_A1 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A1"] pub mod mpu_rasr_a1; -#[doc = "MPU Region Base Address Register A2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rbar_a2](mpu_rbar_a2) module"] -pub type MPU_RBAR_A2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RBAR_A2; -#[doc = "`read()` method returns [mpu_rbar_a2::R](mpu_rbar_a2::R) reader structure"] -impl crate::Readable for MPU_RBAR_A2 {} -#[doc = "`write(|w| ..)` method takes [mpu_rbar_a2::W](mpu_rbar_a2::W) writer structure"] -impl crate::Writable for MPU_RBAR_A2 {} +#[doc = "MPU_RBAR_A2 register accessor: an alias for `Reg`"] +pub type MPU_RBAR_A2 = crate::Reg; #[doc = "MPU Region Base Address Register A2"] pub mod mpu_rbar_a2; -#[doc = "MPU Region Attribute and Size Register A2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rasr_a2](mpu_rasr_a2) module"] -pub type MPU_RASR_A2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RASR_A2; -#[doc = "`read()` method returns [mpu_rasr_a2::R](mpu_rasr_a2::R) reader structure"] -impl crate::Readable for MPU_RASR_A2 {} -#[doc = "`write(|w| ..)` method takes [mpu_rasr_a2::W](mpu_rasr_a2::W) writer structure"] -impl crate::Writable for MPU_RASR_A2 {} +#[doc = "MPU_RASR_A2 register accessor: an alias for `Reg`"] +pub type MPU_RASR_A2 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A2"] pub mod mpu_rasr_a2; -#[doc = "MPU Region Base Address Register A3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rbar_a3](mpu_rbar_a3) module"] -pub type MPU_RBAR_A3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RBAR_A3; -#[doc = "`read()` method returns [mpu_rbar_a3::R](mpu_rbar_a3::R) reader structure"] -impl crate::Readable for MPU_RBAR_A3 {} -#[doc = "`write(|w| ..)` method takes [mpu_rbar_a3::W](mpu_rbar_a3::W) writer structure"] -impl crate::Writable for MPU_RBAR_A3 {} +#[doc = "MPU_RBAR_A3 register accessor: an alias for `Reg`"] +pub type MPU_RBAR_A3 = crate::Reg; #[doc = "MPU Region Base Address Register A3"] pub mod mpu_rbar_a3; -#[doc = "MPU Region Attribute and Size Register A3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_rasr_a3](mpu_rasr_a3) module"] -pub type MPU_RASR_A3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MPU_RASR_A3; -#[doc = "`read()` method returns [mpu_rasr_a3::R](mpu_rasr_a3::R) reader structure"] -impl crate::Readable for MPU_RASR_A3 {} -#[doc = "`write(|w| ..)` method takes [mpu_rasr_a3::W](mpu_rasr_a3::W) writer structure"] -impl crate::Writable for MPU_RASR_A3 {} +#[doc = "MPU_RASR_A3 register accessor: an alias for `Reg`"] +pub type MPU_RASR_A3 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A3"] pub mod mpu_rasr_a3; -#[doc = "Software Trigger Interrupt Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stir](stir) module"] -pub type STIR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STIR; -#[doc = "`write(|w| ..)` method takes [stir::W](stir::W) writer structure"] -impl crate::Writable for STIR {} +#[doc = "STIR register accessor: an alias for `Reg`"] +pub type STIR = crate::Reg; #[doc = "Software Trigger Interrupt Register"] pub mod stir; -#[doc = "Floating-point Context Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpccr](fpccr) module"] -pub type FPCCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPCCR; -#[doc = "`read()` method returns [fpccr::R](fpccr::R) reader structure"] -impl crate::Readable for FPCCR {} -#[doc = "`write(|w| ..)` method takes [fpccr::W](fpccr::W) writer structure"] -impl crate::Writable for FPCCR {} +#[doc = "FPCCR register accessor: an alias for `Reg`"] +pub type FPCCR = crate::Reg; #[doc = "Floating-point Context Control Register"] pub mod fpccr; -#[doc = "Floating-point Context Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpcar](fpcar) module"] -pub type FPCAR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPCAR; -#[doc = "`read()` method returns [fpcar::R](fpcar::R) reader structure"] -impl crate::Readable for FPCAR {} -#[doc = "`write(|w| ..)` method takes [fpcar::W](fpcar::W) writer structure"] -impl crate::Writable for FPCAR {} +#[doc = "FPCAR register accessor: an alias for `Reg`"] +pub type FPCAR = crate::Reg; #[doc = "Floating-point Context Address Register"] pub mod fpcar; -#[doc = "Floating-point Default Status Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fpdscr](fpdscr) module"] -pub type FPDSCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FPDSCR; -#[doc = "`read()` method returns [fpdscr::R](fpdscr::R) reader structure"] -impl crate::Readable for FPDSCR {} -#[doc = "`write(|w| ..)` method takes [fpdscr::W](fpdscr::W) writer structure"] -impl crate::Writable for FPDSCR {} +#[doc = "FPDSCR register accessor: an alias for `Reg`"] +pub type FPDSCR = crate::Reg; #[doc = "Floating-point Default Status Control Register"] pub mod fpdscr; diff --git a/src/ppb/actlr.rs b/src/ppb/actlr.rs index 9be4177f..b4ab861d 100644 --- a/src/ppb/actlr.rs +++ b/src/ppb/actlr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register ACTLR"] -pub type R = crate::R; -#[doc = "Writer for register ACTLR"] -pub type W = crate::W; -#[doc = "Register ACTLR `reset()`'s with value 0"] -impl crate::ResetValue for super::ACTLR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ACTLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ACTLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DISMCYCINT` reader - Disable load/store multiple"] +pub struct DISMCYCINT_R(crate::FieldReader); +impl DISMCYCINT_R { + pub(crate) fn new(bits: bool) -> Self { + DISMCYCINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISMCYCINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DISMCYCINT`"] -pub type DISMCYCINT_R = crate::R; -#[doc = "Write proxy for field `DISMCYCINT`"] +#[doc = "Field `DISMCYCINT` writer - Disable load/store multiple"] pub struct DISMCYCINT_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> DISMCYCINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `DISDEFWBUF`"] -pub type DISDEFWBUF_R = crate::R; -#[doc = "Write proxy for field `DISDEFWBUF`"] +#[doc = "Field `DISDEFWBUF` reader - Disable write buffer"] +pub struct DISDEFWBUF_R(crate::FieldReader); +impl DISDEFWBUF_R { + pub(crate) fn new(bits: bool) -> Self { + DISDEFWBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISDEFWBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISDEFWBUF` writer - Disable write buffer"] pub struct DISDEFWBUF_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> DISDEFWBUF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `DISFOLD`"] -pub type DISFOLD_R = crate::R; -#[doc = "Write proxy for field `DISFOLD`"] +#[doc = "Field `DISFOLD` reader - Disable IT folding"] +pub struct DISFOLD_R(crate::FieldReader); +impl DISFOLD_R { + pub(crate) fn new(bits: bool) -> Self { + DISFOLD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISFOLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISFOLD` writer - Disable IT folding"] pub struct DISFOLD_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> DISFOLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `DISFPCA`"] -pub type DISFPCA_R = crate::R; -#[doc = "Write proxy for field `DISFPCA`"] +#[doc = "Field `DISFPCA` reader - Disable FPCA update"] +pub struct DISFPCA_R(crate::FieldReader); +impl DISFPCA_R { + pub(crate) fn new(bits: bool) -> Self { + DISFPCA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISFPCA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISFPCA` writer - Disable FPCA update"] pub struct DISFPCA_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> DISFPCA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `DISOOFP`"] -pub type DISOOFP_R = crate::R; -#[doc = "Write proxy for field `DISOOFP`"] +#[doc = "Field `DISOOFP` reader - Disable out of order FP execution"] +pub struct DISOOFP_R(crate::FieldReader); +impl DISOOFP_R { + pub(crate) fn new(bits: bool) -> Self { + DISOOFP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DISOOFP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISOOFP` writer - Disable out of order FP execution"] pub struct DISOOFP_W<'a> { w: &'a mut W, } @@ -126,7 +210,7 @@ impl<'a> DISOOFP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -183,4 +267,30 @@ impl W { pub fn disoofp(&mut self) -> DISOOFP_W { DISOOFP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Auxiliary Control Register\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 [actlr](index.html) module"] +pub struct ACTLR_SPEC; +impl crate::RegisterSpec for ACTLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [actlr::R](R) reader structure"] +impl crate::Readable for ACTLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [actlr::W](W) writer structure"] +impl crate::Writable for ACTLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ACTLR to value 0"] +impl crate::Resettable for ACTLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/afsr.rs b/src/ppb/afsr.rs index 49e74509..7bbbe851 100644 --- a/src/ppb/afsr.rs +++ b/src/ppb/afsr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register AFSR"] -pub type R = crate::R; -#[doc = "Writer for register AFSR"] -pub type W = crate::W; -#[doc = "Register AFSR `reset()`'s with value 0"] -impl crate::ResetValue for super::AFSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `AFSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `AFSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `VALUE`"] -pub type VALUE_R = crate::R; -#[doc = "Write proxy for field `VALUE`"] +#[doc = "Field `VALUE` reader - Reserved"] +pub struct VALUE_R(crate::FieldReader); +impl VALUE_R { + pub(crate) fn new(bits: u32) -> Self { + VALUE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VALUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALUE` writer - Reserved"] pub struct VALUE_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> VALUE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn value(&mut self) -> VALUE_W { VALUE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Auxiliary Fault Status Register\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 [afsr](index.html) module"] +pub struct AFSR_SPEC; +impl crate::RegisterSpec for AFSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [afsr::R](R) reader structure"] +impl crate::Readable for AFSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [afsr::W](W) writer structure"] +impl crate::Writable for AFSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets AFSR to value 0"] +impl crate::Resettable for AFSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/aircr.rs b/src/ppb/aircr.rs index 3002785f..4938e9c0 100644 --- a/src/ppb/aircr.rs +++ b/src/ppb/aircr.rs @@ -1,16 +1,40 @@ -#[doc = "Reader of register AIRCR"] -pub type R = crate::R; -#[doc = "Writer for register AIRCR"] -pub type W = crate::W; -#[doc = "Register AIRCR `reset()`'s with value 0xfa05_0000"] -impl crate::ResetValue for super::AIRCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0xfa05_0000 +#[doc = "Register `AIRCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Write proxy for field `VECTRESET`"] +#[doc = "Register `AIRCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `VECTRESET` writer - Reserved for Debug use."] pub struct VECTRESET_W<'a> { w: &'a mut W, } @@ -28,11 +52,11 @@ impl<'a> VECTRESET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `VECTCLRACTIVE`"] +#[doc = "Field `VECTCLRACTIVE` writer - Reserved for Debug use."] pub struct VECTCLRACTIVE_W<'a> { w: &'a mut W, } @@ -50,7 +74,7 @@ impl<'a> VECTCLRACTIVE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -68,7 +92,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SYSRESETREQ`"] +#[doc = "Field `SYSRESETREQ` writer - System reset request"] pub struct SYSRESETREQ_W<'a> { w: &'a mut W, } @@ -76,9 +100,7 @@ impl<'a> SYSRESETREQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYSRESETREQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no system reset request"] #[inline(always)] @@ -103,13 +125,25 @@ impl<'a> SYSRESETREQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `PRIGROUP`"] -pub type PRIGROUP_R = crate::R; -#[doc = "Write proxy for field `PRIGROUP`"] +#[doc = "Field `PRIGROUP` reader - Interrupt priority grouping field"] +pub struct PRIGROUP_R(crate::FieldReader); +impl PRIGROUP_R { + pub(crate) fn new(bits: u8) -> Self { + PRIGROUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRIGROUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRIGROUP` writer - Interrupt priority grouping field"] pub struct PRIGROUP_W<'a> { w: &'a mut W, } @@ -117,7 +151,7 @@ impl<'a> PRIGROUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } @@ -135,9 +169,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENDIANNESS`"] -pub type ENDIANNESS_R = crate::R; +#[doc = "Field `ENDIANNESS` reader - Data endianness bit"] +pub struct ENDIANNESS_R(crate::FieldReader); impl ENDIANNESS_R { + pub(crate) fn new(bits: bool) -> Self { + ENDIANNESS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENDIANNESS_A { @@ -149,17 +186,36 @@ impl ENDIANNESS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDIANNESS_A::VALUE1 + **self == ENDIANNESS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDIANNESS_A::VALUE2 + **self == ENDIANNESS_A::VALUE2 + } +} +impl core::ops::Deref for ENDIANNESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VECTKEY` reader - Register key"] +pub struct VECTKEY_R(crate::FieldReader); +impl VECTKEY_R { + pub(crate) fn new(bits: u16) -> Self { + VECTKEY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VECTKEY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `VECTKEY`"] -pub type VECTKEY_R = crate::R; -#[doc = "Write proxy for field `VECTKEY`"] +#[doc = "Field `VECTKEY` writer - Register key"] pub struct VECTKEY_W<'a> { w: &'a mut W, } @@ -167,7 +223,7 @@ impl<'a> VECTKEY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -214,4 +270,30 @@ impl W { pub fn vectkey(&mut self) -> VECTKEY_W { VECTKEY_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Application Interrupt and Reset Control Register\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 [aircr](index.html) module"] +pub struct AIRCR_SPEC; +impl crate::RegisterSpec for AIRCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [aircr::R](R) reader structure"] +impl crate::Readable for AIRCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [aircr::W](W) writer structure"] +impl crate::Writable for AIRCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets AIRCR to value 0xfa05_0000"] +impl crate::Resettable for AIRCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xfa05_0000 + } } diff --git a/src/ppb/bfar.rs b/src/ppb/bfar.rs index b7b47586..c1b3e65b 100644 --- a/src/ppb/bfar.rs +++ b/src/ppb/bfar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register BFAR"] -pub type R = crate::R; -#[doc = "Writer for register BFAR"] -pub type W = crate::W; -#[doc = "Register BFAR `reset()`'s with value 0"] -impl crate::ResetValue for super::BFAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BFAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BFAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `ADDRESS`"] -pub type ADDRESS_R = crate::R; -#[doc = "Write proxy for field `ADDRESS`"] +#[doc = "Field `ADDRESS` reader - Address causing the fault"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u32) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - Address causing the fault"] pub struct ADDRESS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> ADDRESS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn address(&mut self) -> ADDRESS_W { ADDRESS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "BusFault Address Register\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 [bfar](index.html) module"] +pub struct BFAR_SPEC; +impl crate::RegisterSpec for BFAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bfar::R](R) reader structure"] +impl crate::Readable for BFAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bfar::W](W) writer structure"] +impl crate::Writable for BFAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BFAR to value 0"] +impl crate::Resettable for BFAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/ccr.rs b/src/ppb/ccr.rs index 1a02eb2f..e9699ed1 100644 --- a/src/ppb/ccr.rs +++ b/src/ppb/ccr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CCR"] -pub type R = crate::R; -#[doc = "Writer for register CCR"] -pub type W = crate::W; -#[doc = "Register CCR `reset()`'s with value 0x0200"] -impl crate::ResetValue for super::CCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0200 +#[doc = "Register `CCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Non Base Thread Mode Enable\n\nValue on reset: 0"] @@ -25,9 +49,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NONBASETHRDENA`"] -pub type NONBASETHRDENA_R = crate::R; +#[doc = "Field `NONBASETHRDENA` reader - Non Base Thread Mode Enable"] +pub struct NONBASETHRDENA_R(crate::FieldReader); impl NONBASETHRDENA_R { + pub(crate) fn new(bits: bool) -> Self { + NONBASETHRDENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NONBASETHRDENA_A { @@ -39,15 +66,22 @@ impl NONBASETHRDENA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NONBASETHRDENA_A::VALUE1 + **self == NONBASETHRDENA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NONBASETHRDENA_A::VALUE2 + **self == NONBASETHRDENA_A::VALUE2 + } +} +impl core::ops::Deref for NONBASETHRDENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NONBASETHRDENA`"] +#[doc = "Field `NONBASETHRDENA` writer - Non Base Thread Mode Enable"] pub struct NONBASETHRDENA_W<'a> { w: &'a mut W, } @@ -55,9 +89,7 @@ impl<'a> NONBASETHRDENA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NONBASETHRDENA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "processor can enter Thread mode only when no exception is active."] #[inline(always)] @@ -83,7 +115,7 @@ set to one. When this value is loaded into the PC it indicates to the processor #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -101,9 +133,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USERSETMPEND`"] -pub type USERSETMPEND_R = crate::R; +#[doc = "Field `USERSETMPEND` reader - User Set Pending Enable"] +pub struct USERSETMPEND_R(crate::FieldReader); impl USERSETMPEND_R { + pub(crate) fn new(bits: bool) -> Self { + USERSETMPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USERSETMPEND_A { @@ -115,15 +150,22 @@ impl USERSETMPEND_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USERSETMPEND_A::VALUE1 + **self == USERSETMPEND_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USERSETMPEND_A::VALUE2 + **self == USERSETMPEND_A::VALUE2 } } -#[doc = "Write proxy for field `USERSETMPEND`"] +impl core::ops::Deref for USERSETMPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USERSETMPEND` writer - User Set Pending Enable"] pub struct USERSETMPEND_W<'a> { w: &'a mut W, } @@ -131,9 +173,7 @@ impl<'a> USERSETMPEND_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USERSETMPEND_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "disable"] #[inline(always)] @@ -158,7 +198,7 @@ impl<'a> USERSETMPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -176,9 +216,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UNALIGN_TRP`"] -pub type UNALIGN_TRP_R = crate::R; +#[doc = "Field `UNALIGN_TRP` reader - Unaligned Access Trap Enable"] +pub struct UNALIGN_TRP_R(crate::FieldReader); impl UNALIGN_TRP_R { + pub(crate) fn new(bits: bool) -> Self { + UNALIGN_TRP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UNALIGN_TRP_A { @@ -190,15 +233,22 @@ impl UNALIGN_TRP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UNALIGN_TRP_A::VALUE1 + **self == UNALIGN_TRP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UNALIGN_TRP_A::VALUE2 + **self == UNALIGN_TRP_A::VALUE2 } } -#[doc = "Write proxy for field `UNALIGN_TRP`"] +impl core::ops::Deref for UNALIGN_TRP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UNALIGN_TRP` writer - Unaligned Access Trap Enable"] pub struct UNALIGN_TRP_W<'a> { w: &'a mut W, } @@ -206,9 +256,7 @@ impl<'a> UNALIGN_TRP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UNALIGN_TRP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "do not trap unaligned halfword and word accesses"] #[inline(always)] @@ -233,7 +281,7 @@ impl<'a> UNALIGN_TRP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -251,9 +299,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIV_0_TRP`"] -pub type DIV_0_TRP_R = crate::R; +#[doc = "Field `DIV_0_TRP` reader - Divide by Zero Trap Enable"] +pub struct DIV_0_TRP_R(crate::FieldReader); impl DIV_0_TRP_R { + pub(crate) fn new(bits: bool) -> Self { + DIV_0_TRP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIV_0_TRP_A { @@ -265,15 +316,22 @@ impl DIV_0_TRP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIV_0_TRP_A::VALUE1 + **self == DIV_0_TRP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIV_0_TRP_A::VALUE2 + **self == DIV_0_TRP_A::VALUE2 } } -#[doc = "Write proxy for field `DIV_0_TRP`"] +impl core::ops::Deref for DIV_0_TRP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIV_0_TRP` writer - Divide by Zero Trap Enable"] pub struct DIV_0_TRP_W<'a> { w: &'a mut W, } @@ -281,9 +339,7 @@ impl<'a> DIV_0_TRP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIV_0_TRP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "do not trap divide by 0"] #[inline(always)] @@ -308,7 +364,7 @@ impl<'a> DIV_0_TRP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -326,9 +382,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFHFNMIGN`"] -pub type BFHFNMIGN_R = crate::R; +#[doc = "Field `BFHFNMIGN` reader - Bus Fault Hard Fault and NMI Ignore"] +pub struct BFHFNMIGN_R(crate::FieldReader); impl BFHFNMIGN_R { + pub(crate) fn new(bits: bool) -> Self { + BFHFNMIGN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFHFNMIGN_A { @@ -340,15 +399,22 @@ impl BFHFNMIGN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFHFNMIGN_A::VALUE1 + **self == BFHFNMIGN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFHFNMIGN_A::VALUE2 + **self == BFHFNMIGN_A::VALUE2 + } +} +impl core::ops::Deref for BFHFNMIGN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFHFNMIGN`"] +#[doc = "Field `BFHFNMIGN` writer - Bus Fault Hard Fault and NMI Ignore"] pub struct BFHFNMIGN_W<'a> { w: &'a mut W, } @@ -356,9 +422,7 @@ impl<'a> BFHFNMIGN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFHFNMIGN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "data bus faults caused by load and store instructions cause a lock-up"] #[inline(always)] @@ -383,7 +447,7 @@ impl<'a> BFHFNMIGN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -401,9 +465,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STKALIGN`"] -pub type STKALIGN_R = crate::R; +#[doc = "Field `STKALIGN` reader - Stack Alignment"] +pub struct STKALIGN_R(crate::FieldReader); impl STKALIGN_R { + pub(crate) fn new(bits: bool) -> Self { + STKALIGN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STKALIGN_A { @@ -415,15 +482,22 @@ impl STKALIGN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STKALIGN_A::VALUE1 + **self == STKALIGN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STKALIGN_A::VALUE2 + **self == STKALIGN_A::VALUE2 } } -#[doc = "Write proxy for field `STKALIGN`"] +impl core::ops::Deref for STKALIGN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STKALIGN` writer - Stack Alignment"] pub struct STKALIGN_W<'a> { w: &'a mut W, } @@ -431,9 +505,7 @@ impl<'a> STKALIGN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STKALIGN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "4-byte aligned"] #[inline(always)] @@ -458,7 +530,7 @@ impl<'a> STKALIGN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -525,4 +597,30 @@ impl W { pub fn stkalign(&mut self) -> STKALIGN_W { STKALIGN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration and Control Register\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 [ccr](index.html) module"] +pub struct CCR_SPEC; +impl crate::RegisterSpec for CCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccr::R](R) reader structure"] +impl crate::Readable for CCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccr::W](W) writer structure"] +impl crate::Writable for CCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCR to value 0x0200"] +impl crate::Resettable for CCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0200 + } } diff --git a/src/ppb/cfsr.rs b/src/ppb/cfsr.rs index 1d4dc9c2..2c281538 100644 --- a/src/ppb/cfsr.rs +++ b/src/ppb/cfsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CFSR"] -pub type R = crate::R; -#[doc = "Writer for register CFSR"] -pub type W = crate::W; -#[doc = "Register CFSR `reset()`'s with value 0"] -impl crate::ResetValue for super::CFSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CFSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CFSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Instruction access violation flag\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IACCVIOL`"] -pub type IACCVIOL_R = crate::R; +#[doc = "Field `IACCVIOL` reader - Instruction access violation flag"] +pub struct IACCVIOL_R(crate::FieldReader); impl IACCVIOL_R { + pub(crate) fn new(bits: bool) -> Self { + IACCVIOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IACCVIOL_A { @@ -38,15 +65,22 @@ impl IACCVIOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IACCVIOL_A::VALUE1 + **self == IACCVIOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IACCVIOL_A::VALUE2 + **self == IACCVIOL_A::VALUE2 } } -#[doc = "Write proxy for field `IACCVIOL`"] +impl core::ops::Deref for IACCVIOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IACCVIOL` writer - Instruction access violation flag"] pub struct IACCVIOL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> IACCVIOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IACCVIOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no instruction access violation fault"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> IACCVIOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DACCVIOL`"] -pub type DACCVIOL_R = crate::R; +#[doc = "Field `DACCVIOL` reader - Data access violation flag"] +pub struct DACCVIOL_R(crate::FieldReader); impl DACCVIOL_R { + pub(crate) fn new(bits: bool) -> Self { + DACCVIOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DACCVIOL_A { @@ -113,15 +148,22 @@ impl DACCVIOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DACCVIOL_A::VALUE1 + **self == DACCVIOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DACCVIOL_A::VALUE2 + **self == DACCVIOL_A::VALUE2 + } +} +impl core::ops::Deref for DACCVIOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DACCVIOL`"] +#[doc = "Field `DACCVIOL` writer - Data access violation flag"] pub struct DACCVIOL_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> DACCVIOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DACCVIOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no data access violation fault"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> DACCVIOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MUNSTKERR`"] -pub type MUNSTKERR_R = crate::R; +#[doc = "Field `MUNSTKERR` reader - MemManage fault on unstacking for a return from exception"] +pub struct MUNSTKERR_R(crate::FieldReader); impl MUNSTKERR_R { + pub(crate) fn new(bits: bool) -> Self { + MUNSTKERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MUNSTKERR_A { @@ -188,15 +231,22 @@ impl MUNSTKERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MUNSTKERR_A::VALUE1 + **self == MUNSTKERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MUNSTKERR_A::VALUE2 + **self == MUNSTKERR_A::VALUE2 } } -#[doc = "Write proxy for field `MUNSTKERR`"] +impl core::ops::Deref for MUNSTKERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MUNSTKERR` writer - MemManage fault on unstacking for a return from exception"] pub struct MUNSTKERR_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> MUNSTKERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MUNSTKERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no unstacking fault"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> MUNSTKERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSTKERR`"] -pub type MSTKERR_R = crate::R; +#[doc = "Field `MSTKERR` reader - MemManage fault on stacking for exception entry"] +pub struct MSTKERR_R(crate::FieldReader); impl MSTKERR_R { + pub(crate) fn new(bits: bool) -> Self { + MSTKERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSTKERR_A { @@ -263,15 +314,22 @@ impl MSTKERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSTKERR_A::VALUE1 + **self == MSTKERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSTKERR_A::VALUE2 + **self == MSTKERR_A::VALUE2 } } -#[doc = "Write proxy for field `MSTKERR`"] +impl core::ops::Deref for MSTKERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSTKERR` writer - MemManage fault on stacking for exception entry"] pub struct MSTKERR_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> MSTKERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSTKERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no stacking fault"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> MSTKERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MLSPERR`"] -pub type MLSPERR_R = crate::R; +#[doc = "Field `MLSPERR` reader - MemManage fault during floating point lazy state preservation"] +pub struct MLSPERR_R(crate::FieldReader); impl MLSPERR_R { + pub(crate) fn new(bits: bool) -> Self { + MLSPERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MLSPERR_A { @@ -338,15 +397,22 @@ impl MLSPERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MLSPERR_A::VALUE1 + **self == MLSPERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MLSPERR_A::VALUE2 + **self == MLSPERR_A::VALUE2 + } +} +impl core::ops::Deref for MLSPERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MLSPERR`"] +#[doc = "Field `MLSPERR` writer - MemManage fault during floating point lazy state preservation"] pub struct MLSPERR_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> MLSPERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MLSPERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No MemManage fault occurred during floating-point lazy state preservation"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> MLSPERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MMARVALID`"] -pub type MMARVALID_R = crate::R; +#[doc = "Field `MMARVALID` reader - MemManage Fault Address Register (MMFAR) valid flag"] +pub struct MMARVALID_R(crate::FieldReader); impl MMARVALID_R { + pub(crate) fn new(bits: bool) -> Self { + MMARVALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MMARVALID_A { @@ -413,15 +480,22 @@ impl MMARVALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MMARVALID_A::VALUE1 + **self == MMARVALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MMARVALID_A::VALUE2 + **self == MMARVALID_A::VALUE2 } } -#[doc = "Write proxy for field `MMARVALID`"] +impl core::ops::Deref for MMARVALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MMARVALID` writer - MemManage Fault Address Register (MMFAR) valid flag"] pub struct MMARVALID_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> MMARVALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MMARVALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "value in MMAR is not a valid fault address"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> MMARVALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IBUSERR`"] -pub type IBUSERR_R = crate::R; +#[doc = "Field `IBUSERR` reader - Instruction bus error"] +pub struct IBUSERR_R(crate::FieldReader); impl IBUSERR_R { + pub(crate) fn new(bits: bool) -> Self { + IBUSERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IBUSERR_A { @@ -488,15 +563,22 @@ impl IBUSERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IBUSERR_A::VALUE1 + **self == IBUSERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IBUSERR_A::VALUE2 + **self == IBUSERR_A::VALUE2 } } -#[doc = "Write proxy for field `IBUSERR`"] +impl core::ops::Deref for IBUSERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IBUSERR` writer - Instruction bus error"] pub struct IBUSERR_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> IBUSERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IBUSERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no instruction bus error"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> IBUSERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRECISERR`"] -pub type PRECISERR_R = crate::R; +#[doc = "Field `PRECISERR` reader - Precise data bus error"] +pub struct PRECISERR_R(crate::FieldReader); impl PRECISERR_R { + pub(crate) fn new(bits: bool) -> Self { + PRECISERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRECISERR_A { @@ -563,15 +646,22 @@ impl PRECISERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRECISERR_A::VALUE1 + **self == PRECISERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRECISERR_A::VALUE2 + **self == PRECISERR_A::VALUE2 + } +} +impl core::ops::Deref for PRECISERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PRECISERR`"] +#[doc = "Field `PRECISERR` writer - Precise data bus error"] pub struct PRECISERR_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> PRECISERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRECISERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no precise data bus error"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> PRECISERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IMPRECISERR`"] -pub type IMPRECISERR_R = crate::R; +#[doc = "Field `IMPRECISERR` reader - Imprecise data bus error"] +pub struct IMPRECISERR_R(crate::FieldReader); impl IMPRECISERR_R { + pub(crate) fn new(bits: bool) -> Self { + IMPRECISERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IMPRECISERR_A { @@ -638,15 +729,22 @@ impl IMPRECISERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IMPRECISERR_A::VALUE1 + **self == IMPRECISERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IMPRECISERR_A::VALUE2 + **self == IMPRECISERR_A::VALUE2 } } -#[doc = "Write proxy for field `IMPRECISERR`"] +impl core::ops::Deref for IMPRECISERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IMPRECISERR` writer - Imprecise data bus error"] pub struct IMPRECISERR_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> IMPRECISERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IMPRECISERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no imprecise data bus error"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> IMPRECISERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UNSTKERR`"] -pub type UNSTKERR_R = crate::R; +#[doc = "Field `UNSTKERR` reader - BusFault on unstacking for a return from exception"] +pub struct UNSTKERR_R(crate::FieldReader); impl UNSTKERR_R { + pub(crate) fn new(bits: bool) -> Self { + UNSTKERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UNSTKERR_A { @@ -713,15 +812,22 @@ impl UNSTKERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UNSTKERR_A::VALUE1 + **self == UNSTKERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UNSTKERR_A::VALUE2 + **self == UNSTKERR_A::VALUE2 + } +} +impl core::ops::Deref for UNSTKERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `UNSTKERR`"] +#[doc = "Field `UNSTKERR` writer - BusFault on unstacking for a return from exception"] pub struct UNSTKERR_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> UNSTKERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UNSTKERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no unstacking fault"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> UNSTKERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STKERR`"] -pub type STKERR_R = crate::R; +#[doc = "Field `STKERR` reader - BusFault on stacking for exception entry"] +pub struct STKERR_R(crate::FieldReader); impl STKERR_R { + pub(crate) fn new(bits: bool) -> Self { + STKERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STKERR_A { @@ -788,15 +895,22 @@ impl STKERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STKERR_A::VALUE1 + **self == STKERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STKERR_A::VALUE2 + **self == STKERR_A::VALUE2 } } -#[doc = "Write proxy for field `STKERR`"] +impl core::ops::Deref for STKERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STKERR` writer - BusFault on stacking for exception entry"] pub struct STKERR_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> STKERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STKERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no stacking fault"] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> STKERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LSPERR`"] -pub type LSPERR_R = crate::R; +#[doc = "Field `LSPERR` reader - BusFault during floating point lazy state preservation"] +pub struct LSPERR_R(crate::FieldReader); impl LSPERR_R { + pub(crate) fn new(bits: bool) -> Self { + LSPERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LSPERR_A { @@ -863,15 +978,22 @@ impl LSPERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LSPERR_A::VALUE1 + **self == LSPERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LSPERR_A::VALUE2 + **self == LSPERR_A::VALUE2 } } -#[doc = "Write proxy for field `LSPERR`"] +impl core::ops::Deref for LSPERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LSPERR` writer - BusFault during floating point lazy state preservation"] pub struct LSPERR_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> LSPERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LSPERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No bus fault occurred during floating-point lazy state preservation."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> LSPERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFARVALID`"] -pub type BFARVALID_R = crate::R; +#[doc = "Field `BFARVALID` reader - BusFault Address Register (BFAR) valid flag"] +pub struct BFARVALID_R(crate::FieldReader); impl BFARVALID_R { + pub(crate) fn new(bits: bool) -> Self { + BFARVALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFARVALID_A { @@ -938,15 +1061,22 @@ impl BFARVALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFARVALID_A::VALUE1 + **self == BFARVALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFARVALID_A::VALUE2 + **self == BFARVALID_A::VALUE2 + } +} +impl core::ops::Deref for BFARVALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFARVALID`"] +#[doc = "Field `BFARVALID` writer - BusFault Address Register (BFAR) valid flag"] pub struct BFARVALID_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> BFARVALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFARVALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "value in BFAR is not a valid fault address"] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> BFARVALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UNDEFINSTR`"] -pub type UNDEFINSTR_R = crate::R; +#[doc = "Field `UNDEFINSTR` reader - Undefined instruction UsageFault"] +pub struct UNDEFINSTR_R(crate::FieldReader); impl UNDEFINSTR_R { + pub(crate) fn new(bits: bool) -> Self { + UNDEFINSTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UNDEFINSTR_A { @@ -1013,15 +1144,22 @@ impl UNDEFINSTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UNDEFINSTR_A::VALUE1 + **self == UNDEFINSTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UNDEFINSTR_A::VALUE2 + **self == UNDEFINSTR_A::VALUE2 } } -#[doc = "Write proxy for field `UNDEFINSTR`"] +impl core::ops::Deref for UNDEFINSTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UNDEFINSTR` writer - Undefined instruction UsageFault"] pub struct UNDEFINSTR_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> UNDEFINSTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UNDEFINSTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no undefined instruction UsageFault"] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> UNDEFINSTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INVSTATE`"] -pub type INVSTATE_R = crate::R; +#[doc = "Field `INVSTATE` reader - Invalid state UsageFault"] +pub struct INVSTATE_R(crate::FieldReader); impl INVSTATE_R { + pub(crate) fn new(bits: bool) -> Self { + INVSTATE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INVSTATE_A { @@ -1088,15 +1227,22 @@ impl INVSTATE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INVSTATE_A::VALUE1 + **self == INVSTATE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INVSTATE_A::VALUE2 + **self == INVSTATE_A::VALUE2 } } -#[doc = "Write proxy for field `INVSTATE`"] +impl core::ops::Deref for INVSTATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVSTATE` writer - Invalid state UsageFault"] pub struct INVSTATE_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> INVSTATE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INVSTATE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no invalid state UsageFault"] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> INVSTATE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INVPC`"] -pub type INVPC_R = crate::R; +#[doc = "Field `INVPC` reader - Invalid PC load UsageFault"] +pub struct INVPC_R(crate::FieldReader); impl INVPC_R { + pub(crate) fn new(bits: bool) -> Self { + INVPC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INVPC_A { @@ -1163,15 +1310,22 @@ impl INVPC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INVPC_A::VALUE1 + **self == INVPC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INVPC_A::VALUE2 + **self == INVPC_A::VALUE2 + } +} +impl core::ops::Deref for INVPC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `INVPC`"] +#[doc = "Field `INVPC` writer - Invalid PC load UsageFault"] pub struct INVPC_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> INVPC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INVPC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no invalid PC load UsageFault"] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> INVPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -1224,9 +1376,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NOCP`"] -pub type NOCP_R = crate::R; +#[doc = "Field `NOCP` reader - No coprocessor UsageFault"] +pub struct NOCP_R(crate::FieldReader); impl NOCP_R { + pub(crate) fn new(bits: bool) -> Self { + NOCP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NOCP_A { @@ -1238,15 +1393,22 @@ impl NOCP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NOCP_A::VALUE1 + **self == NOCP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NOCP_A::VALUE2 + **self == NOCP_A::VALUE2 } } -#[doc = "Write proxy for field `NOCP`"] +impl core::ops::Deref for NOCP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NOCP` writer - No coprocessor UsageFault"] pub struct NOCP_W<'a> { w: &'a mut W, } @@ -1254,9 +1416,7 @@ impl<'a> NOCP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NOCP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no UsageFault caused by attempting to access a coprocessor"] #[inline(always)] @@ -1281,7 +1441,7 @@ impl<'a> NOCP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -1299,9 +1459,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UNALIGNED`"] -pub type UNALIGNED_R = crate::R; +#[doc = "Field `UNALIGNED` reader - Unaligned access UsageFault"] +pub struct UNALIGNED_R(crate::FieldReader); impl UNALIGNED_R { + pub(crate) fn new(bits: bool) -> Self { + UNALIGNED_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UNALIGNED_A { @@ -1313,15 +1476,22 @@ impl UNALIGNED_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UNALIGNED_A::VALUE1 + **self == UNALIGNED_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UNALIGNED_A::VALUE2 + **self == UNALIGNED_A::VALUE2 } } -#[doc = "Write proxy for field `UNALIGNED`"] +impl core::ops::Deref for UNALIGNED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UNALIGNED` writer - Unaligned access UsageFault"] pub struct UNALIGNED_W<'a> { w: &'a mut W, } @@ -1329,9 +1499,7 @@ impl<'a> UNALIGNED_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UNALIGNED_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no unaligned access fault, or unaligned access trapping not enabled"] #[inline(always)] @@ -1356,7 +1524,7 @@ impl<'a> UNALIGNED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1374,9 +1542,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DIVBYZERO`"] -pub type DIVBYZERO_R = crate::R; +#[doc = "Field `DIVBYZERO` reader - Divide by zero UsageFault"] +pub struct DIVBYZERO_R(crate::FieldReader); impl DIVBYZERO_R { + pub(crate) fn new(bits: bool) -> Self { + DIVBYZERO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIVBYZERO_A { @@ -1388,15 +1559,22 @@ impl DIVBYZERO_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIVBYZERO_A::VALUE1 + **self == DIVBYZERO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIVBYZERO_A::VALUE2 + **self == DIVBYZERO_A::VALUE2 + } +} +impl core::ops::Deref for DIVBYZERO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DIVBYZERO`"] +#[doc = "Field `DIVBYZERO` writer - Divide by zero UsageFault"] pub struct DIVBYZERO_W<'a> { w: &'a mut W, } @@ -1404,9 +1582,7 @@ impl<'a> DIVBYZERO_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIVBYZERO_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no divide by zero fault, or divide by zero trapping not enabled"] #[inline(always)] @@ -1431,7 +1607,7 @@ impl<'a> DIVBYZERO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1628,4 +1804,30 @@ impl W { pub fn divbyzero(&mut self) -> DIVBYZERO_W { DIVBYZERO_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configurable Fault Status Register\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 [cfsr](index.html) module"] +pub struct CFSR_SPEC; +impl crate::RegisterSpec for CFSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cfsr::R](R) reader structure"] +impl crate::Readable for CFSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cfsr::W](W) writer structure"] +impl crate::Writable for CFSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CFSR to value 0"] +impl crate::Resettable for CFSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/cpacr.rs b/src/ppb/cpacr.rs index 89953452..429614b5 100644 --- a/src/ppb/cpacr.rs +++ b/src/ppb/cpacr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CPACR"] -pub type R = crate::R; -#[doc = "Writer for register CPACR"] -pub type W = crate::W; -#[doc = "Register CPACR `reset()`'s with value 0"] -impl crate::ResetValue for super::CPACR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CPACR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CPACR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Access privileges for coprocessor 10\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CP10`"] -pub type CP10_R = crate::R; +#[doc = "Field `CP10` reader - Access privileges for coprocessor 10"] +pub struct CP10_R(crate::FieldReader); impl CP10_R { + pub(crate) fn new(bits: u8) -> Self { + CP10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CP10_A::VALUE1), - 1 => Val(CP10_A::VALUE2), - 3 => Val(CP10_A::VALUE4), - i => Res(i), + 0 => Some(CP10_A::VALUE1), + 1 => Some(CP10_A::VALUE2), + 3 => Some(CP10_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CP10_A::VALUE1 + **self == CP10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CP10_A::VALUE2 + **self == CP10_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CP10_A::VALUE4 + **self == CP10_A::VALUE4 } } -#[doc = "Write proxy for field `CP10`"] +impl core::ops::Deref for CP10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CP10` writer - Access privileges for coprocessor 10"] pub struct CP10_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> CP10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -106,37 +139,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CP11`"] -pub type CP11_R = crate::R; +#[doc = "Field `CP11` reader - Access privileges for coprocessor 11"] +pub struct CP11_R(crate::FieldReader); impl CP11_R { + pub(crate) fn new(bits: u8) -> Self { + CP11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CP11_A::VALUE1), - 1 => Val(CP11_A::VALUE2), - 3 => Val(CP11_A::VALUE4), - i => Res(i), + 0 => Some(CP11_A::VALUE1), + 1 => Some(CP11_A::VALUE2), + 3 => Some(CP11_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CP11_A::VALUE1 + **self == CP11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CP11_A::VALUE2 + **self == CP11_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CP11_A::VALUE4 + **self == CP11_A::VALUE4 + } +} +impl core::ops::Deref for CP11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CP11`"] +#[doc = "Field `CP11` writer - Access privileges for coprocessor 11"] pub struct CP11_W<'a> { w: &'a mut W, } @@ -164,7 +206,7 @@ impl<'a> CP11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -191,4 +233,30 @@ impl W { pub fn cp11(&mut self) -> CP11_W { CP11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Coprocessor Access Control Register\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 [cpacr](index.html) module"] +pub struct CPACR_SPEC; +impl crate::RegisterSpec for CPACR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cpacr::R](R) reader structure"] +impl crate::Readable for CPACR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cpacr::W](W) writer structure"] +impl crate::Writable for CPACR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CPACR to value 0"] +impl crate::Resettable for CPACR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/cpuid.rs b/src/ppb/cpuid.rs index 1b47c8b6..c2ccee27 100644 --- a/src/ppb/cpuid.rs +++ b/src/ppb/cpuid.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CPUID"] -pub type R = crate::R; +#[doc = "Register `CPUID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Revision number\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -13,22 +26,31 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `Revision`"] -pub type REVISION_R = crate::R; +#[doc = "Field `Revision` reader - Revision number"] +pub struct REVISION_R(crate::FieldReader); impl REVISION_R { + pub(crate) fn new(bits: u8) -> Self { + REVISION_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(REVISION_A::VALUE1), - i => Res(i), + 1 => Some(REVISION_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REVISION_A::VALUE1 + **self == REVISION_A::VALUE1 + } +} +impl core::ops::Deref for REVISION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Part number of the processor\n\nValue on reset: 3108"] @@ -44,26 +66,47 @@ impl From for u16 { variant as _ } } -#[doc = "Reader of field `PartNo`"] -pub type PARTNO_R = crate::R; +#[doc = "Field `PartNo` reader - Part number of the processor"] +pub struct PARTNO_R(crate::FieldReader); impl PARTNO_R { + pub(crate) fn new(bits: u16) -> Self { + PARTNO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 3108 => Val(PARTNO_A::VALUE1), - i => Res(i), + 3108 => Some(PARTNO_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PARTNO_A::VALUE1 + **self == PARTNO_A::VALUE1 + } +} +impl core::ops::Deref for PARTNO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Constant` reader - Reads as 0xF"] +pub struct CONSTANT_R(crate::FieldReader); +impl CONSTANT_R { + pub(crate) fn new(bits: u8) -> Self { + CONSTANT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CONSTANT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `Constant`"] -pub type CONSTANT_R = crate::R; #[doc = "Variant number\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -77,22 +120,31 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `Variant`"] -pub type VARIANT_R = crate::R; +#[doc = "Field `Variant` reader - Variant number"] +pub struct VARIANT_R(crate::FieldReader); impl VARIANT_R { + pub(crate) fn new(bits: u8) -> Self { + VARIANT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(VARIANT_A::VALUE1), - i => Res(i), + 0 => Some(VARIANT_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VARIANT_A::VALUE1 + **self == VARIANT_A::VALUE1 + } +} +impl core::ops::Deref for VARIANT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Implementer code\n\nValue on reset: 65"] @@ -108,22 +160,31 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `Implementer`"] -pub type IMPLEMENTER_R = crate::R; +#[doc = "Field `Implementer` reader - Implementer code"] +pub struct IMPLEMENTER_R(crate::FieldReader); impl IMPLEMENTER_R { + pub(crate) fn new(bits: u8) -> Self { + IMPLEMENTER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 65 => Val(IMPLEMENTER_A::VALUE1), - i => Res(i), + 65 => Some(IMPLEMENTER_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IMPLEMENTER_A::VALUE1 + **self == IMPLEMENTER_A::VALUE1 + } +} +impl core::ops::Deref for IMPLEMENTER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -153,3 +214,19 @@ impl R { IMPLEMENTER_R::new(((self.bits >> 24) & 0xff) as u8) } } +#[doc = "CPUID Base Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cpuid](index.html) module"] +pub struct CPUID_SPEC; +impl crate::RegisterSpec for CPUID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cpuid::R](R) reader structure"] +impl crate::Readable for CPUID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CPUID to value 0x410f_c241"] +impl crate::Resettable for CPUID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x410f_c241 + } +} diff --git a/src/ppb/fpcar.rs b/src/ppb/fpcar.rs index c1f9d7cb..b8a7ee4d 100644 --- a/src/ppb/fpcar.rs +++ b/src/ppb/fpcar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FPCAR"] -pub type R = crate::R; -#[doc = "Writer for register FPCAR"] -pub type W = crate::W; -#[doc = "Register FPCAR `reset()`'s with value 0"] -impl crate::ResetValue for super::FPCAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPCAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FPCAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `ADDRESS`"] -pub type ADDRESS_R = crate::R; -#[doc = "Write proxy for field `ADDRESS`"] +#[doc = "Field `ADDRESS` reader - Address"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u32) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - Address"] pub struct ADDRESS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> ADDRESS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1fff_ffff << 3)) | (((value as u32) & 0x1fff_ffff) << 3); + self.w.bits = (self.w.bits & !(0x1fff_ffff << 3)) | ((value as u32 & 0x1fff_ffff) << 3); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn address(&mut self) -> ADDRESS_W { ADDRESS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating-point Context Address Register\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 [fpcar](index.html) module"] +pub struct FPCAR_SPEC; +impl crate::RegisterSpec for FPCAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpcar::R](R) reader structure"] +impl crate::Readable for FPCAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpcar::W](W) writer structure"] +impl crate::Writable for FPCAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPCAR to value 0"] +impl crate::Resettable for FPCAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/fpccr.rs b/src/ppb/fpccr.rs index 3abe96db..5f458439 100644 --- a/src/ppb/fpccr.rs +++ b/src/ppb/fpccr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register FPCCR"] -pub type R = crate::R; -#[doc = "Writer for register FPCCR"] -pub type W = crate::W; -#[doc = "Register FPCCR `reset()`'s with value 0"] -impl crate::ResetValue for super::FPCCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPCCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FPCCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Lazy State Preservation Active\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LSPACT`"] -pub type LSPACT_R = crate::R; +#[doc = "Field `LSPACT` reader - Lazy State Preservation Active"] +pub struct LSPACT_R(crate::FieldReader); impl LSPACT_R { + pub(crate) fn new(bits: bool) -> Self { + LSPACT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LSPACT_A { @@ -38,15 +65,22 @@ impl LSPACT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LSPACT_A::VALUE1 + **self == LSPACT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LSPACT_A::VALUE2 + **self == LSPACT_A::VALUE2 + } +} +impl core::ops::Deref for LSPACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LSPACT`"] +#[doc = "Field `LSPACT` writer - Lazy State Preservation Active"] pub struct LSPACT_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> LSPACT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LSPACT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Lazy state preservation is not active."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> LSPACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USER`"] -pub type USER_R = crate::R; +#[doc = "Field `USER` reader - User allocated Stack Frame"] +pub struct USER_R(crate::FieldReader); impl USER_R { + pub(crate) fn new(bits: bool) -> Self { + USER_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USER_A { @@ -113,15 +148,22 @@ impl USER_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USER_A::VALUE1 + **self == USER_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USER_A::VALUE2 + **self == USER_A::VALUE2 } } -#[doc = "Write proxy for field `USER`"] +impl core::ops::Deref for USER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USER` writer - User allocated Stack Frame"] pub struct USER_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> USER_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USER_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Privilege level was not user when the floating-point stack frame was allocated."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> USER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `THREAD`"] -pub type THREAD_R = crate::R; +#[doc = "Field `THREAD` reader - Thread Mode allocated Stack Frame"] +pub struct THREAD_R(crate::FieldReader); impl THREAD_R { + pub(crate) fn new(bits: bool) -> Self { + THREAD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> THREAD_A { @@ -188,15 +231,22 @@ impl THREAD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == THREAD_A::VALUE1 + **self == THREAD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == THREAD_A::VALUE2 + **self == THREAD_A::VALUE2 } } -#[doc = "Write proxy for field `THREAD`"] +impl core::ops::Deref for THREAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `THREAD` writer - Thread Mode allocated Stack Frame"] pub struct THREAD_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> THREAD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: THREAD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Mode was not Thread Mode when the floating-point stack frame was allocated."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> THREAD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HFRDY`"] -pub type HFRDY_R = crate::R; +#[doc = "Field `HFRDY` reader - HardFault Ready"] +pub struct HFRDY_R(crate::FieldReader); impl HFRDY_R { + pub(crate) fn new(bits: bool) -> Self { + HFRDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HFRDY_A { @@ -263,15 +314,22 @@ impl HFRDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HFRDY_A::VALUE1 + **self == HFRDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HFRDY_A::VALUE2 + **self == HFRDY_A::VALUE2 } } -#[doc = "Write proxy for field `HFRDY`"] +impl core::ops::Deref for HFRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HFRDY` writer - HardFault Ready"] pub struct HFRDY_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> HFRDY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HFRDY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Priority did not permit setting the HardFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> HFRDY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MMRDY`"] -pub type MMRDY_R = crate::R; +#[doc = "Field `MMRDY` reader - MemManage Ready"] +pub struct MMRDY_R(crate::FieldReader); impl MMRDY_R { + pub(crate) fn new(bits: bool) -> Self { + MMRDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MMRDY_A { @@ -338,15 +397,22 @@ impl MMRDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MMRDY_A::VALUE1 + **self == MMRDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MMRDY_A::VALUE2 + **self == MMRDY_A::VALUE2 } } -#[doc = "Write proxy for field `MMRDY`"] +impl core::ops::Deref for MMRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MMRDY` writer - MemManage Ready"] pub struct MMRDY_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> MMRDY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MMRDY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MemManage is disabled or priority did not permit setting the MemManage handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> MMRDY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFRDY`"] -pub type BFRDY_R = crate::R; +#[doc = "Field `BFRDY` reader - BusFault Ready"] +pub struct BFRDY_R(crate::FieldReader); impl BFRDY_R { + pub(crate) fn new(bits: bool) -> Self { + BFRDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFRDY_A { @@ -413,15 +480,22 @@ impl BFRDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFRDY_A::VALUE1 + **self == BFRDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFRDY_A::VALUE2 + **self == BFRDY_A::VALUE2 + } +} +impl core::ops::Deref for BFRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFRDY`"] +#[doc = "Field `BFRDY` writer - BusFault Ready"] pub struct BFRDY_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> BFRDY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFRDY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "BusFault is disabled or priority did not permit setting the BusFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> BFRDY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MONRDY`"] -pub type MONRDY_R = crate::R; +#[doc = "Field `MONRDY` reader - Monitor Ready"] +pub struct MONRDY_R(crate::FieldReader); impl MONRDY_R { + pub(crate) fn new(bits: bool) -> Self { + MONRDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MONRDY_A { @@ -488,15 +563,22 @@ impl MONRDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MONRDY_A::VALUE1 + **self == MONRDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MONRDY_A::VALUE2 + **self == MONRDY_A::VALUE2 + } +} +impl core::ops::Deref for MONRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MONRDY`"] +#[doc = "Field `MONRDY` writer - Monitor Ready"] pub struct MONRDY_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> MONRDY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MONRDY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Debug Monitor is disabled or priority did not permit setting MON_PEND when the floating-point stack frame was allocated."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> MONRDY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LSPEN`"] -pub type LSPEN_R = crate::R; +#[doc = "Field `LSPEN` reader - Lazy State Preservation Enabled"] +pub struct LSPEN_R(crate::FieldReader); impl LSPEN_R { + pub(crate) fn new(bits: bool) -> Self { + LSPEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LSPEN_A { @@ -563,15 +646,22 @@ impl LSPEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LSPEN_A::VALUE1 + **self == LSPEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LSPEN_A::VALUE2 + **self == LSPEN_A::VALUE2 + } +} +impl core::ops::Deref for LSPEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LSPEN`"] +#[doc = "Field `LSPEN` writer - Lazy State Preservation Enabled"] pub struct LSPEN_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> LSPEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LSPEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable automatic lazy state preservation for floating-point context."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> LSPEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASPEN`"] -pub type ASPEN_R = crate::R; +#[doc = "Field `ASPEN` reader - Automatic State Preservation"] +pub struct ASPEN_R(crate::FieldReader); impl ASPEN_R { + pub(crate) fn new(bits: bool) -> Self { + ASPEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASPEN_A { @@ -638,15 +729,22 @@ impl ASPEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASPEN_A::VALUE1 + **self == ASPEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASPEN_A::VALUE2 + **self == ASPEN_A::VALUE2 } } -#[doc = "Write proxy for field `ASPEN`"] +impl core::ops::Deref for ASPEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ASPEN` writer - Automatic State Preservation"] pub struct ASPEN_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> ASPEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASPEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable CONTROL setting on execution of a floating-point instruction."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> ASPEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -778,4 +874,30 @@ impl W { pub fn aspen(&mut self) -> ASPEN_W { ASPEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating-point Context Control Register\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 [fpccr](index.html) module"] +pub struct FPCCR_SPEC; +impl crate::RegisterSpec for FPCCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpccr::R](R) reader structure"] +impl crate::Readable for FPCCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpccr::W](W) writer structure"] +impl crate::Writable for FPCCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPCCR to value 0"] +impl crate::Resettable for FPCCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/fpdscr.rs b/src/ppb/fpdscr.rs index feda173d..20543599 100644 --- a/src/ppb/fpdscr.rs +++ b/src/ppb/fpdscr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FPDSCR"] -pub type R = crate::R; -#[doc = "Writer for register FPDSCR"] -pub type W = crate::W; -#[doc = "Register FPDSCR `reset()`'s with value 0"] -impl crate::ResetValue for super::FPDSCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FPDSCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FPDSCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `RMode`"] -pub type RMODE_R = crate::R; -#[doc = "Write proxy for field `RMode`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RMode` reader - Default value for FPSCR.RMode"] +pub struct RMODE_R(crate::FieldReader); +impl RMODE_R { + pub(crate) fn new(bits: u8) -> Self { + RMODE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RMode` writer - Default value for FPSCR.RMode"] pub struct RMODE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> RMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } -#[doc = "Reader of field `FZ`"] -pub type FZ_R = crate::R; -#[doc = "Write proxy for field `FZ`"] +#[doc = "Field `FZ` reader - Default value for FPSCR.FZ"] +pub struct FZ_R(crate::FieldReader); +impl FZ_R { + pub(crate) fn new(bits: bool) -> Self { + FZ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FZ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FZ` writer - Default value for FPSCR.FZ"] pub struct FZ_W<'a> { w: &'a mut W, } @@ -44,13 +92,25 @@ impl<'a> FZ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Reader of field `DN`"] -pub type DN_R = crate::R; -#[doc = "Write proxy for field `DN`"] +#[doc = "Field `DN` reader - Default value for FPSCR.DN"] +pub struct DN_R(crate::FieldReader); +impl DN_R { + pub(crate) fn new(bits: bool) -> Self { + DN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DN` writer - Default value for FPSCR.DN"] pub struct DN_W<'a> { w: &'a mut W, } @@ -68,13 +128,25 @@ impl<'a> DN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Reader of field `AHP`"] -pub type AHP_R = crate::R; -#[doc = "Write proxy for field `AHP`"] +#[doc = "Field `AHP` reader - Default value for FPSCR.AHP"] +pub struct AHP_R(crate::FieldReader); +impl AHP_R { + pub(crate) fn new(bits: bool) -> Self { + AHP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHP` writer - Default value for FPSCR.AHP"] pub struct AHP_W<'a> { w: &'a mut W, } @@ -92,7 +164,7 @@ impl<'a> AHP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -139,4 +211,30 @@ impl W { pub fn ahp(&mut self) -> AHP_W { AHP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Floating-point Default Status Control Register\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 [fpdscr](index.html) module"] +pub struct FPDSCR_SPEC; +impl crate::RegisterSpec for FPDSCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fpdscr::R](R) reader structure"] +impl crate::Readable for FPDSCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fpdscr::W](W) writer structure"] +impl crate::Writable for FPDSCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FPDSCR to value 0"] +impl crate::Resettable for FPDSCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/hfsr.rs b/src/ppb/hfsr.rs index 727bb8bd..4138bbb7 100644 --- a/src/ppb/hfsr.rs +++ b/src/ppb/hfsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HFSR"] -pub type R = crate::R; -#[doc = "Writer for register HFSR"] -pub type W = crate::W; -#[doc = "Register HFSR `reset()`'s with value 0"] -impl crate::ResetValue for super::HFSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `HFSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HFSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "BusFault on vector table read\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VECTTBL`"] -pub type VECTTBL_R = crate::R; +#[doc = "Field `VECTTBL` reader - BusFault on vector table read"] +pub struct VECTTBL_R(crate::FieldReader); impl VECTTBL_R { + pub(crate) fn new(bits: bool) -> Self { + VECTTBL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VECTTBL_A { @@ -38,15 +65,22 @@ impl VECTTBL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VECTTBL_A::VALUE1 + **self == VECTTBL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VECTTBL_A::VALUE2 + **self == VECTTBL_A::VALUE2 } } -#[doc = "Write proxy for field `VECTTBL`"] +impl core::ops::Deref for VECTTBL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VECTTBL` writer - BusFault on vector table read"] pub struct VECTTBL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> VECTTBL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VECTTBL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no BusFault on vector table read"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> VECTTBL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FORCED`"] -pub type FORCED_R = crate::R; +#[doc = "Field `FORCED` reader - Forced HardFault"] +pub struct FORCED_R(crate::FieldReader); impl FORCED_R { + pub(crate) fn new(bits: bool) -> Self { + FORCED_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FORCED_A { @@ -113,15 +148,22 @@ impl FORCED_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FORCED_A::VALUE1 + **self == FORCED_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FORCED_A::VALUE2 + **self == FORCED_A::VALUE2 } } -#[doc = "Write proxy for field `FORCED`"] +impl core::ops::Deref for FORCED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FORCED` writer - Forced HardFault"] pub struct FORCED_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> FORCED_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FORCED_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no forced HardFault"] #[inline(always)] @@ -156,13 +196,25 @@ impl<'a> FORCED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `DEBUGEVT`"] -pub type DEBUGEVT_R = crate::R; -#[doc = "Write proxy for field `DEBUGEVT`"] +#[doc = "Field `DEBUGEVT` reader - Reserved for Debug use"] +pub struct DEBUGEVT_R(crate::FieldReader); +impl DEBUGEVT_R { + pub(crate) fn new(bits: bool) -> Self { + DEBUGEVT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEBUGEVT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DEBUGEVT` writer - Reserved for Debug use"] pub struct DEBUGEVT_W<'a> { w: &'a mut W, } @@ -180,7 +232,7 @@ impl<'a> DEBUGEVT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -217,4 +269,30 @@ impl W { pub fn debugevt(&mut self) -> DEBUGEVT_W { DEBUGEVT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HardFault Status Register\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 [hfsr](index.html) module"] +pub struct HFSR_SPEC; +impl crate::RegisterSpec for HFSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hfsr::R](R) reader structure"] +impl crate::Readable for HFSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hfsr::W](W) writer structure"] +impl crate::Writable for HFSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HFSR to value 0"] +impl crate::Resettable for HFSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/icsr.rs b/src/ppb/icsr.rs index 29ee3680..54531cbb 100644 --- a/src/ppb/icsr.rs +++ b/src/ppb/icsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ICSR"] -pub type R = crate::R; -#[doc = "Writer for register ICSR"] -pub type W = crate::W; -#[doc = "Register ICSR `reset()`'s with value 0"] -impl crate::ResetValue for super::ICSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ICSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ICSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Active exception number\n\nValue on reset: 0"] @@ -23,22 +47,31 @@ impl From for u16 { variant as _ } } -#[doc = "Reader of field `VECTACTIVE`"] -pub type VECTACTIVE_R = crate::R; +#[doc = "Field `VECTACTIVE` reader - Active exception number"] +pub struct VECTACTIVE_R(crate::FieldReader); impl VECTACTIVE_R { + pub(crate) fn new(bits: u16) -> Self { + VECTACTIVE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(VECTACTIVE_A::VALUE1), - i => Res(i), + 0 => Some(VECTACTIVE_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VECTACTIVE_A::VALUE1 + **self == VECTACTIVE_A::VALUE1 + } +} +impl core::ops::Deref for VECTACTIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Return to Base\n\nValue on reset: 0"] @@ -55,9 +88,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RETTOBASE`"] -pub type RETTOBASE_R = crate::R; +#[doc = "Field `RETTOBASE` reader - Return to Base"] +pub struct RETTOBASE_R(crate::FieldReader); impl RETTOBASE_R { + pub(crate) fn new(bits: bool) -> Self { + RETTOBASE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RETTOBASE_A { @@ -69,12 +105,19 @@ impl RETTOBASE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RETTOBASE_A::VALUE1 + **self == RETTOBASE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RETTOBASE_A::VALUE2 + **self == RETTOBASE_A::VALUE2 + } +} +impl core::ops::Deref for RETTOBASE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Vector Pending\n\nValue on reset: 0"] @@ -90,22 +133,31 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `VECTPENDING`"] -pub type VECTPENDING_R = crate::R; +#[doc = "Field `VECTPENDING` reader - Vector Pending"] +pub struct VECTPENDING_R(crate::FieldReader); impl VECTPENDING_R { + pub(crate) fn new(bits: u8) -> Self { + VECTPENDING_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(VECTPENDING_A::VALUE1), - i => Res(i), + 0 => Some(VECTPENDING_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VECTPENDING_A::VALUE1 + **self == VECTPENDING_A::VALUE1 + } +} +impl core::ops::Deref for VECTPENDING_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Interrupt pending flag\n\nValue on reset: 0"] @@ -122,9 +174,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ISRPENDING`"] -pub type ISRPENDING_R = crate::R; +#[doc = "Field `ISRPENDING` reader - Interrupt pending flag"] +pub struct ISRPENDING_R(crate::FieldReader); impl ISRPENDING_R { + pub(crate) fn new(bits: bool) -> Self { + ISRPENDING_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ISRPENDING_A { @@ -136,12 +191,19 @@ impl ISRPENDING_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ISRPENDING_A::VALUE1 + **self == ISRPENDING_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ISRPENDING_A::VALUE2 + **self == ISRPENDING_A::VALUE2 + } +} +impl core::ops::Deref for ISRPENDING_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "SysTick exception clear-pending bit\n\nValue on reset: 0"] @@ -158,7 +220,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PENDSTCLR`"] +#[doc = "Field `PENDSTCLR` writer - SysTick exception clear-pending bit"] pub struct PENDSTCLR_W<'a> { w: &'a mut W, } @@ -166,9 +228,7 @@ impl<'a> PENDSTCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PENDSTCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -193,7 +253,7 @@ impl<'a> PENDSTCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -211,9 +271,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PENDSTSET`"] -pub type PENDSTSET_R = crate::R; +#[doc = "Field `PENDSTSET` reader - SysTick exception set-pending bit"] +pub struct PENDSTSET_R(crate::FieldReader); impl PENDSTSET_R { + pub(crate) fn new(bits: bool) -> Self { + PENDSTSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PENDSTSET_A { @@ -225,15 +288,22 @@ impl PENDSTSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PENDSTSET_A::VALUE1 + **self == PENDSTSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PENDSTSET_A::VALUE2 + **self == PENDSTSET_A::VALUE2 + } +} +impl core::ops::Deref for PENDSTSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PENDSTSET`"] +#[doc = "Field `PENDSTSET` writer - SysTick exception set-pending bit"] pub struct PENDSTSET_W<'a> { w: &'a mut W, } @@ -241,9 +311,7 @@ impl<'a> PENDSTSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PENDSTSET_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -268,7 +336,7 @@ impl<'a> PENDSTSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -286,7 +354,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PENDSVCLR`"] +#[doc = "Field `PENDSVCLR` writer - PendSV clear-pending bit"] pub struct PENDSVCLR_W<'a> { w: &'a mut W, } @@ -294,9 +362,7 @@ impl<'a> PENDSVCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PENDSVCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "no effect"] #[inline(always)] @@ -321,13 +387,25 @@ impl<'a> PENDSVCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Reader of field `PENDSVSET`"] -pub type PENDSVSET_R = crate::R; -#[doc = "Write proxy for field `PENDSVSET`"] +#[doc = "Field `PENDSVSET` reader - PendSV set-pending bit: 0b0=no effect, 0b1=changes PendSV exception state to pending., 0b0=PendSV exception is not pending, 0b1=PendSV exception is pending.,"] +pub struct PENDSVSET_R(crate::FieldReader); +impl PENDSVSET_R { + pub(crate) fn new(bits: bool) -> Self { + PENDSVSET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PENDSVSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PENDSVSET` writer - PendSV set-pending bit: 0b0=no effect, 0b1=changes PendSV exception state to pending., 0b0=PendSV exception is not pending, 0b1=PendSV exception is pending.,"] pub struct PENDSVSET_W<'a> { w: &'a mut W, } @@ -345,13 +423,25 @@ impl<'a> PENDSVSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Reader of field `NMIPENDSET`"] -pub type NMIPENDSET_R = crate::R; -#[doc = "Write proxy for field `NMIPENDSET`"] +#[doc = "Field `NMIPENDSET` reader - NMI set-pending bit: 0b0=no effect, 0b1=changes NMI exception state to pending., 0b0=NMI exception is not pending, 0b1=NMI exception is pending.,"] +pub struct NMIPENDSET_R(crate::FieldReader); +impl NMIPENDSET_R { + pub(crate) fn new(bits: bool) -> Self { + NMIPENDSET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NMIPENDSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NMIPENDSET` writer - NMI set-pending bit: 0b0=no effect, 0b1=changes NMI exception state to pending., 0b0=NMI exception is not pending, 0b1=NMI exception is pending.,"] pub struct NMIPENDSET_W<'a> { w: &'a mut W, } @@ -369,7 +459,7 @@ impl<'a> NMIPENDSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -436,4 +526,30 @@ impl W { pub fn nmipendset(&mut self) -> NMIPENDSET_W { NMIPENDSET_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Control and State Register\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 [icsr](index.html) module"] +pub struct ICSR_SPEC; +impl crate::RegisterSpec for ICSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [icsr::R](R) reader structure"] +impl crate::Readable for ICSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [icsr::W](W) writer structure"] +impl crate::Writable for ICSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ICSR to value 0"] +impl crate::Resettable for ICSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mmfar.rs b/src/ppb/mmfar.rs index 4659b2f8..8269559b 100644 --- a/src/ppb/mmfar.rs +++ b/src/ppb/mmfar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MMFAR"] -pub type R = crate::R; -#[doc = "Writer for register MMFAR"] -pub type W = crate::W; -#[doc = "Register MMFAR `reset()`'s with value 0"] -impl crate::ResetValue for super::MMFAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MMFAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MMFAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `ADDRESS`"] -pub type ADDRESS_R = crate::R; -#[doc = "Write proxy for field `ADDRESS`"] +#[doc = "Field `ADDRESS` reader - Address causing the fault"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u32) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - Address causing the fault"] pub struct ADDRESS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> ADDRESS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn address(&mut self) -> ADDRESS_W { ADDRESS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MemManage Fault Address Register\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 [mmfar](index.html) module"] +pub struct MMFAR_SPEC; +impl crate::RegisterSpec for MMFAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mmfar::R](R) reader structure"] +impl crate::Readable for MMFAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mmfar::W](W) writer structure"] +impl crate::Writable for MMFAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MMFAR to value 0"] +impl crate::Resettable for MMFAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_ctrl.rs b/src/ppb/mpu_ctrl.rs index 786b004b..3f6c6790 100644 --- a/src/ppb/mpu_ctrl.rs +++ b/src/ppb/mpu_ctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MPU_CTRL"] -pub type R = crate::R; -#[doc = "Writer for register MPU_CTRL"] -pub type W = crate::W; -#[doc = "Register MPU_CTRL `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_CTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_CTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_CTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable MPU\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; +#[doc = "Field `ENABLE` reader - Enable MPU"] +pub struct ENABLE_R(crate::FieldReader); impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENABLE_A { @@ -38,15 +65,22 @@ impl ENABLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENABLE_A::VALUE1 + **self == ENABLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENABLE_A::VALUE2 + **self == ENABLE_A::VALUE2 } } -#[doc = "Write proxy for field `ENABLE`"] +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable MPU"] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENABLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HFNMIENA`"] -pub type HFNMIENA_R = crate::R; +#[doc = "Field `HFNMIENA` reader - Enable the operation of MPU during hard fault, NMI, and FAULTMASK handlers"] +pub struct HFNMIENA_R(crate::FieldReader); impl HFNMIENA_R { + pub(crate) fn new(bits: bool) -> Self { + HFNMIENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HFNMIENA_A { @@ -113,15 +148,22 @@ impl HFNMIENA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HFNMIENA_A::VALUE1 + **self == HFNMIENA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HFNMIENA_A::VALUE2 + **self == HFNMIENA_A::VALUE2 } } -#[doc = "Write proxy for field `HFNMIENA`"] +impl core::ops::Deref for HFNMIENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HFNMIENA` writer - Enable the operation of MPU during hard fault, NMI, and FAULTMASK handlers"] pub struct HFNMIENA_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> HFNMIENA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HFNMIENA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU is disabled during hard fault, NMI, and FAULTMASK handlers, regardless of the value of the ENABLE bit"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> HFNMIENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRIVDEFENA`"] -pub type PRIVDEFENA_R = crate::R; +#[doc = "Field `PRIVDEFENA` reader - Enables privileged software access to the default memory map"] +pub struct PRIVDEFENA_R(crate::FieldReader); impl PRIVDEFENA_R { + pub(crate) fn new(bits: bool) -> Self { + PRIVDEFENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRIVDEFENA_A { @@ -188,15 +231,22 @@ impl PRIVDEFENA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRIVDEFENA_A::VALUE1 + **self == PRIVDEFENA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRIVDEFENA_A::VALUE2 + **self == PRIVDEFENA_A::VALUE2 } } -#[doc = "Write proxy for field `PRIVDEFENA`"] +impl core::ops::Deref for PRIVDEFENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRIVDEFENA` writer - Enables privileged software access to the default memory map"] pub struct PRIVDEFENA_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PRIVDEFENA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRIVDEFENA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "If the MPU is enabled, disables use of the default memory map. Any memory access to a location not covered by any enabled region causes a fault."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PRIVDEFENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -268,4 +316,30 @@ impl W { pub fn privdefena(&mut self) -> PRIVDEFENA_W { PRIVDEFENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Control Register\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 [mpu_ctrl](index.html) module"] +pub struct MPU_CTRL_SPEC; +impl crate::RegisterSpec for MPU_CTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_ctrl::R](R) reader structure"] +impl crate::Readable for MPU_CTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_ctrl::W](W) writer structure"] +impl crate::Writable for MPU_CTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_CTRL to value 0"] +impl crate::Resettable for MPU_CTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rasr.rs b/src/ppb/mpu_rasr.rs index e99deb0f..3a41c3d5 100644 --- a/src/ppb/mpu_rasr.rs +++ b/src/ppb/mpu_rasr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RASR"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RASR"] -pub type W = crate::W; -#[doc = "Register MPU_RASR `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RASR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RASR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RASR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENABLE` reader - Region enable bit."] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; -#[doc = "Write proxy for field `ENABLE`"] +#[doc = "Field `ENABLE` writer - Region enable bit."] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` reader - MPU protection region size"] +pub struct SIZE_R(crate::FieldReader); +impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIZE` writer - MPU protection region size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 1)) | (((value as u32) & 0x1f) << 1); + self.w.bits = (self.w.bits & !(0x1f << 1)) | ((value as u32 & 0x1f) << 1); self.w } } @@ -63,31 +111,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRD`"] -pub type SRD_R = crate::R; +#[doc = "Field `SRD` reader - Subregion disable bits"] +pub struct SRD_R(crate::FieldReader); impl SRD_R { + pub(crate) fn new(bits: u8) -> Self { + SRD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRD_A::VALUE1), - 1 => Val(SRD_A::VALUE2), - i => Res(i), + 0 => Some(SRD_A::VALUE1), + 1 => Some(SRD_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRD_A::VALUE1 + **self == SRD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRD_A::VALUE2 + **self == SRD_A::VALUE2 } } -#[doc = "Write proxy for field `SRD`"] +impl core::ops::Deref for SRD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRD` writer - Subregion disable bits"] pub struct SRD_W<'a> { w: &'a mut W, } @@ -110,13 +167,25 @@ impl<'a> SRD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `B`"] -pub type B_R = crate::R; -#[doc = "Write proxy for field `B`"] +#[doc = "Field `B` reader - Memory access attribute"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: bool) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B` writer - Memory access attribute"] pub struct B_W<'a> { w: &'a mut W, } @@ -134,13 +203,25 @@ impl<'a> B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `C`"] -pub type C_R = crate::R; -#[doc = "Write proxy for field `C`"] +#[doc = "Field `C` reader - Memory access attribute"] +pub struct C_R(crate::FieldReader); +impl C_R { + pub(crate) fn new(bits: bool) -> Self { + C_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C` writer - Memory access attribute"] pub struct C_W<'a> { w: &'a mut W, } @@ -158,13 +239,25 @@ impl<'a> C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `S`"] -pub type S_R = crate::R; -#[doc = "Write proxy for field `S`"] +#[doc = "Field `S` reader - Shareable bit"] +pub struct S_R(crate::FieldReader); +impl S_R { + pub(crate) fn new(bits: bool) -> Self { + S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S` writer - Shareable bit"] pub struct S_W<'a> { w: &'a mut W, } @@ -182,13 +275,25 @@ impl<'a> S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `TEX`"] -pub type TEX_R = crate::R; -#[doc = "Write proxy for field `TEX`"] +#[doc = "Field `TEX` reader - Memory access attribute"] +pub struct TEX_R(crate::FieldReader); +impl TEX_R { + pub(crate) fn new(bits: u8) -> Self { + TEX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEX` writer - Memory access attribute"] pub struct TEX_W<'a> { w: &'a mut W, } @@ -196,13 +301,25 @@ impl<'a> TEX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } -#[doc = "Reader of field `AP`"] -pub type AP_R = crate::R; -#[doc = "Write proxy for field `AP`"] +#[doc = "Field `AP` reader - Access permission field"] +pub struct AP_R(crate::FieldReader); +impl AP_R { + pub(crate) fn new(bits: u8) -> Self { + AP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP` writer - Access permission field"] pub struct AP_W<'a> { w: &'a mut W, } @@ -210,7 +327,7 @@ impl<'a> AP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -228,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XN`"] -pub type XN_R = crate::R; +#[doc = "Field `XN` reader - Instruction access disable bit"] +pub struct XN_R(crate::FieldReader); impl XN_R { + pub(crate) fn new(bits: bool) -> Self { + XN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XN_A { @@ -242,15 +362,22 @@ impl XN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XN_A::VALUE1 + **self == XN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XN_A::VALUE2 + **self == XN_A::VALUE2 + } +} +impl core::ops::Deref for XN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XN`"] +#[doc = "Field `XN` writer - Instruction access disable bit"] pub struct XN_W<'a> { w: &'a mut W, } @@ -258,9 +385,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "instruction fetches enabled"] #[inline(always)] @@ -285,7 +410,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -382,4 +507,30 @@ impl W { pub fn xn(&mut self) -> XN_W { XN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Attribute and Size Register\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 [mpu_rasr](index.html) module"] +pub struct MPU_RASR_SPEC; +impl crate::RegisterSpec for MPU_RASR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rasr::R](R) reader structure"] +impl crate::Readable for MPU_RASR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rasr::W](W) writer structure"] +impl crate::Writable for MPU_RASR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RASR to value 0"] +impl crate::Resettable for MPU_RASR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rasr_a1.rs b/src/ppb/mpu_rasr_a1.rs index e0c65900..10f8da1a 100644 --- a/src/ppb/mpu_rasr_a1.rs +++ b/src/ppb/mpu_rasr_a1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RASR_A1"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RASR_A1"] -pub type W = crate::W; -#[doc = "Register MPU_RASR_A1 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RASR_A1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RASR_A1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RASR_A1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENABLE` reader - Region enable bit."] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; -#[doc = "Write proxy for field `ENABLE`"] +#[doc = "Field `ENABLE` writer - Region enable bit."] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` reader - MPU protection region size"] +pub struct SIZE_R(crate::FieldReader); +impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIZE` writer - MPU protection region size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 1)) | (((value as u32) & 0x1f) << 1); + self.w.bits = (self.w.bits & !(0x1f << 1)) | ((value as u32 & 0x1f) << 1); self.w } } @@ -63,31 +111,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRD`"] -pub type SRD_R = crate::R; +#[doc = "Field `SRD` reader - Subregion disable bits"] +pub struct SRD_R(crate::FieldReader); impl SRD_R { + pub(crate) fn new(bits: u8) -> Self { + SRD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRD_A::VALUE1), - 1 => Val(SRD_A::VALUE2), - i => Res(i), + 0 => Some(SRD_A::VALUE1), + 1 => Some(SRD_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRD_A::VALUE1 + **self == SRD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRD_A::VALUE2 + **self == SRD_A::VALUE2 } } -#[doc = "Write proxy for field `SRD`"] +impl core::ops::Deref for SRD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRD` writer - Subregion disable bits"] pub struct SRD_W<'a> { w: &'a mut W, } @@ -110,13 +167,25 @@ impl<'a> SRD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `B`"] -pub type B_R = crate::R; -#[doc = "Write proxy for field `B`"] +#[doc = "Field `B` reader - Memory access attribute"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: bool) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B` writer - Memory access attribute"] pub struct B_W<'a> { w: &'a mut W, } @@ -134,13 +203,25 @@ impl<'a> B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `C`"] -pub type C_R = crate::R; -#[doc = "Write proxy for field `C`"] +#[doc = "Field `C` reader - Memory access attribute"] +pub struct C_R(crate::FieldReader); +impl C_R { + pub(crate) fn new(bits: bool) -> Self { + C_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C` writer - Memory access attribute"] pub struct C_W<'a> { w: &'a mut W, } @@ -158,13 +239,25 @@ impl<'a> C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `S`"] -pub type S_R = crate::R; -#[doc = "Write proxy for field `S`"] +#[doc = "Field `S` reader - Shareable bit"] +pub struct S_R(crate::FieldReader); +impl S_R { + pub(crate) fn new(bits: bool) -> Self { + S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S` writer - Shareable bit"] pub struct S_W<'a> { w: &'a mut W, } @@ -182,13 +275,25 @@ impl<'a> S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `TEX`"] -pub type TEX_R = crate::R; -#[doc = "Write proxy for field `TEX`"] +#[doc = "Field `TEX` reader - Memory access attribute"] +pub struct TEX_R(crate::FieldReader); +impl TEX_R { + pub(crate) fn new(bits: u8) -> Self { + TEX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEX` writer - Memory access attribute"] pub struct TEX_W<'a> { w: &'a mut W, } @@ -196,13 +301,25 @@ impl<'a> TEX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } -#[doc = "Reader of field `AP`"] -pub type AP_R = crate::R; -#[doc = "Write proxy for field `AP`"] +#[doc = "Field `AP` reader - Access permission field"] +pub struct AP_R(crate::FieldReader); +impl AP_R { + pub(crate) fn new(bits: u8) -> Self { + AP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP` writer - Access permission field"] pub struct AP_W<'a> { w: &'a mut W, } @@ -210,7 +327,7 @@ impl<'a> AP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -228,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XN`"] -pub type XN_R = crate::R; +#[doc = "Field `XN` reader - Instruction access disable bit"] +pub struct XN_R(crate::FieldReader); impl XN_R { + pub(crate) fn new(bits: bool) -> Self { + XN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XN_A { @@ -242,15 +362,22 @@ impl XN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XN_A::VALUE1 + **self == XN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XN_A::VALUE2 + **self == XN_A::VALUE2 + } +} +impl core::ops::Deref for XN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XN`"] +#[doc = "Field `XN` writer - Instruction access disable bit"] pub struct XN_W<'a> { w: &'a mut W, } @@ -258,9 +385,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "instruction fetches enabled"] #[inline(always)] @@ -285,7 +410,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -382,4 +507,30 @@ impl W { pub fn xn(&mut self) -> XN_W { XN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Attribute and Size Register A1\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 [mpu_rasr_a1](index.html) module"] +pub struct MPU_RASR_A1_SPEC; +impl crate::RegisterSpec for MPU_RASR_A1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rasr_a1::R](R) reader structure"] +impl crate::Readable for MPU_RASR_A1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rasr_a1::W](W) writer structure"] +impl crate::Writable for MPU_RASR_A1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RASR_A1 to value 0"] +impl crate::Resettable for MPU_RASR_A1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rasr_a2.rs b/src/ppb/mpu_rasr_a2.rs index ae753307..9c564361 100644 --- a/src/ppb/mpu_rasr_a2.rs +++ b/src/ppb/mpu_rasr_a2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RASR_A2"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RASR_A2"] -pub type W = crate::W; -#[doc = "Register MPU_RASR_A2 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RASR_A2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RASR_A2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RASR_A2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENABLE` reader - Region enable bit."] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; -#[doc = "Write proxy for field `ENABLE`"] +#[doc = "Field `ENABLE` writer - Region enable bit."] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` reader - MPU protection region size"] +pub struct SIZE_R(crate::FieldReader); +impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIZE` writer - MPU protection region size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 1)) | (((value as u32) & 0x1f) << 1); + self.w.bits = (self.w.bits & !(0x1f << 1)) | ((value as u32 & 0x1f) << 1); self.w } } @@ -63,31 +111,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRD`"] -pub type SRD_R = crate::R; +#[doc = "Field `SRD` reader - Subregion disable bits"] +pub struct SRD_R(crate::FieldReader); impl SRD_R { + pub(crate) fn new(bits: u8) -> Self { + SRD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRD_A::VALUE1), - 1 => Val(SRD_A::VALUE2), - i => Res(i), + 0 => Some(SRD_A::VALUE1), + 1 => Some(SRD_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRD_A::VALUE1 + **self == SRD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRD_A::VALUE2 + **self == SRD_A::VALUE2 } } -#[doc = "Write proxy for field `SRD`"] +impl core::ops::Deref for SRD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRD` writer - Subregion disable bits"] pub struct SRD_W<'a> { w: &'a mut W, } @@ -110,13 +167,25 @@ impl<'a> SRD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `B`"] -pub type B_R = crate::R; -#[doc = "Write proxy for field `B`"] +#[doc = "Field `B` reader - Memory access attribute"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: bool) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B` writer - Memory access attribute"] pub struct B_W<'a> { w: &'a mut W, } @@ -134,13 +203,25 @@ impl<'a> B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `C`"] -pub type C_R = crate::R; -#[doc = "Write proxy for field `C`"] +#[doc = "Field `C` reader - Memory access attribute"] +pub struct C_R(crate::FieldReader); +impl C_R { + pub(crate) fn new(bits: bool) -> Self { + C_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C` writer - Memory access attribute"] pub struct C_W<'a> { w: &'a mut W, } @@ -158,13 +239,25 @@ impl<'a> C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `S`"] -pub type S_R = crate::R; -#[doc = "Write proxy for field `S`"] +#[doc = "Field `S` reader - Shareable bit"] +pub struct S_R(crate::FieldReader); +impl S_R { + pub(crate) fn new(bits: bool) -> Self { + S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S` writer - Shareable bit"] pub struct S_W<'a> { w: &'a mut W, } @@ -182,13 +275,25 @@ impl<'a> S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `TEX`"] -pub type TEX_R = crate::R; -#[doc = "Write proxy for field `TEX`"] +#[doc = "Field `TEX` reader - Memory access attribute"] +pub struct TEX_R(crate::FieldReader); +impl TEX_R { + pub(crate) fn new(bits: u8) -> Self { + TEX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEX` writer - Memory access attribute"] pub struct TEX_W<'a> { w: &'a mut W, } @@ -196,13 +301,25 @@ impl<'a> TEX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } -#[doc = "Reader of field `AP`"] -pub type AP_R = crate::R; -#[doc = "Write proxy for field `AP`"] +#[doc = "Field `AP` reader - Access permission field"] +pub struct AP_R(crate::FieldReader); +impl AP_R { + pub(crate) fn new(bits: u8) -> Self { + AP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP` writer - Access permission field"] pub struct AP_W<'a> { w: &'a mut W, } @@ -210,7 +327,7 @@ impl<'a> AP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -228,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XN`"] -pub type XN_R = crate::R; +#[doc = "Field `XN` reader - Instruction access disable bit"] +pub struct XN_R(crate::FieldReader); impl XN_R { + pub(crate) fn new(bits: bool) -> Self { + XN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XN_A { @@ -242,15 +362,22 @@ impl XN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XN_A::VALUE1 + **self == XN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XN_A::VALUE2 + **self == XN_A::VALUE2 + } +} +impl core::ops::Deref for XN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XN`"] +#[doc = "Field `XN` writer - Instruction access disable bit"] pub struct XN_W<'a> { w: &'a mut W, } @@ -258,9 +385,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "instruction fetches enabled"] #[inline(always)] @@ -285,7 +410,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -382,4 +507,30 @@ impl W { pub fn xn(&mut self) -> XN_W { XN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Attribute and Size Register A2\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 [mpu_rasr_a2](index.html) module"] +pub struct MPU_RASR_A2_SPEC; +impl crate::RegisterSpec for MPU_RASR_A2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rasr_a2::R](R) reader structure"] +impl crate::Readable for MPU_RASR_A2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rasr_a2::W](W) writer structure"] +impl crate::Writable for MPU_RASR_A2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RASR_A2 to value 0"] +impl crate::Resettable for MPU_RASR_A2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rasr_a3.rs b/src/ppb/mpu_rasr_a3.rs index 557542f5..7566e618 100644 --- a/src/ppb/mpu_rasr_a3.rs +++ b/src/ppb/mpu_rasr_a3.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RASR_A3"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RASR_A3"] -pub type W = crate::W; -#[doc = "Register MPU_RASR_A3 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RASR_A3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RASR_A3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RASR_A3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENABLE` reader - Region enable bit."] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; -#[doc = "Write proxy for field `ENABLE`"] +#[doc = "Field `ENABLE` writer - Region enable bit."] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` reader - MPU protection region size"] +pub struct SIZE_R(crate::FieldReader); +impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SIZE` writer - MPU protection region size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 1)) | (((value as u32) & 0x1f) << 1); + self.w.bits = (self.w.bits & !(0x1f << 1)) | ((value as u32 & 0x1f) << 1); self.w } } @@ -63,31 +111,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRD`"] -pub type SRD_R = crate::R; +#[doc = "Field `SRD` reader - Subregion disable bits"] +pub struct SRD_R(crate::FieldReader); impl SRD_R { + pub(crate) fn new(bits: u8) -> Self { + SRD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRD_A::VALUE1), - 1 => Val(SRD_A::VALUE2), - i => Res(i), + 0 => Some(SRD_A::VALUE1), + 1 => Some(SRD_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRD_A::VALUE1 + **self == SRD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRD_A::VALUE2 + **self == SRD_A::VALUE2 } } -#[doc = "Write proxy for field `SRD`"] +impl core::ops::Deref for SRD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRD` writer - Subregion disable bits"] pub struct SRD_W<'a> { w: &'a mut W, } @@ -110,13 +167,25 @@ impl<'a> SRD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `B`"] -pub type B_R = crate::R; -#[doc = "Write proxy for field `B`"] +#[doc = "Field `B` reader - Memory access attribute"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: bool) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B` writer - Memory access attribute"] pub struct B_W<'a> { w: &'a mut W, } @@ -134,13 +203,25 @@ impl<'a> B_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `C`"] -pub type C_R = crate::R; -#[doc = "Write proxy for field `C`"] +#[doc = "Field `C` reader - Memory access attribute"] +pub struct C_R(crate::FieldReader); +impl C_R { + pub(crate) fn new(bits: bool) -> Self { + C_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for C_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `C` writer - Memory access attribute"] pub struct C_W<'a> { w: &'a mut W, } @@ -158,13 +239,25 @@ impl<'a> C_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `S`"] -pub type S_R = crate::R; -#[doc = "Write proxy for field `S`"] +#[doc = "Field `S` reader - Shareable bit"] +pub struct S_R(crate::FieldReader); +impl S_R { + pub(crate) fn new(bits: bool) -> Self { + S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S` writer - Shareable bit"] pub struct S_W<'a> { w: &'a mut W, } @@ -182,13 +275,25 @@ impl<'a> S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `TEX`"] -pub type TEX_R = crate::R; -#[doc = "Write proxy for field `TEX`"] +#[doc = "Field `TEX` reader - Memory access attribute"] +pub struct TEX_R(crate::FieldReader); +impl TEX_R { + pub(crate) fn new(bits: u8) -> Self { + TEX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEX` writer - Memory access attribute"] pub struct TEX_W<'a> { w: &'a mut W, } @@ -196,13 +301,25 @@ impl<'a> TEX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } -#[doc = "Reader of field `AP`"] -pub type AP_R = crate::R; -#[doc = "Write proxy for field `AP`"] +#[doc = "Field `AP` reader - Access permission field"] +pub struct AP_R(crate::FieldReader); +impl AP_R { + pub(crate) fn new(bits: u8) -> Self { + AP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP` writer - Access permission field"] pub struct AP_W<'a> { w: &'a mut W, } @@ -210,7 +327,7 @@ impl<'a> AP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -228,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XN`"] -pub type XN_R = crate::R; +#[doc = "Field `XN` reader - Instruction access disable bit"] +pub struct XN_R(crate::FieldReader); impl XN_R { + pub(crate) fn new(bits: bool) -> Self { + XN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XN_A { @@ -242,15 +362,22 @@ impl XN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XN_A::VALUE1 + **self == XN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XN_A::VALUE2 + **self == XN_A::VALUE2 + } +} +impl core::ops::Deref for XN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XN`"] +#[doc = "Field `XN` writer - Instruction access disable bit"] pub struct XN_W<'a> { w: &'a mut W, } @@ -258,9 +385,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "instruction fetches enabled"] #[inline(always)] @@ -285,7 +410,7 @@ impl<'a> XN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -382,4 +507,30 @@ impl W { pub fn xn(&mut self) -> XN_W { XN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Attribute and Size Register A3\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 [mpu_rasr_a3](index.html) module"] +pub struct MPU_RASR_A3_SPEC; +impl crate::RegisterSpec for MPU_RASR_A3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rasr_a3::R](R) reader structure"] +impl crate::Readable for MPU_RASR_A3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rasr_a3::W](W) writer structure"] +impl crate::Writable for MPU_RASR_A3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RASR_A3 to value 0"] +impl crate::Resettable for MPU_RASR_A3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rbar.rs b/src/ppb/mpu_rbar.rs index c05ecde8..5579566e 100644 --- a/src/ppb/mpu_rbar.rs +++ b/src/ppb/mpu_rbar.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RBAR"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RBAR"] -pub type W = crate::W; -#[doc = "Register MPU_RBAR `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RBAR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RBAR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RBAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REGION` reader - MPU region field"] +pub struct REGION_R(crate::FieldReader); +impl REGION_R { + pub(crate) fn new(bits: u8) -> Self { + REGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `REGION`"] -pub type REGION_R = crate::R; -#[doc = "Write proxy for field `REGION`"] +#[doc = "Field `REGION` writer - MPU region field"] pub struct REGION_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> REGION_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VALID`"] -pub type VALID_R = crate::R; +#[doc = "Field `VALID` reader - MPU Region Number valid bit"] +pub struct VALID_R(crate::FieldReader); impl VALID_R { + pub(crate) fn new(bits: bool) -> Self { + VALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VALID_A { @@ -52,15 +91,22 @@ impl VALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VALID_A::VALUE1 + **self == VALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VALID_A::VALUE2 + **self == VALID_A::VALUE2 } } -#[doc = "Write proxy for field `VALID`"] +impl core::ops::Deref for VALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALID` writer - MPU Region Number valid bit"] pub struct VALID_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU_RNR not changed, and the processor: - updates the base address for the region specified in the MPU_RNR - ignores the value of the REGION field"] #[inline(always)] @@ -95,13 +139,25 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ADDR`"] -pub type ADDR_R = crate::R; -#[doc = "Write proxy for field `ADDR`"] +#[doc = "Field `ADDR` reader - Region base address field"] +pub struct ADDR_R(crate::FieldReader); +impl ADDR_R { + pub(crate) fn new(bits: u32) -> Self { + ADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR` writer - Region base address field"] pub struct ADDR_W<'a> { w: &'a mut W, } @@ -109,7 +165,7 @@ impl<'a> ADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | (((value as u32) & 0x007f_ffff) << 9); + self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | ((value as u32 & 0x007f_ffff) << 9); self.w } } @@ -146,4 +202,30 @@ impl W { pub fn addr(&mut self) -> ADDR_W { ADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Base Address Register\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 [mpu_rbar](index.html) module"] +pub struct MPU_RBAR_SPEC; +impl crate::RegisterSpec for MPU_RBAR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rbar::R](R) reader structure"] +impl crate::Readable for MPU_RBAR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rbar::W](W) writer structure"] +impl crate::Writable for MPU_RBAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RBAR to value 0"] +impl crate::Resettable for MPU_RBAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rbar_a1.rs b/src/ppb/mpu_rbar_a1.rs index 10fc71f4..0dc52d69 100644 --- a/src/ppb/mpu_rbar_a1.rs +++ b/src/ppb/mpu_rbar_a1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RBAR_A1"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RBAR_A1"] -pub type W = crate::W; -#[doc = "Register MPU_RBAR_A1 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RBAR_A1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RBAR_A1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RBAR_A1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REGION` reader - MPU region field"] +pub struct REGION_R(crate::FieldReader); +impl REGION_R { + pub(crate) fn new(bits: u8) -> Self { + REGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `REGION`"] -pub type REGION_R = crate::R; -#[doc = "Write proxy for field `REGION`"] +#[doc = "Field `REGION` writer - MPU region field"] pub struct REGION_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> REGION_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VALID`"] -pub type VALID_R = crate::R; +#[doc = "Field `VALID` reader - MPU Region Number valid bit"] +pub struct VALID_R(crate::FieldReader); impl VALID_R { + pub(crate) fn new(bits: bool) -> Self { + VALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VALID_A { @@ -52,15 +91,22 @@ impl VALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VALID_A::VALUE1 + **self == VALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VALID_A::VALUE2 + **self == VALID_A::VALUE2 } } -#[doc = "Write proxy for field `VALID`"] +impl core::ops::Deref for VALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALID` writer - MPU Region Number valid bit"] pub struct VALID_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU_RNR not changed, and the processor: - updates the base address for the region specified in the MPU_RNR - ignores the value of the REGION field"] #[inline(always)] @@ -95,13 +139,25 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ADDR`"] -pub type ADDR_R = crate::R; -#[doc = "Write proxy for field `ADDR`"] +#[doc = "Field `ADDR` reader - Region base address field"] +pub struct ADDR_R(crate::FieldReader); +impl ADDR_R { + pub(crate) fn new(bits: u32) -> Self { + ADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR` writer - Region base address field"] pub struct ADDR_W<'a> { w: &'a mut W, } @@ -109,7 +165,7 @@ impl<'a> ADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | (((value as u32) & 0x007f_ffff) << 9); + self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | ((value as u32 & 0x007f_ffff) << 9); self.w } } @@ -146,4 +202,30 @@ impl W { pub fn addr(&mut self) -> ADDR_W { ADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Base Address Register A1\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 [mpu_rbar_a1](index.html) module"] +pub struct MPU_RBAR_A1_SPEC; +impl crate::RegisterSpec for MPU_RBAR_A1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rbar_a1::R](R) reader structure"] +impl crate::Readable for MPU_RBAR_A1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rbar_a1::W](W) writer structure"] +impl crate::Writable for MPU_RBAR_A1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RBAR_A1 to value 0"] +impl crate::Resettable for MPU_RBAR_A1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rbar_a2.rs b/src/ppb/mpu_rbar_a2.rs index 6b70ae48..b80552c7 100644 --- a/src/ppb/mpu_rbar_a2.rs +++ b/src/ppb/mpu_rbar_a2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RBAR_A2"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RBAR_A2"] -pub type W = crate::W; -#[doc = "Register MPU_RBAR_A2 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RBAR_A2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RBAR_A2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RBAR_A2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REGION` reader - MPU region field"] +pub struct REGION_R(crate::FieldReader); +impl REGION_R { + pub(crate) fn new(bits: u8) -> Self { + REGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `REGION`"] -pub type REGION_R = crate::R; -#[doc = "Write proxy for field `REGION`"] +#[doc = "Field `REGION` writer - MPU region field"] pub struct REGION_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> REGION_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VALID`"] -pub type VALID_R = crate::R; +#[doc = "Field `VALID` reader - MPU Region Number valid bit"] +pub struct VALID_R(crate::FieldReader); impl VALID_R { + pub(crate) fn new(bits: bool) -> Self { + VALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VALID_A { @@ -52,15 +91,22 @@ impl VALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VALID_A::VALUE1 + **self == VALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VALID_A::VALUE2 + **self == VALID_A::VALUE2 } } -#[doc = "Write proxy for field `VALID`"] +impl core::ops::Deref for VALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALID` writer - MPU Region Number valid bit"] pub struct VALID_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU_RNR not changed, and the processor: - updates the base address for the region specified in the MPU_RNR - ignores the value of the REGION field"] #[inline(always)] @@ -95,13 +139,25 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ADDR`"] -pub type ADDR_R = crate::R; -#[doc = "Write proxy for field `ADDR`"] +#[doc = "Field `ADDR` reader - Region base address field"] +pub struct ADDR_R(crate::FieldReader); +impl ADDR_R { + pub(crate) fn new(bits: u32) -> Self { + ADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR` writer - Region base address field"] pub struct ADDR_W<'a> { w: &'a mut W, } @@ -109,7 +165,7 @@ impl<'a> ADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | (((value as u32) & 0x007f_ffff) << 9); + self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | ((value as u32 & 0x007f_ffff) << 9); self.w } } @@ -146,4 +202,30 @@ impl W { pub fn addr(&mut self) -> ADDR_W { ADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Base Address Register A2\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 [mpu_rbar_a2](index.html) module"] +pub struct MPU_RBAR_A2_SPEC; +impl crate::RegisterSpec for MPU_RBAR_A2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rbar_a2::R](R) reader structure"] +impl crate::Readable for MPU_RBAR_A2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rbar_a2::W](W) writer structure"] +impl crate::Writable for MPU_RBAR_A2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RBAR_A2 to value 0"] +impl crate::Resettable for MPU_RBAR_A2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rbar_a3.rs b/src/ppb/mpu_rbar_a3.rs index 810116cd..77db9352 100644 --- a/src/ppb/mpu_rbar_a3.rs +++ b/src/ppb/mpu_rbar_a3.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RBAR_A3"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RBAR_A3"] -pub type W = crate::W; -#[doc = "Register MPU_RBAR_A3 `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RBAR_A3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RBAR_A3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RBAR_A3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REGION` reader - MPU region field"] +pub struct REGION_R(crate::FieldReader); +impl REGION_R { + pub(crate) fn new(bits: u8) -> Self { + REGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `REGION`"] -pub type REGION_R = crate::R; -#[doc = "Write proxy for field `REGION`"] +#[doc = "Field `REGION` writer - MPU region field"] pub struct REGION_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> REGION_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VALID`"] -pub type VALID_R = crate::R; +#[doc = "Field `VALID` reader - MPU Region Number valid bit"] +pub struct VALID_R(crate::FieldReader); impl VALID_R { + pub(crate) fn new(bits: bool) -> Self { + VALID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VALID_A { @@ -52,15 +91,22 @@ impl VALID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VALID_A::VALUE1 + **self == VALID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VALID_A::VALUE2 + **self == VALID_A::VALUE2 } } -#[doc = "Write proxy for field `VALID`"] +impl core::ops::Deref for VALID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALID` writer - MPU Region Number valid bit"] pub struct VALID_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VALID_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MPU_RNR not changed, and the processor: - updates the base address for the region specified in the MPU_RNR - ignores the value of the REGION field"] #[inline(always)] @@ -95,13 +139,25 @@ impl<'a> VALID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ADDR`"] -pub type ADDR_R = crate::R; -#[doc = "Write proxy for field `ADDR`"] +#[doc = "Field `ADDR` reader - Region base address field"] +pub struct ADDR_R(crate::FieldReader); +impl ADDR_R { + pub(crate) fn new(bits: u32) -> Self { + ADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR` writer - Region base address field"] pub struct ADDR_W<'a> { w: &'a mut W, } @@ -109,7 +165,7 @@ impl<'a> ADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | (((value as u32) & 0x007f_ffff) << 9); + self.w.bits = (self.w.bits & !(0x007f_ffff << 9)) | ((value as u32 & 0x007f_ffff) << 9); self.w } } @@ -146,4 +202,30 @@ impl W { pub fn addr(&mut self) -> ADDR_W { ADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Base Address Register A3\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 [mpu_rbar_a3](index.html) module"] +pub struct MPU_RBAR_A3_SPEC; +impl crate::RegisterSpec for MPU_RBAR_A3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rbar_a3::R](R) reader structure"] +impl crate::Readable for MPU_RBAR_A3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rbar_a3::W](W) writer structure"] +impl crate::Writable for MPU_RBAR_A3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RBAR_A3 to value 0"] +impl crate::Resettable for MPU_RBAR_A3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_rnr.rs b/src/ppb/mpu_rnr.rs index b609c47f..f856f6bf 100644 --- a/src/ppb/mpu_rnr.rs +++ b/src/ppb/mpu_rnr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MPU_RNR"] -pub type R = crate::R; -#[doc = "Writer for register MPU_RNR"] -pub type W = crate::W; -#[doc = "Register MPU_RNR `reset()`'s with value 0"] -impl crate::ResetValue for super::MPU_RNR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MPU_RNR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MPU_RNR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `REGION`"] -pub type REGION_R = crate::R; -#[doc = "Write proxy for field `REGION`"] +#[doc = "Field `REGION` reader - Region"] +pub struct REGION_R(crate::FieldReader); +impl REGION_R { + pub(crate) fn new(bits: u8) -> Self { + REGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION` writer - Region"] pub struct REGION_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> REGION_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn region(&mut self) -> REGION_W { REGION_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MPU Region Number Register\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 [mpu_rnr](index.html) module"] +pub struct MPU_RNR_SPEC; +impl crate::RegisterSpec for MPU_RNR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_rnr::R](R) reader structure"] +impl crate::Readable for MPU_RNR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mpu_rnr::W](W) writer structure"] +impl crate::Writable for MPU_RNR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MPU_RNR to value 0"] +impl crate::Resettable for MPU_RNR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/mpu_type.rs b/src/ppb/mpu_type.rs index a887380b..3bd62615 100644 --- a/src/ppb/mpu_type.rs +++ b/src/ppb/mpu_type.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register MPU_TYPE"] -pub type R = crate::R; -#[doc = "Reader of field `SEPARATE`"] -pub type SEPARATE_R = crate::R; -#[doc = "Reader of field `DREGION`"] -pub type DREGION_R = crate::R; -#[doc = "Reader of field `IREGION`"] -pub type IREGION_R = crate::R; +#[doc = "Register `MPU_TYPE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `SEPARATE` reader - Support for unified or separate instruction and date memory maps"] +pub struct SEPARATE_R(crate::FieldReader); +impl SEPARATE_R { + pub(crate) fn new(bits: bool) -> Self { + SEPARATE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SEPARATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DREGION` reader - Number of supported MPU data regions"] +pub struct DREGION_R(crate::FieldReader); +impl DREGION_R { + pub(crate) fn new(bits: u8) -> Self { + DREGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DREGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IREGION` reader - Number of supported MPU instruction regions"] +pub struct IREGION_R(crate::FieldReader); +impl IREGION_R { + pub(crate) fn new(bits: u8) -> Self { + IREGION_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IREGION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Support for unified or separate instruction and date memory maps"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { IREGION_R::new(((self.bits >> 16) & 0xff) as u8) } } +#[doc = "MPU Type Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpu_type](index.html) module"] +pub struct MPU_TYPE_SPEC; +impl crate::RegisterSpec for MPU_TYPE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mpu_type::R](R) reader structure"] +impl crate::Readable for MPU_TYPE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MPU_TYPE to value 0x0800"] +impl crate::Resettable for MPU_TYPE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0800 + } +} diff --git a/src/ppb/nvic_iabr0.rs b/src/ppb/nvic_iabr0.rs index 5c0f016a..70026649 100644 --- a/src/ppb/nvic_iabr0.rs +++ b/src/ppb/nvic_iabr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_IABR0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IABR0"] -pub type W = crate::W; -#[doc = "Register NVIC_IABR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IABR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IABR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IABR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt active flags:\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `ACTIVE`"] -pub type ACTIVE_R = crate::R; +#[doc = "Field `ACTIVE` reader - Interrupt active flags:"] +pub struct ACTIVE_R(crate::FieldReader); impl ACTIVE_R { + pub(crate) fn new(bits: u32) -> Self { + ACTIVE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ACTIVE_A::VALUE1), - 1 => Val(ACTIVE_A::VALUE2), - i => Res(i), + 0 => Some(ACTIVE_A::VALUE1), + 1 => Some(ACTIVE_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACTIVE_A::VALUE1 + **self == ACTIVE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACTIVE_A::VALUE2 + **self == ACTIVE_A::VALUE2 + } +} +impl core::ops::Deref for ACTIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACTIVE`"] +#[doc = "Field `ACTIVE` writer - Interrupt active flags:"] pub struct ACTIVE_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> ACTIVE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn active(&mut self) -> ACTIVE_W { ACTIVE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Active Bit Register 0\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 [nvic_iabr0](index.html) module"] +pub struct NVIC_IABR0_SPEC; +impl crate::RegisterSpec for NVIC_IABR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iabr0::R](R) reader structure"] +impl crate::Readable for NVIC_IABR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iabr0::W](W) writer structure"] +impl crate::Writable for NVIC_IABR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IABR0 to value 0"] +impl crate::Resettable for NVIC_IABR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iabr1.rs b/src/ppb/nvic_iabr1.rs index 52e09b1d..749c0746 100644 --- a/src/ppb/nvic_iabr1.rs +++ b/src/ppb/nvic_iabr1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_IABR1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IABR1"] -pub type W = crate::W; -#[doc = "Register NVIC_IABR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IABR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IABR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IABR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt active flags:\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `ACTIVE`"] -pub type ACTIVE_R = crate::R; +#[doc = "Field `ACTIVE` reader - Interrupt active flags:"] +pub struct ACTIVE_R(crate::FieldReader); impl ACTIVE_R { + pub(crate) fn new(bits: u32) -> Self { + ACTIVE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ACTIVE_A::VALUE1), - 1 => Val(ACTIVE_A::VALUE2), - i => Res(i), + 0 => Some(ACTIVE_A::VALUE1), + 1 => Some(ACTIVE_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACTIVE_A::VALUE1 + **self == ACTIVE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACTIVE_A::VALUE2 + **self == ACTIVE_A::VALUE2 + } +} +impl core::ops::Deref for ACTIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACTIVE`"] +#[doc = "Field `ACTIVE` writer - Interrupt active flags:"] pub struct ACTIVE_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> ACTIVE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn active(&mut self) -> ACTIVE_W { ACTIVE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Active Bit Register 1\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 [nvic_iabr1](index.html) module"] +pub struct NVIC_IABR1_SPEC; +impl crate::RegisterSpec for NVIC_IABR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iabr1::R](R) reader structure"] +impl crate::Readable for NVIC_IABR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iabr1::W](W) writer structure"] +impl crate::Writable for NVIC_IABR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IABR1 to value 0"] +impl crate::Resettable for NVIC_IABR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iabr2.rs b/src/ppb/nvic_iabr2.rs index 42ed9a6c..57d9fa72 100644 --- a/src/ppb/nvic_iabr2.rs +++ b/src/ppb/nvic_iabr2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_IABR2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IABR2"] -pub type W = crate::W; -#[doc = "Register NVIC_IABR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IABR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IABR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IABR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt active flags:\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `ACTIVE`"] -pub type ACTIVE_R = crate::R; +#[doc = "Field `ACTIVE` reader - Interrupt active flags:"] +pub struct ACTIVE_R(crate::FieldReader); impl ACTIVE_R { + pub(crate) fn new(bits: u32) -> Self { + ACTIVE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ACTIVE_A::VALUE1), - 1 => Val(ACTIVE_A::VALUE2), - i => Res(i), + 0 => Some(ACTIVE_A::VALUE1), + 1 => Some(ACTIVE_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACTIVE_A::VALUE1 + **self == ACTIVE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACTIVE_A::VALUE2 + **self == ACTIVE_A::VALUE2 + } +} +impl core::ops::Deref for ACTIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACTIVE`"] +#[doc = "Field `ACTIVE` writer - Interrupt active flags:"] pub struct ACTIVE_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> ACTIVE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn active(&mut self) -> ACTIVE_W { ACTIVE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Active Bit Register 2\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 [nvic_iabr2](index.html) module"] +pub struct NVIC_IABR2_SPEC; +impl crate::RegisterSpec for NVIC_IABR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iabr2::R](R) reader structure"] +impl crate::Readable for NVIC_IABR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iabr2::W](W) writer structure"] +impl crate::Writable for NVIC_IABR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IABR2 to value 0"] +impl crate::Resettable for NVIC_IABR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iabr3.rs b/src/ppb/nvic_iabr3.rs index 988de30b..e5927d6e 100644 --- a/src/ppb/nvic_iabr3.rs +++ b/src/ppb/nvic_iabr3.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_IABR3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IABR3"] -pub type W = crate::W; -#[doc = "Register NVIC_IABR3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IABR3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IABR3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IABR3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt active flags:\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `ACTIVE`"] -pub type ACTIVE_R = crate::R; +#[doc = "Field `ACTIVE` reader - Interrupt active flags:"] +pub struct ACTIVE_R(crate::FieldReader); impl ACTIVE_R { + pub(crate) fn new(bits: u32) -> Self { + ACTIVE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ACTIVE_A::VALUE1), - 1 => Val(ACTIVE_A::VALUE2), - i => Res(i), + 0 => Some(ACTIVE_A::VALUE1), + 1 => Some(ACTIVE_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACTIVE_A::VALUE1 + **self == ACTIVE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACTIVE_A::VALUE2 + **self == ACTIVE_A::VALUE2 + } +} +impl core::ops::Deref for ACTIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACTIVE`"] +#[doc = "Field `ACTIVE` writer - Interrupt active flags:"] pub struct ACTIVE_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> ACTIVE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn active(&mut self) -> ACTIVE_W { ACTIVE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Active Bit Register 3\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 [nvic_iabr3](index.html) module"] +pub struct NVIC_IABR3_SPEC; +impl crate::RegisterSpec for NVIC_IABR3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iabr3::R](R) reader structure"] +impl crate::Readable for NVIC_IABR3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iabr3::W](W) writer structure"] +impl crate::Writable for NVIC_IABR3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IABR3 to value 0"] +impl crate::Resettable for NVIC_IABR3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icer0.rs b/src/ppb/nvic_icer0.rs index 2a4b5be7..98fe6fba 100644 --- a/src/ppb/nvic_icer0.rs +++ b/src/ppb/nvic_icer0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICER0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICER0"] -pub type W = crate::W; -#[doc = "Register NVIC_ICER0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICER0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICER0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICER0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRENA`"] -pub type CLRENA_R = crate::R; +#[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] +pub struct CLRENA_R(crate::FieldReader); impl CLRENA_R { + pub(crate) fn new(bits: u32) -> Self { + CLRENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRENA_A::VALUE3), - 1 => Val(CLRENA_A::VALUE4), - i => Res(i), + 0 => Some(CLRENA_A::VALUE3), + 1 => Some(CLRENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRENA_A::VALUE3 + **self == CLRENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRENA_A::VALUE4 + **self == CLRENA_A::VALUE4 + } +} +impl core::ops::Deref for CLRENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRENA`"] +#[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] pub struct CLRENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrena(&mut self) -> CLRENA_W { CLRENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-enable Register 0\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 [nvic_icer0](index.html) module"] +pub struct NVIC_ICER0_SPEC; +impl crate::RegisterSpec for NVIC_ICER0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icer0::R](R) reader structure"] +impl crate::Readable for NVIC_ICER0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icer0::W](W) writer structure"] +impl crate::Writable for NVIC_ICER0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICER0 to value 0"] +impl crate::Resettable for NVIC_ICER0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icer1.rs b/src/ppb/nvic_icer1.rs index 3a95365b..dca86ec3 100644 --- a/src/ppb/nvic_icer1.rs +++ b/src/ppb/nvic_icer1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICER1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICER1"] -pub type W = crate::W; -#[doc = "Register NVIC_ICER1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICER1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICER1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICER1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRENA`"] -pub type CLRENA_R = crate::R; +#[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] +pub struct CLRENA_R(crate::FieldReader); impl CLRENA_R { + pub(crate) fn new(bits: u32) -> Self { + CLRENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRENA_A::VALUE3), - 1 => Val(CLRENA_A::VALUE4), - i => Res(i), + 0 => Some(CLRENA_A::VALUE3), + 1 => Some(CLRENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRENA_A::VALUE3 + **self == CLRENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRENA_A::VALUE4 + **self == CLRENA_A::VALUE4 + } +} +impl core::ops::Deref for CLRENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRENA`"] +#[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] pub struct CLRENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrena(&mut self) -> CLRENA_W { CLRENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-enable Register 1\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 [nvic_icer1](index.html) module"] +pub struct NVIC_ICER1_SPEC; +impl crate::RegisterSpec for NVIC_ICER1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icer1::R](R) reader structure"] +impl crate::Readable for NVIC_ICER1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icer1::W](W) writer structure"] +impl crate::Writable for NVIC_ICER1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICER1 to value 0"] +impl crate::Resettable for NVIC_ICER1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icer2.rs b/src/ppb/nvic_icer2.rs index 99038376..f74ac721 100644 --- a/src/ppb/nvic_icer2.rs +++ b/src/ppb/nvic_icer2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICER2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICER2"] -pub type W = crate::W; -#[doc = "Register NVIC_ICER2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICER2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICER2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICER2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRENA`"] -pub type CLRENA_R = crate::R; +#[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] +pub struct CLRENA_R(crate::FieldReader); impl CLRENA_R { + pub(crate) fn new(bits: u32) -> Self { + CLRENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRENA_A::VALUE3), - 1 => Val(CLRENA_A::VALUE4), - i => Res(i), + 0 => Some(CLRENA_A::VALUE3), + 1 => Some(CLRENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRENA_A::VALUE3 + **self == CLRENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRENA_A::VALUE4 + **self == CLRENA_A::VALUE4 + } +} +impl core::ops::Deref for CLRENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRENA`"] +#[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] pub struct CLRENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrena(&mut self) -> CLRENA_W { CLRENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-enable Register 2\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 [nvic_icer2](index.html) module"] +pub struct NVIC_ICER2_SPEC; +impl crate::RegisterSpec for NVIC_ICER2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icer2::R](R) reader structure"] +impl crate::Readable for NVIC_ICER2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icer2::W](W) writer structure"] +impl crate::Writable for NVIC_ICER2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICER2 to value 0"] +impl crate::Resettable for NVIC_ICER2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icer3.rs b/src/ppb/nvic_icer3.rs index 7674dc9a..5ccb29e8 100644 --- a/src/ppb/nvic_icer3.rs +++ b/src/ppb/nvic_icer3.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICER3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICER3"] -pub type W = crate::W; -#[doc = "Register NVIC_ICER3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICER3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICER3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICER3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRENA`"] -pub type CLRENA_R = crate::R; +#[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] +pub struct CLRENA_R(crate::FieldReader); impl CLRENA_R { + pub(crate) fn new(bits: u32) -> Self { + CLRENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRENA_A::VALUE3), - 1 => Val(CLRENA_A::VALUE4), - i => Res(i), + 0 => Some(CLRENA_A::VALUE3), + 1 => Some(CLRENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRENA_A::VALUE3 + **self == CLRENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRENA_A::VALUE4 + **self == CLRENA_A::VALUE4 + } +} +impl core::ops::Deref for CLRENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRENA`"] +#[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] pub struct CLRENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrena(&mut self) -> CLRENA_W { CLRENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-enable Register 3\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 [nvic_icer3](index.html) module"] +pub struct NVIC_ICER3_SPEC; +impl crate::RegisterSpec for NVIC_ICER3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icer3::R](R) reader structure"] +impl crate::Readable for NVIC_ICER3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icer3::W](W) writer structure"] +impl crate::Writable for NVIC_ICER3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICER3 to value 0"] +impl crate::Resettable for NVIC_ICER3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icpr0.rs b/src/ppb/nvic_icpr0.rs index 61935762..ddfbccb6 100644 --- a/src/ppb/nvic_icpr0.rs +++ b/src/ppb/nvic_icpr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICPR0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICPR0"] -pub type W = crate::W; -#[doc = "Register NVIC_ICPR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICPR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICPR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICPR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRPEND`"] -pub type CLRPEND_R = crate::R; +#[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] +pub struct CLRPEND_R(crate::FieldReader); impl CLRPEND_R { + pub(crate) fn new(bits: u32) -> Self { + CLRPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRPEND_A::VALUE3), - 1 => Val(CLRPEND_A::VALUE4), - i => Res(i), + 0 => Some(CLRPEND_A::VALUE3), + 1 => Some(CLRPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRPEND_A::VALUE3 + **self == CLRPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRPEND_A::VALUE4 + **self == CLRPEND_A::VALUE4 + } +} +impl core::ops::Deref for CLRPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRPEND`"] +#[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] pub struct CLRPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrpend(&mut self) -> CLRPEND_W { CLRPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-pending Register 0\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 [nvic_icpr0](index.html) module"] +pub struct NVIC_ICPR0_SPEC; +impl crate::RegisterSpec for NVIC_ICPR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icpr0::R](R) reader structure"] +impl crate::Readable for NVIC_ICPR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icpr0::W](W) writer structure"] +impl crate::Writable for NVIC_ICPR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICPR0 to value 0"] +impl crate::Resettable for NVIC_ICPR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icpr1.rs b/src/ppb/nvic_icpr1.rs index 232351f7..f46e468e 100644 --- a/src/ppb/nvic_icpr1.rs +++ b/src/ppb/nvic_icpr1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICPR1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICPR1"] -pub type W = crate::W; -#[doc = "Register NVIC_ICPR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICPR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICPR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICPR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRPEND`"] -pub type CLRPEND_R = crate::R; +#[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] +pub struct CLRPEND_R(crate::FieldReader); impl CLRPEND_R { + pub(crate) fn new(bits: u32) -> Self { + CLRPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRPEND_A::VALUE3), - 1 => Val(CLRPEND_A::VALUE4), - i => Res(i), + 0 => Some(CLRPEND_A::VALUE3), + 1 => Some(CLRPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRPEND_A::VALUE3 + **self == CLRPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRPEND_A::VALUE4 + **self == CLRPEND_A::VALUE4 + } +} +impl core::ops::Deref for CLRPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRPEND`"] +#[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] pub struct CLRPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrpend(&mut self) -> CLRPEND_W { CLRPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-pending Register 1\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 [nvic_icpr1](index.html) module"] +pub struct NVIC_ICPR1_SPEC; +impl crate::RegisterSpec for NVIC_ICPR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icpr1::R](R) reader structure"] +impl crate::Readable for NVIC_ICPR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icpr1::W](W) writer structure"] +impl crate::Writable for NVIC_ICPR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICPR1 to value 0"] +impl crate::Resettable for NVIC_ICPR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icpr2.rs b/src/ppb/nvic_icpr2.rs index b93db69e..98690225 100644 --- a/src/ppb/nvic_icpr2.rs +++ b/src/ppb/nvic_icpr2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICPR2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICPR2"] -pub type W = crate::W; -#[doc = "Register NVIC_ICPR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICPR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICPR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICPR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRPEND`"] -pub type CLRPEND_R = crate::R; +#[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] +pub struct CLRPEND_R(crate::FieldReader); impl CLRPEND_R { + pub(crate) fn new(bits: u32) -> Self { + CLRPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRPEND_A::VALUE3), - 1 => Val(CLRPEND_A::VALUE4), - i => Res(i), + 0 => Some(CLRPEND_A::VALUE3), + 1 => Some(CLRPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRPEND_A::VALUE3 + **self == CLRPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRPEND_A::VALUE4 + **self == CLRPEND_A::VALUE4 + } +} +impl core::ops::Deref for CLRPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRPEND`"] +#[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] pub struct CLRPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrpend(&mut self) -> CLRPEND_W { CLRPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-pending Register 2\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 [nvic_icpr2](index.html) module"] +pub struct NVIC_ICPR2_SPEC; +impl crate::RegisterSpec for NVIC_ICPR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icpr2::R](R) reader structure"] +impl crate::Readable for NVIC_ICPR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icpr2::W](W) writer structure"] +impl crate::Writable for NVIC_ICPR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICPR2 to value 0"] +impl crate::Resettable for NVIC_ICPR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_icpr3.rs b/src/ppb/nvic_icpr3.rs index 0490d9d3..4e9e27fc 100644 --- a/src/ppb/nvic_icpr3.rs +++ b/src/ppb/nvic_icpr3.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ICPR3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ICPR3"] -pub type W = crate::W; -#[doc = "Register NVIC_ICPR3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ICPR3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ICPR3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ICPR3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `CLRPEND`"] -pub type CLRPEND_R = crate::R; +#[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] +pub struct CLRPEND_R(crate::FieldReader); impl CLRPEND_R { + pub(crate) fn new(bits: u32) -> Self { + CLRPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLRPEND_A::VALUE3), - 1 => Val(CLRPEND_A::VALUE4), - i => Res(i), + 0 => Some(CLRPEND_A::VALUE3), + 1 => Some(CLRPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLRPEND_A::VALUE3 + **self == CLRPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLRPEND_A::VALUE4 + **self == CLRPEND_A::VALUE4 + } +} +impl core::ops::Deref for CLRPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLRPEND`"] +#[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] pub struct CLRPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> CLRPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn clrpend(&mut self) -> CLRPEND_W { CLRPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Clear-pending Register 3\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 [nvic_icpr3](index.html) module"] +pub struct NVIC_ICPR3_SPEC; +impl crate::RegisterSpec for NVIC_ICPR3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_icpr3::R](R) reader structure"] +impl crate::Readable for NVIC_ICPR3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_icpr3::W](W) writer structure"] +impl crate::Writable for NVIC_ICPR3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ICPR3 to value 0"] +impl crate::Resettable for NVIC_ICPR3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr0.rs b/src/ppb/nvic_ipr0.rs index 9a8e8144..9b5c927e 100644 --- a/src/ppb/nvic_ipr0.rs +++ b/src/ppb/nvic_ipr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR0"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 0\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 [nvic_ipr0](index.html) module"] +pub struct NVIC_IPR0_SPEC; +impl crate::RegisterSpec for NVIC_IPR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr0::R](R) reader structure"] +impl crate::Readable for NVIC_IPR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr0::W](W) writer structure"] +impl crate::Writable for NVIC_IPR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR0 to value 0"] +impl crate::Resettable for NVIC_IPR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr1.rs b/src/ppb/nvic_ipr1.rs index c2514ac4..9f783b8c 100644 --- a/src/ppb/nvic_ipr1.rs +++ b/src/ppb/nvic_ipr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR1"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 1\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 [nvic_ipr1](index.html) module"] +pub struct NVIC_IPR1_SPEC; +impl crate::RegisterSpec for NVIC_IPR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr1::R](R) reader structure"] +impl crate::Readable for NVIC_IPR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr1::W](W) writer structure"] +impl crate::Writable for NVIC_IPR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR1 to value 0"] +impl crate::Resettable for NVIC_IPR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr10.rs b/src/ppb/nvic_ipr10.rs index c9278ef5..1f70800e 100644 --- a/src/ppb/nvic_ipr10.rs +++ b/src/ppb/nvic_ipr10.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR10"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR10"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR10 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR10 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR10` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR10` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 10\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 [nvic_ipr10](index.html) module"] +pub struct NVIC_IPR10_SPEC; +impl crate::RegisterSpec for NVIC_IPR10_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr10::R](R) reader structure"] +impl crate::Readable for NVIC_IPR10_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr10::W](W) writer structure"] +impl crate::Writable for NVIC_IPR10_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR10 to value 0"] +impl crate::Resettable for NVIC_IPR10_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr11.rs b/src/ppb/nvic_ipr11.rs index 29aa8fbf..6298681d 100644 --- a/src/ppb/nvic_ipr11.rs +++ b/src/ppb/nvic_ipr11.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR11"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR11"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR11 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR11 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR11` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR11` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 11\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 [nvic_ipr11](index.html) module"] +pub struct NVIC_IPR11_SPEC; +impl crate::RegisterSpec for NVIC_IPR11_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr11::R](R) reader structure"] +impl crate::Readable for NVIC_IPR11_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr11::W](W) writer structure"] +impl crate::Writable for NVIC_IPR11_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR11 to value 0"] +impl crate::Resettable for NVIC_IPR11_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr12.rs b/src/ppb/nvic_ipr12.rs index 79cef119..bd8c8e06 100644 --- a/src/ppb/nvic_ipr12.rs +++ b/src/ppb/nvic_ipr12.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR12"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR12"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR12 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR12 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR12` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR12` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 12\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 [nvic_ipr12](index.html) module"] +pub struct NVIC_IPR12_SPEC; +impl crate::RegisterSpec for NVIC_IPR12_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr12::R](R) reader structure"] +impl crate::Readable for NVIC_IPR12_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr12::W](W) writer structure"] +impl crate::Writable for NVIC_IPR12_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR12 to value 0"] +impl crate::Resettable for NVIC_IPR12_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr13.rs b/src/ppb/nvic_ipr13.rs index d524c591..f47c442e 100644 --- a/src/ppb/nvic_ipr13.rs +++ b/src/ppb/nvic_ipr13.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR13"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR13"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR13 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR13 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR13` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR13` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 13\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 [nvic_ipr13](index.html) module"] +pub struct NVIC_IPR13_SPEC; +impl crate::RegisterSpec for NVIC_IPR13_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr13::R](R) reader structure"] +impl crate::Readable for NVIC_IPR13_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr13::W](W) writer structure"] +impl crate::Writable for NVIC_IPR13_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR13 to value 0"] +impl crate::Resettable for NVIC_IPR13_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr14.rs b/src/ppb/nvic_ipr14.rs index 2c5f1127..501ef6c8 100644 --- a/src/ppb/nvic_ipr14.rs +++ b/src/ppb/nvic_ipr14.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR14"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR14"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR14 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR14 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR14` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR14` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 14\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 [nvic_ipr14](index.html) module"] +pub struct NVIC_IPR14_SPEC; +impl crate::RegisterSpec for NVIC_IPR14_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr14::R](R) reader structure"] +impl crate::Readable for NVIC_IPR14_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr14::W](W) writer structure"] +impl crate::Writable for NVIC_IPR14_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR14 to value 0"] +impl crate::Resettable for NVIC_IPR14_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr15.rs b/src/ppb/nvic_ipr15.rs index 449b6083..e2364699 100644 --- a/src/ppb/nvic_ipr15.rs +++ b/src/ppb/nvic_ipr15.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR15"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR15"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR15 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR15 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR15` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR15` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 15\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 [nvic_ipr15](index.html) module"] +pub struct NVIC_IPR15_SPEC; +impl crate::RegisterSpec for NVIC_IPR15_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr15::R](R) reader structure"] +impl crate::Readable for NVIC_IPR15_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr15::W](W) writer structure"] +impl crate::Writable for NVIC_IPR15_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR15 to value 0"] +impl crate::Resettable for NVIC_IPR15_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr16.rs b/src/ppb/nvic_ipr16.rs index f59a6193..d07601e6 100644 --- a/src/ppb/nvic_ipr16.rs +++ b/src/ppb/nvic_ipr16.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR16"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR16"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR16 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR16 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR16` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR16` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 16\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 [nvic_ipr16](index.html) module"] +pub struct NVIC_IPR16_SPEC; +impl crate::RegisterSpec for NVIC_IPR16_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr16::R](R) reader structure"] +impl crate::Readable for NVIC_IPR16_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr16::W](W) writer structure"] +impl crate::Writable for NVIC_IPR16_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR16 to value 0"] +impl crate::Resettable for NVIC_IPR16_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr17.rs b/src/ppb/nvic_ipr17.rs index 6b180069..84b55653 100644 --- a/src/ppb/nvic_ipr17.rs +++ b/src/ppb/nvic_ipr17.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR17"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR17"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR17 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR17 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR17` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR17` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 17\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 [nvic_ipr17](index.html) module"] +pub struct NVIC_IPR17_SPEC; +impl crate::RegisterSpec for NVIC_IPR17_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr17::R](R) reader structure"] +impl crate::Readable for NVIC_IPR17_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr17::W](W) writer structure"] +impl crate::Writable for NVIC_IPR17_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR17 to value 0"] +impl crate::Resettable for NVIC_IPR17_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr18.rs b/src/ppb/nvic_ipr18.rs index 3919dc6b..c311a0a7 100644 --- a/src/ppb/nvic_ipr18.rs +++ b/src/ppb/nvic_ipr18.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR18"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR18"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR18 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR18 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR18` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR18` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 18\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 [nvic_ipr18](index.html) module"] +pub struct NVIC_IPR18_SPEC; +impl crate::RegisterSpec for NVIC_IPR18_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr18::R](R) reader structure"] +impl crate::Readable for NVIC_IPR18_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr18::W](W) writer structure"] +impl crate::Writable for NVIC_IPR18_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR18 to value 0"] +impl crate::Resettable for NVIC_IPR18_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr19.rs b/src/ppb/nvic_ipr19.rs index c5a346be..e69a9e10 100644 --- a/src/ppb/nvic_ipr19.rs +++ b/src/ppb/nvic_ipr19.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR19"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR19"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR19 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR19 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR19` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR19` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 19\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 [nvic_ipr19](index.html) module"] +pub struct NVIC_IPR19_SPEC; +impl crate::RegisterSpec for NVIC_IPR19_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr19::R](R) reader structure"] +impl crate::Readable for NVIC_IPR19_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr19::W](W) writer structure"] +impl crate::Writable for NVIC_IPR19_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR19 to value 0"] +impl crate::Resettable for NVIC_IPR19_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr2.rs b/src/ppb/nvic_ipr2.rs index 21343f3d..d286b199 100644 --- a/src/ppb/nvic_ipr2.rs +++ b/src/ppb/nvic_ipr2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR2"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 2\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 [nvic_ipr2](index.html) module"] +pub struct NVIC_IPR2_SPEC; +impl crate::RegisterSpec for NVIC_IPR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr2::R](R) reader structure"] +impl crate::Readable for NVIC_IPR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr2::W](W) writer structure"] +impl crate::Writable for NVIC_IPR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR2 to value 0"] +impl crate::Resettable for NVIC_IPR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr20.rs b/src/ppb/nvic_ipr20.rs index f30297ff..034a7fa0 100644 --- a/src/ppb/nvic_ipr20.rs +++ b/src/ppb/nvic_ipr20.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR20"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR20"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR20 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR20 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR20` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR20` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 20\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 [nvic_ipr20](index.html) module"] +pub struct NVIC_IPR20_SPEC; +impl crate::RegisterSpec for NVIC_IPR20_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr20::R](R) reader structure"] +impl crate::Readable for NVIC_IPR20_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr20::W](W) writer structure"] +impl crate::Writable for NVIC_IPR20_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR20 to value 0"] +impl crate::Resettable for NVIC_IPR20_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr21.rs b/src/ppb/nvic_ipr21.rs index afc4b40d..fbb54cb8 100644 --- a/src/ppb/nvic_ipr21.rs +++ b/src/ppb/nvic_ipr21.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR21"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR21"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR21 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR21 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR21` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR21` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 21\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 [nvic_ipr21](index.html) module"] +pub struct NVIC_IPR21_SPEC; +impl crate::RegisterSpec for NVIC_IPR21_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr21::R](R) reader structure"] +impl crate::Readable for NVIC_IPR21_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr21::W](W) writer structure"] +impl crate::Writable for NVIC_IPR21_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR21 to value 0"] +impl crate::Resettable for NVIC_IPR21_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr22.rs b/src/ppb/nvic_ipr22.rs index 46d92e82..1d1b0198 100644 --- a/src/ppb/nvic_ipr22.rs +++ b/src/ppb/nvic_ipr22.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR22"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR22"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR22 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR22 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR22` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR22` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 22\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 [nvic_ipr22](index.html) module"] +pub struct NVIC_IPR22_SPEC; +impl crate::RegisterSpec for NVIC_IPR22_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr22::R](R) reader structure"] +impl crate::Readable for NVIC_IPR22_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr22::W](W) writer structure"] +impl crate::Writable for NVIC_IPR22_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR22 to value 0"] +impl crate::Resettable for NVIC_IPR22_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr23.rs b/src/ppb/nvic_ipr23.rs index 9d682ca2..05b923c8 100644 --- a/src/ppb/nvic_ipr23.rs +++ b/src/ppb/nvic_ipr23.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR23"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR23"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR23 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR23 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR23` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR23` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 23\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 [nvic_ipr23](index.html) module"] +pub struct NVIC_IPR23_SPEC; +impl crate::RegisterSpec for NVIC_IPR23_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr23::R](R) reader structure"] +impl crate::Readable for NVIC_IPR23_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr23::W](W) writer structure"] +impl crate::Writable for NVIC_IPR23_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR23 to value 0"] +impl crate::Resettable for NVIC_IPR23_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr24.rs b/src/ppb/nvic_ipr24.rs index c2d14f8b..33315c88 100644 --- a/src/ppb/nvic_ipr24.rs +++ b/src/ppb/nvic_ipr24.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR24"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR24"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR24 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR24 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR24` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR24` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 24\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 [nvic_ipr24](index.html) module"] +pub struct NVIC_IPR24_SPEC; +impl crate::RegisterSpec for NVIC_IPR24_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr24::R](R) reader structure"] +impl crate::Readable for NVIC_IPR24_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr24::W](W) writer structure"] +impl crate::Writable for NVIC_IPR24_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR24 to value 0"] +impl crate::Resettable for NVIC_IPR24_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr25.rs b/src/ppb/nvic_ipr25.rs index f11af7a6..df4d273f 100644 --- a/src/ppb/nvic_ipr25.rs +++ b/src/ppb/nvic_ipr25.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR25"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR25"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR25 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR25 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR25` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR25` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 25\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 [nvic_ipr25](index.html) module"] +pub struct NVIC_IPR25_SPEC; +impl crate::RegisterSpec for NVIC_IPR25_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr25::R](R) reader structure"] +impl crate::Readable for NVIC_IPR25_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr25::W](W) writer structure"] +impl crate::Writable for NVIC_IPR25_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR25 to value 0"] +impl crate::Resettable for NVIC_IPR25_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr26.rs b/src/ppb/nvic_ipr26.rs index 38a9630a..0e68295b 100644 --- a/src/ppb/nvic_ipr26.rs +++ b/src/ppb/nvic_ipr26.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR26"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR26"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR26 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR26 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR26` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR26` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 26\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 [nvic_ipr26](index.html) module"] +pub struct NVIC_IPR26_SPEC; +impl crate::RegisterSpec for NVIC_IPR26_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr26::R](R) reader structure"] +impl crate::Readable for NVIC_IPR26_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr26::W](W) writer structure"] +impl crate::Writable for NVIC_IPR26_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR26 to value 0"] +impl crate::Resettable for NVIC_IPR26_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr27.rs b/src/ppb/nvic_ipr27.rs index 3d805d5e..1d0a31df 100644 --- a/src/ppb/nvic_ipr27.rs +++ b/src/ppb/nvic_ipr27.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR27"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR27"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR27 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR27 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR27` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR27` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 27\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 [nvic_ipr27](index.html) module"] +pub struct NVIC_IPR27_SPEC; +impl crate::RegisterSpec for NVIC_IPR27_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr27::R](R) reader structure"] +impl crate::Readable for NVIC_IPR27_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr27::W](W) writer structure"] +impl crate::Writable for NVIC_IPR27_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR27 to value 0"] +impl crate::Resettable for NVIC_IPR27_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr3.rs b/src/ppb/nvic_ipr3.rs index f7071c12..17b50b70 100644 --- a/src/ppb/nvic_ipr3.rs +++ b/src/ppb/nvic_ipr3.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR3"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 3\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 [nvic_ipr3](index.html) module"] +pub struct NVIC_IPR3_SPEC; +impl crate::RegisterSpec for NVIC_IPR3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr3::R](R) reader structure"] +impl crate::Readable for NVIC_IPR3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr3::W](W) writer structure"] +impl crate::Writable for NVIC_IPR3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR3 to value 0"] +impl crate::Resettable for NVIC_IPR3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr4.rs b/src/ppb/nvic_ipr4.rs index b8f54120..776904cb 100644 --- a/src/ppb/nvic_ipr4.rs +++ b/src/ppb/nvic_ipr4.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR4"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR4"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR4 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR4 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 4\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 [nvic_ipr4](index.html) module"] +pub struct NVIC_IPR4_SPEC; +impl crate::RegisterSpec for NVIC_IPR4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr4::R](R) reader structure"] +impl crate::Readable for NVIC_IPR4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr4::W](W) writer structure"] +impl crate::Writable for NVIC_IPR4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR4 to value 0"] +impl crate::Resettable for NVIC_IPR4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr5.rs b/src/ppb/nvic_ipr5.rs index 843d077e..f08782cd 100644 --- a/src/ppb/nvic_ipr5.rs +++ b/src/ppb/nvic_ipr5.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR5"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR5"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR5 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR5 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR5` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 5\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 [nvic_ipr5](index.html) module"] +pub struct NVIC_IPR5_SPEC; +impl crate::RegisterSpec for NVIC_IPR5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr5::R](R) reader structure"] +impl crate::Readable for NVIC_IPR5_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr5::W](W) writer structure"] +impl crate::Writable for NVIC_IPR5_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR5 to value 0"] +impl crate::Resettable for NVIC_IPR5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr6.rs b/src/ppb/nvic_ipr6.rs index 7825578d..14a1ed62 100644 --- a/src/ppb/nvic_ipr6.rs +++ b/src/ppb/nvic_ipr6.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR6"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR6"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR6 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR6 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR6` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR6` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 6\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 [nvic_ipr6](index.html) module"] +pub struct NVIC_IPR6_SPEC; +impl crate::RegisterSpec for NVIC_IPR6_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr6::R](R) reader structure"] +impl crate::Readable for NVIC_IPR6_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr6::W](W) writer structure"] +impl crate::Writable for NVIC_IPR6_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR6 to value 0"] +impl crate::Resettable for NVIC_IPR6_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr7.rs b/src/ppb/nvic_ipr7.rs index 5011e873..0db01dda 100644 --- a/src/ppb/nvic_ipr7.rs +++ b/src/ppb/nvic_ipr7.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR7"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR7"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR7 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR7 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR7` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR7` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 7\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 [nvic_ipr7](index.html) module"] +pub struct NVIC_IPR7_SPEC; +impl crate::RegisterSpec for NVIC_IPR7_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr7::R](R) reader structure"] +impl crate::Readable for NVIC_IPR7_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr7::W](W) writer structure"] +impl crate::Writable for NVIC_IPR7_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR7 to value 0"] +impl crate::Resettable for NVIC_IPR7_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr8.rs b/src/ppb/nvic_ipr8.rs index be477308..e85648ea 100644 --- a/src/ppb/nvic_ipr8.rs +++ b/src/ppb/nvic_ipr8.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR8"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR8"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR8 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR8 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR8` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR8` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 8\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 [nvic_ipr8](index.html) module"] +pub struct NVIC_IPR8_SPEC; +impl crate::RegisterSpec for NVIC_IPR8_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr8::R](R) reader structure"] +impl crate::Readable for NVIC_IPR8_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr8::W](W) writer structure"] +impl crate::Writable for NVIC_IPR8_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR8 to value 0"] +impl crate::Resettable for NVIC_IPR8_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ipr9.rs b/src/ppb/nvic_ipr9.rs index fde221f7..7d6f637a 100644 --- a/src/ppb/nvic_ipr9.rs +++ b/src/ppb/nvic_ipr9.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register NVIC_IPR9"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_IPR9"] -pub type W = crate::W; -#[doc = "Register NVIC_IPR9 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_IPR9 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_IPR9` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_IPR9` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `PRI_0`"] -pub type PRI_0_R = crate::R; -#[doc = "Write proxy for field `PRI_0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_0` reader - Priority value 0"] +pub struct PRI_0_R(crate::FieldReader); +impl PRI_0_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_0` writer - Priority value 0"] pub struct PRI_0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_1`"] -pub type PRI_1_R = crate::R; -#[doc = "Write proxy for field `PRI_1`"] +#[doc = "Field `PRI_1` reader - Priority value 1"] +pub struct PRI_1_R(crate::FieldReader); +impl PRI_1_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_1` writer - Priority value 1"] pub struct PRI_1_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_2`"] -pub type PRI_2_R = crate::R; -#[doc = "Write proxy for field `PRI_2`"] +#[doc = "Field `PRI_2` reader - Priority value 2"] +pub struct PRI_2_R(crate::FieldReader); +impl PRI_2_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_2` writer - Priority value 2"] pub struct PRI_2_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_3`"] -pub type PRI_3_R = crate::R; -#[doc = "Write proxy for field `PRI_3`"] +#[doc = "Field `PRI_3` reader - Priority value 3"] +pub struct PRI_3_R(crate::FieldReader); +impl PRI_3_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_3` writer - Priority value 3"] pub struct PRI_3_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Priority Register 9\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 [nvic_ipr9](index.html) module"] +pub struct NVIC_IPR9_SPEC; +impl crate::RegisterSpec for NVIC_IPR9_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ipr9::R](R) reader structure"] +impl crate::Readable for NVIC_IPR9_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ipr9::W](W) writer structure"] +impl crate::Writable for NVIC_IPR9_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_IPR9 to value 0"] +impl crate::Resettable for NVIC_IPR9_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iser0.rs b/src/ppb/nvic_iser0.rs index 7b312868..c6443727 100644 --- a/src/ppb/nvic_iser0.rs +++ b/src/ppb/nvic_iser0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISER0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISER0"] -pub type W = crate::W; -#[doc = "Register NVIC_ISER0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISER0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISER0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISER0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETENA`"] -pub type SETENA_R = crate::R; +#[doc = "Field `SETENA` reader - Interrupt set-enable bits"] +pub struct SETENA_R(crate::FieldReader); impl SETENA_R { + pub(crate) fn new(bits: u32) -> Self { + SETENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETENA_A::VALUE3), - 1 => Val(SETENA_A::VALUE4), - i => Res(i), + 0 => Some(SETENA_A::VALUE3), + 1 => Some(SETENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETENA_A::VALUE3 + **self == SETENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETENA_A::VALUE4 + **self == SETENA_A::VALUE4 + } +} +impl core::ops::Deref for SETENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETENA`"] +#[doc = "Field `SETENA` writer - Interrupt set-enable bits"] pub struct SETENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setena(&mut self) -> SETENA_W { SETENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-enable Register 0\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 [nvic_iser0](index.html) module"] +pub struct NVIC_ISER0_SPEC; +impl crate::RegisterSpec for NVIC_ISER0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iser0::R](R) reader structure"] +impl crate::Readable for NVIC_ISER0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iser0::W](W) writer structure"] +impl crate::Writable for NVIC_ISER0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISER0 to value 0"] +impl crate::Resettable for NVIC_ISER0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iser1.rs b/src/ppb/nvic_iser1.rs index f0d255f7..db1c30cf 100644 --- a/src/ppb/nvic_iser1.rs +++ b/src/ppb/nvic_iser1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISER1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISER1"] -pub type W = crate::W; -#[doc = "Register NVIC_ISER1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISER1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISER1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISER1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETENA`"] -pub type SETENA_R = crate::R; +#[doc = "Field `SETENA` reader - Interrupt set-enable bits"] +pub struct SETENA_R(crate::FieldReader); impl SETENA_R { + pub(crate) fn new(bits: u32) -> Self { + SETENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETENA_A::VALUE3), - 1 => Val(SETENA_A::VALUE4), - i => Res(i), + 0 => Some(SETENA_A::VALUE3), + 1 => Some(SETENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETENA_A::VALUE3 + **self == SETENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETENA_A::VALUE4 + **self == SETENA_A::VALUE4 + } +} +impl core::ops::Deref for SETENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETENA`"] +#[doc = "Field `SETENA` writer - Interrupt set-enable bits"] pub struct SETENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setena(&mut self) -> SETENA_W { SETENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-enable Register 1\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 [nvic_iser1](index.html) module"] +pub struct NVIC_ISER1_SPEC; +impl crate::RegisterSpec for NVIC_ISER1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iser1::R](R) reader structure"] +impl crate::Readable for NVIC_ISER1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iser1::W](W) writer structure"] +impl crate::Writable for NVIC_ISER1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISER1 to value 0"] +impl crate::Resettable for NVIC_ISER1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iser2.rs b/src/ppb/nvic_iser2.rs index 376eb329..79778750 100644 --- a/src/ppb/nvic_iser2.rs +++ b/src/ppb/nvic_iser2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISER2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISER2"] -pub type W = crate::W; -#[doc = "Register NVIC_ISER2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISER2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISER2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISER2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETENA`"] -pub type SETENA_R = crate::R; +#[doc = "Field `SETENA` reader - Interrupt set-enable bits"] +pub struct SETENA_R(crate::FieldReader); impl SETENA_R { + pub(crate) fn new(bits: u32) -> Self { + SETENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETENA_A::VALUE3), - 1 => Val(SETENA_A::VALUE4), - i => Res(i), + 0 => Some(SETENA_A::VALUE3), + 1 => Some(SETENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETENA_A::VALUE3 + **self == SETENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETENA_A::VALUE4 + **self == SETENA_A::VALUE4 + } +} +impl core::ops::Deref for SETENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETENA`"] +#[doc = "Field `SETENA` writer - Interrupt set-enable bits"] pub struct SETENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setena(&mut self) -> SETENA_W { SETENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-enable Register 2\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 [nvic_iser2](index.html) module"] +pub struct NVIC_ISER2_SPEC; +impl crate::RegisterSpec for NVIC_ISER2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iser2::R](R) reader structure"] +impl crate::Readable for NVIC_ISER2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iser2::W](W) writer structure"] +impl crate::Writable for NVIC_ISER2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISER2 to value 0"] +impl crate::Resettable for NVIC_ISER2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_iser3.rs b/src/ppb/nvic_iser3.rs index 0a9bb5b9..8db51d20 100644 --- a/src/ppb/nvic_iser3.rs +++ b/src/ppb/nvic_iser3.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISER3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISER3"] -pub type W = crate::W; -#[doc = "Register NVIC_ISER3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISER3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISER3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISER3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETENA`"] -pub type SETENA_R = crate::R; +#[doc = "Field `SETENA` reader - Interrupt set-enable bits"] +pub struct SETENA_R(crate::FieldReader); impl SETENA_R { + pub(crate) fn new(bits: u32) -> Self { + SETENA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETENA_A::VALUE3), - 1 => Val(SETENA_A::VALUE4), - i => Res(i), + 0 => Some(SETENA_A::VALUE3), + 1 => Some(SETENA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETENA_A::VALUE3 + **self == SETENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETENA_A::VALUE4 + **self == SETENA_A::VALUE4 + } +} +impl core::ops::Deref for SETENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETENA`"] +#[doc = "Field `SETENA` writer - Interrupt set-enable bits"] pub struct SETENA_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setena(&mut self) -> SETENA_W { SETENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-enable Register 3\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 [nvic_iser3](index.html) module"] +pub struct NVIC_ISER3_SPEC; +impl crate::RegisterSpec for NVIC_ISER3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_iser3::R](R) reader structure"] +impl crate::Readable for NVIC_ISER3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_iser3::W](W) writer structure"] +impl crate::Writable for NVIC_ISER3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISER3 to value 0"] +impl crate::Resettable for NVIC_ISER3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ispr0.rs b/src/ppb/nvic_ispr0.rs index be03e6aa..f0f0c4e0 100644 --- a/src/ppb/nvic_ispr0.rs +++ b/src/ppb/nvic_ispr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISPR0"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISPR0"] -pub type W = crate::W; -#[doc = "Register NVIC_ISPR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISPR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISPR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISPR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETPEND`"] -pub type SETPEND_R = crate::R; +#[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] +pub struct SETPEND_R(crate::FieldReader); impl SETPEND_R { + pub(crate) fn new(bits: u32) -> Self { + SETPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETPEND_A::VALUE3), - 1 => Val(SETPEND_A::VALUE4), - i => Res(i), + 0 => Some(SETPEND_A::VALUE3), + 1 => Some(SETPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETPEND_A::VALUE3 + **self == SETPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETPEND_A::VALUE4 + **self == SETPEND_A::VALUE4 + } +} +impl core::ops::Deref for SETPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETPEND`"] +#[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] pub struct SETPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setpend(&mut self) -> SETPEND_W { SETPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-pending Register 0\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 [nvic_ispr0](index.html) module"] +pub struct NVIC_ISPR0_SPEC; +impl crate::RegisterSpec for NVIC_ISPR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ispr0::R](R) reader structure"] +impl crate::Readable for NVIC_ISPR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ispr0::W](W) writer structure"] +impl crate::Writable for NVIC_ISPR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISPR0 to value 0"] +impl crate::Resettable for NVIC_ISPR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ispr1.rs b/src/ppb/nvic_ispr1.rs index 744578e6..7d456996 100644 --- a/src/ppb/nvic_ispr1.rs +++ b/src/ppb/nvic_ispr1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISPR1"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISPR1"] -pub type W = crate::W; -#[doc = "Register NVIC_ISPR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISPR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISPR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISPR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETPEND`"] -pub type SETPEND_R = crate::R; +#[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] +pub struct SETPEND_R(crate::FieldReader); impl SETPEND_R { + pub(crate) fn new(bits: u32) -> Self { + SETPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETPEND_A::VALUE3), - 1 => Val(SETPEND_A::VALUE4), - i => Res(i), + 0 => Some(SETPEND_A::VALUE3), + 1 => Some(SETPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETPEND_A::VALUE3 + **self == SETPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETPEND_A::VALUE4 + **self == SETPEND_A::VALUE4 + } +} +impl core::ops::Deref for SETPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETPEND`"] +#[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] pub struct SETPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setpend(&mut self) -> SETPEND_W { SETPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-pending Register 1\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 [nvic_ispr1](index.html) module"] +pub struct NVIC_ISPR1_SPEC; +impl crate::RegisterSpec for NVIC_ISPR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ispr1::R](R) reader structure"] +impl crate::Readable for NVIC_ISPR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ispr1::W](W) writer structure"] +impl crate::Writable for NVIC_ISPR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISPR1 to value 0"] +impl crate::Resettable for NVIC_ISPR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ispr2.rs b/src/ppb/nvic_ispr2.rs index 424d26f2..c203b1d2 100644 --- a/src/ppb/nvic_ispr2.rs +++ b/src/ppb/nvic_ispr2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISPR2"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISPR2"] -pub type W = crate::W; -#[doc = "Register NVIC_ISPR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISPR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISPR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISPR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETPEND`"] -pub type SETPEND_R = crate::R; +#[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] +pub struct SETPEND_R(crate::FieldReader); impl SETPEND_R { + pub(crate) fn new(bits: u32) -> Self { + SETPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETPEND_A::VALUE3), - 1 => Val(SETPEND_A::VALUE4), - i => Res(i), + 0 => Some(SETPEND_A::VALUE3), + 1 => Some(SETPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETPEND_A::VALUE3 + **self == SETPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETPEND_A::VALUE4 + **self == SETPEND_A::VALUE4 + } +} +impl core::ops::Deref for SETPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETPEND`"] +#[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] pub struct SETPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setpend(&mut self) -> SETPEND_W { SETPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-pending Register 2\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 [nvic_ispr2](index.html) module"] +pub struct NVIC_ISPR2_SPEC; +impl crate::RegisterSpec for NVIC_ISPR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ispr2::R](R) reader structure"] +impl crate::Readable for NVIC_ISPR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ispr2::W](W) writer structure"] +impl crate::Writable for NVIC_ISPR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISPR2 to value 0"] +impl crate::Resettable for NVIC_ISPR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/nvic_ispr3.rs b/src/ppb/nvic_ispr3.rs index d671deff..8e280d1a 100644 --- a/src/ppb/nvic_ispr3.rs +++ b/src/ppb/nvic_ispr3.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NVIC_ISPR3"] -pub type R = crate::R; -#[doc = "Writer for register NVIC_ISPR3"] -pub type W = crate::W; -#[doc = "Register NVIC_ISPR3 `reset()`'s with value 0"] -impl crate::ResetValue for super::NVIC_ISPR3 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NVIC_ISPR3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NVIC_ISPR3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u32 { variant as _ } } -#[doc = "Reader of field `SETPEND`"] -pub type SETPEND_R = crate::R; +#[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] +pub struct SETPEND_R(crate::FieldReader); impl SETPEND_R { + pub(crate) fn new(bits: u32) -> Self { + SETPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SETPEND_A::VALUE3), - 1 => Val(SETPEND_A::VALUE4), - i => Res(i), + 0 => Some(SETPEND_A::VALUE3), + 1 => Some(SETPEND_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SETPEND_A::VALUE3 + **self == SETPEND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SETPEND_A::VALUE4 + **self == SETPEND_A::VALUE4 + } +} +impl core::ops::Deref for SETPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SETPEND`"] +#[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] pub struct SETPEND_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> SETPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -89,4 +122,30 @@ impl W { pub fn setpend(&mut self) -> SETPEND_W { SETPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Set-pending Register 3\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 [nvic_ispr3](index.html) module"] +pub struct NVIC_ISPR3_SPEC; +impl crate::RegisterSpec for NVIC_ISPR3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nvic_ispr3::R](R) reader structure"] +impl crate::Readable for NVIC_ISPR3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nvic_ispr3::W](W) writer structure"] +impl crate::Writable for NVIC_ISPR3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NVIC_ISPR3 to value 0"] +impl crate::Resettable for NVIC_ISPR3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/scr.rs b/src/ppb/scr.rs index a3da07d0..231c1dec 100644 --- a/src/ppb/scr.rs +++ b/src/ppb/scr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SCR"] -pub type R = crate::R; -#[doc = "Writer for register SCR"] -pub type W = crate::W; -#[doc = "Register SCR `reset()`'s with value 0"] -impl crate::ResetValue for super::SCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Sleep on Exit\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLEEPONEXIT`"] -pub type SLEEPONEXIT_R = crate::R; +#[doc = "Field `SLEEPONEXIT` reader - Sleep on Exit"] +pub struct SLEEPONEXIT_R(crate::FieldReader); impl SLEEPONEXIT_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPONEXIT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLEEPONEXIT_A { @@ -38,15 +65,22 @@ impl SLEEPONEXIT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLEEPONEXIT_A::VALUE1 + **self == SLEEPONEXIT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLEEPONEXIT_A::VALUE2 + **self == SLEEPONEXIT_A::VALUE2 } } -#[doc = "Write proxy for field `SLEEPONEXIT`"] +impl core::ops::Deref for SLEEPONEXIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLEEPONEXIT` writer - Sleep on Exit"] pub struct SLEEPONEXIT_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SLEEPONEXIT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLEEPONEXIT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "do not sleep when returning to Thread mode."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SLEEPONEXIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLEEPDEEP`"] -pub type SLEEPDEEP_R = crate::R; +#[doc = "Field `SLEEPDEEP` reader - Sleep or Deep Sleep"] +pub struct SLEEPDEEP_R(crate::FieldReader); impl SLEEPDEEP_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPDEEP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLEEPDEEP_A { @@ -113,15 +148,22 @@ impl SLEEPDEEP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLEEPDEEP_A::VALUE1 + **self == SLEEPDEEP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLEEPDEEP_A::VALUE2 + **self == SLEEPDEEP_A::VALUE2 } } -#[doc = "Write proxy for field `SLEEPDEEP`"] +impl core::ops::Deref for SLEEPDEEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLEEPDEEP` writer - Sleep or Deep Sleep"] pub struct SLEEPDEEP_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SLEEPDEEP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLEEPDEEP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "sleep"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SLEEPDEEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SEVONPEND`"] -pub type SEVONPEND_R = crate::R; +#[doc = "Field `SEVONPEND` reader - Send Event on Pending bit:"] +pub struct SEVONPEND_R(crate::FieldReader); impl SEVONPEND_R { + pub(crate) fn new(bits: bool) -> Self { + SEVONPEND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SEVONPEND_A { @@ -188,15 +231,22 @@ impl SEVONPEND_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEVONPEND_A::VALUE1 + **self == SEVONPEND_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEVONPEND_A::VALUE2 + **self == SEVONPEND_A::VALUE2 } } -#[doc = "Write proxy for field `SEVONPEND`"] +impl core::ops::Deref for SEVONPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEVONPEND` writer - Send Event on Pending bit:"] pub struct SEVONPEND_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> SEVONPEND_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEVONPEND_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "only enabled interrupts or events can wakeup the processor, disabled interrupts are excluded"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> SEVONPEND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -268,4 +316,30 @@ impl W { pub fn sevonpend(&mut self) -> SEVONPEND_W { SEVONPEND_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Control Register\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 [scr](index.html) module"] +pub struct SCR_SPEC; +impl crate::RegisterSpec for SCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scr::R](R) reader structure"] +impl crate::Readable for SCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scr::W](W) writer structure"] +impl crate::Writable for SCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCR to value 0"] +impl crate::Resettable for SCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/shcsr.rs b/src/ppb/shcsr.rs index 06bf520b..092b195f 100644 --- a/src/ppb/shcsr.rs +++ b/src/ppb/shcsr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SHCSR"] -pub type R = crate::R; -#[doc = "Writer for register SHCSR"] -pub type W = crate::W; -#[doc = "Register SHCSR `reset()`'s with value 0"] -impl crate::ResetValue for super::SHCSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SHCSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHCSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MEMFAULTACT` reader - MemManage exception active bit"] +pub struct MEMFAULTACT_R(crate::FieldReader); +impl MEMFAULTACT_R { + pub(crate) fn new(bits: bool) -> Self { + MEMFAULTACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MEMFAULTACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MEMFAULTACT`"] -pub type MEMFAULTACT_R = crate::R; -#[doc = "Write proxy for field `MEMFAULTACT`"] +#[doc = "Field `MEMFAULTACT` writer - MemManage exception active bit"] pub struct MEMFAULTACT_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> MEMFAULTACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `BUSFAULTACT`"] -pub type BUSFAULTACT_R = crate::R; -#[doc = "Write proxy for field `BUSFAULTACT`"] +#[doc = "Field `BUSFAULTACT` reader - BusFault exception active bit"] +pub struct BUSFAULTACT_R(crate::FieldReader); +impl BUSFAULTACT_R { + pub(crate) fn new(bits: bool) -> Self { + BUSFAULTACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BUSFAULTACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BUSFAULTACT` writer - BusFault exception active bit"] pub struct BUSFAULTACT_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> BUSFAULTACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `USGFAULTACT`"] -pub type USGFAULTACT_R = crate::R; -#[doc = "Write proxy for field `USGFAULTACT`"] +#[doc = "Field `USGFAULTACT` reader - UsageFault exception active bit"] +pub struct USGFAULTACT_R(crate::FieldReader); +impl USGFAULTACT_R { + pub(crate) fn new(bits: bool) -> Self { + USGFAULTACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USGFAULTACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USGFAULTACT` writer - UsageFault exception active bit"] pub struct USGFAULTACT_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> USGFAULTACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `SVCALLACT`"] -pub type SVCALLACT_R = crate::R; -#[doc = "Write proxy for field `SVCALLACT`"] +#[doc = "Field `SVCALLACT` reader - SVCall active bit"] +pub struct SVCALLACT_R(crate::FieldReader); +impl SVCALLACT_R { + pub(crate) fn new(bits: bool) -> Self { + SVCALLACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SVCALLACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SVCALLACT` writer - SVCall active bit"] pub struct SVCALLACT_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> SVCALLACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `MONITORACT`"] -pub type MONITORACT_R = crate::R; -#[doc = "Write proxy for field `MONITORACT`"] +#[doc = "Field `MONITORACT` reader - Debug monitor active bit"] +pub struct MONITORACT_R(crate::FieldReader); +impl MONITORACT_R { + pub(crate) fn new(bits: bool) -> Self { + MONITORACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MONITORACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MONITORACT` writer - Debug monitor active bit"] pub struct MONITORACT_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> MONITORACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `PENDSVACT`"] -pub type PENDSVACT_R = crate::R; -#[doc = "Write proxy for field `PENDSVACT`"] +#[doc = "Field `PENDSVACT` reader - PendSV exception active bit"] +pub struct PENDSVACT_R(crate::FieldReader); +impl PENDSVACT_R { + pub(crate) fn new(bits: bool) -> Self { + PENDSVACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PENDSVACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PENDSVACT` writer - PendSV exception active bit"] pub struct PENDSVACT_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> PENDSVACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Reader of field `SYSTICKACT`"] -pub type SYSTICKACT_R = crate::R; -#[doc = "Write proxy for field `SYSTICKACT`"] +#[doc = "Field `SYSTICKACT` reader - SysTick exception active bit"] +pub struct SYSTICKACT_R(crate::FieldReader); +impl SYSTICKACT_R { + pub(crate) fn new(bits: bool) -> Self { + SYSTICKACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SYSTICKACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SYSTICKACT` writer - SysTick exception active bit"] pub struct SYSTICKACT_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> SYSTICKACT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `USGFAULTPENDED`"] -pub type USGFAULTPENDED_R = crate::R; -#[doc = "Write proxy for field `USGFAULTPENDED`"] +#[doc = "Field `USGFAULTPENDED` reader - UsageFault exception pending bit"] +pub struct USGFAULTPENDED_R(crate::FieldReader); +impl USGFAULTPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + USGFAULTPENDED_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USGFAULTPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USGFAULTPENDED` writer - UsageFault exception pending bit"] pub struct USGFAULTPENDED_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> USGFAULTPENDED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `MEMFAULTPENDED`"] -pub type MEMFAULTPENDED_R = crate::R; -#[doc = "Write proxy for field `MEMFAULTPENDED`"] +#[doc = "Field `MEMFAULTPENDED` reader - MemManage exception pending bit"] +pub struct MEMFAULTPENDED_R(crate::FieldReader); +impl MEMFAULTPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + MEMFAULTPENDED_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MEMFAULTPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MEMFAULTPENDED` writer - MemManage exception pending bit"] pub struct MEMFAULTPENDED_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> MEMFAULTPENDED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `BUSFAULTPENDED`"] -pub type BUSFAULTPENDED_R = crate::R; -#[doc = "Write proxy for field `BUSFAULTPENDED`"] +#[doc = "Field `BUSFAULTPENDED` reader - BusFault exception pending bit"] +pub struct BUSFAULTPENDED_R(crate::FieldReader); +impl BUSFAULTPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + BUSFAULTPENDED_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BUSFAULTPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BUSFAULTPENDED` writer - BusFault exception pending bit"] pub struct BUSFAULTPENDED_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> BUSFAULTPENDED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `SVCALLPENDED`"] -pub type SVCALLPENDED_R = crate::R; -#[doc = "Write proxy for field `SVCALLPENDED`"] +#[doc = "Field `SVCALLPENDED` reader - SVCall pending bit"] +pub struct SVCALLPENDED_R(crate::FieldReader); +impl SVCALLPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SVCALLPENDED_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SVCALLPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SVCALLPENDED` writer - SVCall pending bit"] pub struct SVCALLPENDED_W<'a> { w: &'a mut W, } @@ -270,13 +426,25 @@ impl<'a> SVCALLPENDED_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `MEMFAULTENA`"] -pub type MEMFAULTENA_R = crate::R; -#[doc = "Write proxy for field `MEMFAULTENA`"] +#[doc = "Field `MEMFAULTENA` reader - MemManage enable bit"] +pub struct MEMFAULTENA_R(crate::FieldReader); +impl MEMFAULTENA_R { + pub(crate) fn new(bits: bool) -> Self { + MEMFAULTENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MEMFAULTENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MEMFAULTENA` writer - MemManage enable bit"] pub struct MEMFAULTENA_W<'a> { w: &'a mut W, } @@ -294,13 +462,25 @@ impl<'a> MEMFAULTENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `BUSFAULTENA`"] -pub type BUSFAULTENA_R = crate::R; -#[doc = "Write proxy for field `BUSFAULTENA`"] +#[doc = "Field `BUSFAULTENA` reader - BusFault enable bit"] +pub struct BUSFAULTENA_R(crate::FieldReader); +impl BUSFAULTENA_R { + pub(crate) fn new(bits: bool) -> Self { + BUSFAULTENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BUSFAULTENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BUSFAULTENA` writer - BusFault enable bit"] pub struct BUSFAULTENA_W<'a> { w: &'a mut W, } @@ -318,13 +498,25 @@ impl<'a> BUSFAULTENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `USGFAULTENA`"] -pub type USGFAULTENA_R = crate::R; -#[doc = "Write proxy for field `USGFAULTENA`"] +#[doc = "Field `USGFAULTENA` reader - UsageFault enable bit"] +pub struct USGFAULTENA_R(crate::FieldReader); +impl USGFAULTENA_R { + pub(crate) fn new(bits: bool) -> Self { + USGFAULTENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USGFAULTENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USGFAULTENA` writer - UsageFault enable bit"] pub struct USGFAULTENA_W<'a> { w: &'a mut W, } @@ -342,7 +534,7 @@ impl<'a> USGFAULTENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -489,4 +681,30 @@ impl W { pub fn usgfaultena(&mut self) -> USGFAULTENA_W { USGFAULTENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Handler Control and State Register\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 [shcsr](index.html) module"] +pub struct SHCSR_SPEC; +impl crate::RegisterSpec for SHCSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shcsr::R](R) reader structure"] +impl crate::Readable for SHCSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shcsr::W](W) writer structure"] +impl crate::Writable for SHCSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHCSR to value 0"] +impl crate::Resettable for SHCSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/shpr1.rs b/src/ppb/shpr1.rs index b0813cfe..9717ab82 100644 --- a/src/ppb/shpr1.rs +++ b/src/ppb/shpr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SHPR1"] -pub type R = crate::R; -#[doc = "Writer for register SHPR1"] -pub type W = crate::W; -#[doc = "Register SHPR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::SHPR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SHPR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHPR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_4` reader - Priority of system handler 4, MemManage"] +pub struct PRI_4_R(crate::FieldReader); +impl PRI_4_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PRI_4`"] -pub type PRI_4_R = crate::R; -#[doc = "Write proxy for field `PRI_4`"] +#[doc = "Field `PRI_4` writer - Priority of system handler 4, MemManage"] pub struct PRI_4_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `PRI_5`"] -pub type PRI_5_R = crate::R; -#[doc = "Write proxy for field `PRI_5`"] +#[doc = "Field `PRI_5` reader - Priority of system handler 5, BusFault"] +pub struct PRI_5_R(crate::FieldReader); +impl PRI_5_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_5` writer - Priority of system handler 5, BusFault"] pub struct PRI_5_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> PRI_5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `PRI_6`"] -pub type PRI_6_R = crate::R; -#[doc = "Write proxy for field `PRI_6`"] +#[doc = "Field `PRI_6` reader - Priority of system handler 6, UsageFault"] +pub struct PRI_6_R(crate::FieldReader); +impl PRI_6_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_6` writer - Priority of system handler 6, UsageFault"] pub struct PRI_6_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> PRI_6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } @@ -85,4 +145,30 @@ impl W { pub fn pri_6(&mut self) -> PRI_6_W { PRI_6_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Handler Priority Register 1\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 [shpr1](index.html) module"] +pub struct SHPR1_SPEC; +impl crate::RegisterSpec for SHPR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shpr1::R](R) reader structure"] +impl crate::Readable for SHPR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shpr1::W](W) writer structure"] +impl crate::Writable for SHPR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHPR1 to value 0"] +impl crate::Resettable for SHPR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/shpr2.rs b/src/ppb/shpr2.rs index a570f6c0..41392c5f 100644 --- a/src/ppb/shpr2.rs +++ b/src/ppb/shpr2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SHPR2"] -pub type R = crate::R; -#[doc = "Writer for register SHPR2"] -pub type W = crate::W; -#[doc = "Register SHPR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::SHPR2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SHPR2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHPR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `PRI_11`"] -pub type PRI_11_R = crate::R; -#[doc = "Write proxy for field `PRI_11`"] +#[doc = "Field `PRI_11` reader - Priority of system handler 11, SVCall"] +pub struct PRI_11_R(crate::FieldReader); +impl PRI_11_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_11` writer - Priority of system handler 11, SVCall"] pub struct PRI_11_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> PRI_11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn pri_11(&mut self) -> PRI_11_W { PRI_11_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Handler Priority Register 2\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 [shpr2](index.html) module"] +pub struct SHPR2_SPEC; +impl crate::RegisterSpec for SHPR2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shpr2::R](R) reader structure"] +impl crate::Readable for SHPR2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shpr2::W](W) writer structure"] +impl crate::Writable for SHPR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHPR2 to value 0"] +impl crate::Resettable for SHPR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/shpr3.rs b/src/ppb/shpr3.rs index aa843209..3a0dcf18 100644 --- a/src/ppb/shpr3.rs +++ b/src/ppb/shpr3.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SHPR3"] -pub type R = crate::R; -#[doc = "Writer for register SHPR3"] -pub type W = crate::W; -#[doc = "Register SHPR3 `reset()`'s with value 0"] -impl crate::ResetValue for super::SHPR3 { - type Type = u32; +#[doc = "Register `SHPR3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHPR3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRI_14` reader - Priority of system handler 14"] +pub struct PRI_14_R(crate::FieldReader); +impl PRI_14_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PRI_14`"] -pub type PRI_14_R = crate::R; -#[doc = "Write proxy for field `PRI_14`"] +#[doc = "Field `PRI_14` writer - Priority of system handler 14"] pub struct PRI_14_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> PRI_14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } -#[doc = "Reader of field `PRI_15`"] -pub type PRI_15_R = crate::R; -#[doc = "Write proxy for field `PRI_15`"] +#[doc = "Field `PRI_15` reader - Priority of system handler 15"] +pub struct PRI_15_R(crate::FieldReader); +impl PRI_15_R { + pub(crate) fn new(bits: u8) -> Self { + PRI_15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRI_15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRI_15` writer - Priority of system handler 15"] pub struct PRI_15_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PRI_15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn pri_15(&mut self) -> PRI_15_W { PRI_15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Handler Priority Register 3\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 [shpr3](index.html) module"] +pub struct SHPR3_SPEC; +impl crate::RegisterSpec for SHPR3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shpr3::R](R) reader structure"] +impl crate::Readable for SHPR3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shpr3::W](W) writer structure"] +impl crate::Writable for SHPR3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHPR3 to value 0"] +impl crate::Resettable for SHPR3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/stir.rs b/src/ppb/stir.rs index 9649ac95..a870ea1f 100644 --- a/src/ppb/stir.rs +++ b/src/ppb/stir.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register STIR"] -pub type W = crate::W; -#[doc = "Register STIR `reset()`'s with value 0"] -impl crate::ResetValue for super::STIR { - type Type = u32; +#[doc = "Register `STIR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `INTID`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INTID` writer - Interrupt ID of the interrupt to trigger"] pub struct INTID_W<'a> { w: &'a mut W, } @@ -16,7 +27,7 @@ impl<'a> INTID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01ff) | ((value as u32) & 0x01ff); + self.w.bits = (self.w.bits & !0x01ff) | (value as u32 & 0x01ff); self.w } } @@ -26,4 +37,26 @@ impl W { pub fn intid(&mut self) -> INTID_W { INTID_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Software Trigger Interrupt Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stir](index.html) module"] +pub struct STIR_SPEC; +impl crate::RegisterSpec for STIR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [stir::W](W) writer structure"] +impl crate::Writable for STIR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STIR to value 0"] +impl crate::Resettable for STIR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/syst_calib.rs b/src/ppb/syst_calib.rs index a284f338..a49c7a09 100644 --- a/src/ppb/syst_calib.rs +++ b/src/ppb/syst_calib.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SYST_CALIB"] -pub type R = crate::R; -#[doc = "Writer for register SYST_CALIB"] -pub type W = crate::W; -#[doc = "Register SYST_CALIB `reset()`'s with value 0xc000_0000"] -impl crate::ResetValue for super::SYST_CALIB { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0xc000_0000 +#[doc = "Register `SYST_CALIB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SYST_CALIB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TENMS` reader - Ten Milliseconds Reload Value"] +pub struct TENMS_R(crate::FieldReader); +impl TENMS_R { + pub(crate) fn new(bits: u32) -> Self { + TENMS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TENMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `TENMS`"] -pub type TENMS_R = crate::R; -#[doc = "Write proxy for field `TENMS`"] +#[doc = "Field `TENMS` writer - Ten Milliseconds Reload Value"] pub struct TENMS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> TENMS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff); + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SKEW`"] -pub type SKEW_R = crate::R; +#[doc = "Field `SKEW` reader - Ten Milliseconds Skewed"] +pub struct SKEW_R(crate::FieldReader); impl SKEW_R { + pub(crate) fn new(bits: bool) -> Self { + SKEW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SKEW_A { @@ -52,15 +91,22 @@ impl SKEW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SKEW_A::VALUE1 + **self == SKEW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SKEW_A::VALUE2 + **self == SKEW_A::VALUE2 } } -#[doc = "Write proxy for field `SKEW`"] +impl core::ops::Deref for SKEW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SKEW` writer - Ten Milliseconds Skewed"] pub struct SKEW_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> SKEW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SKEW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "TENMS value is exact"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> SKEW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -113,9 +157,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NOREF`"] -pub type NOREF_R = crate::R; +#[doc = "Field `NOREF` reader - No Reference Clock"] +pub struct NOREF_R(crate::FieldReader); impl NOREF_R { + pub(crate) fn new(bits: bool) -> Self { + NOREF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NOREF_A { @@ -127,15 +174,22 @@ impl NOREF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NOREF_A::VALUE1 + **self == NOREF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NOREF_A::VALUE2 + **self == NOREF_A::VALUE2 } } -#[doc = "Write proxy for field `NOREF`"] +impl core::ops::Deref for NOREF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NOREF` writer - No Reference Clock"] pub struct NOREF_W<'a> { w: &'a mut W, } @@ -143,9 +197,7 @@ impl<'a> NOREF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NOREF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "reference clock provided"] #[inline(always)] @@ -170,7 +222,7 @@ impl<'a> NOREF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -207,4 +259,30 @@ impl W { pub fn noref(&mut self) -> NOREF_W { NOREF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SysTick Calibration Value Register r\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 [syst_calib](index.html) module"] +pub struct SYST_CALIB_SPEC; +impl crate::RegisterSpec for SYST_CALIB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [syst_calib::R](R) reader structure"] +impl crate::Readable for SYST_CALIB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [syst_calib::W](W) writer structure"] +impl crate::Writable for SYST_CALIB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYST_CALIB to value 0xc000_0000"] +impl crate::Resettable for SYST_CALIB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xc000_0000 + } } diff --git a/src/ppb/syst_csr.rs b/src/ppb/syst_csr.rs index 9e25ebe6..d98ef028 100644 --- a/src/ppb/syst_csr.rs +++ b/src/ppb/syst_csr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SYST_CSR"] -pub type R = crate::R; -#[doc = "Writer for register SYST_CSR"] -pub type W = crate::W; -#[doc = "Register SYST_CSR `reset()`'s with value 0x04"] -impl crate::ResetValue for super::SYST_CSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x04 +#[doc = "Register `SYST_CSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SYST_CSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENABLE`"] -pub type ENABLE_R = crate::R; +#[doc = "Field `ENABLE` reader - Enable"] +pub struct ENABLE_R(crate::FieldReader); impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENABLE_A { @@ -38,15 +65,22 @@ impl ENABLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENABLE_A::VALUE1 + **self == ENABLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENABLE_A::VALUE2 + **self == ENABLE_A::VALUE2 } } -#[doc = "Write proxy for field `ENABLE`"] +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable"] pub struct ENABLE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENABLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "counter disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ENABLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TICKINT`"] -pub type TICKINT_R = crate::R; +#[doc = "Field `TICKINT` reader - Tick Interrupt Enable"] +pub struct TICKINT_R(crate::FieldReader); impl TICKINT_R { + pub(crate) fn new(bits: bool) -> Self { + TICKINT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TICKINT_A { @@ -113,15 +148,22 @@ impl TICKINT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TICKINT_A::VALUE1 + **self == TICKINT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TICKINT_A::VALUE2 + **self == TICKINT_A::VALUE2 } } -#[doc = "Write proxy for field `TICKINT`"] +impl core::ops::Deref for TICKINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TICKINT` writer - Tick Interrupt Enable"] pub struct TICKINT_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> TICKINT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TICKINT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "counting down to zero does not assert the SysTick exception request"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> TICKINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CLKSOURCE`"] -pub type CLKSOURCE_R = crate::R; +#[doc = "Field `CLKSOURCE` reader - Indicates the clock source:"] +pub struct CLKSOURCE_R(crate::FieldReader); impl CLKSOURCE_R { + pub(crate) fn new(bits: bool) -> Self { + CLKSOURCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CLKSOURCE_A { @@ -188,15 +231,22 @@ impl CLKSOURCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CLKSOURCE_A::VALUE1 + **self == CLKSOURCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CLKSOURCE_A::VALUE2 + **self == CLKSOURCE_A::VALUE2 + } +} +impl core::ops::Deref for CLKSOURCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLKSOURCE`"] +#[doc = "Field `CLKSOURCE` writer - Indicates the clock source:"] pub struct CLKSOURCE_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CLKSOURCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLKSOURCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "external clock"] #[inline(always)] @@ -231,13 +279,25 @@ impl<'a> CLKSOURCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `COUNTFLAG`"] -pub type COUNTFLAG_R = crate::R; -#[doc = "Write proxy for field `COUNTFLAG`"] +#[doc = "Field `COUNTFLAG` reader - Counter Flag"] +pub struct COUNTFLAG_R(crate::FieldReader); +impl COUNTFLAG_R { + pub(crate) fn new(bits: bool) -> Self { + COUNTFLAG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNTFLAG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNTFLAG` writer - Counter Flag"] pub struct COUNTFLAG_W<'a> { w: &'a mut W, } @@ -255,7 +315,7 @@ impl<'a> COUNTFLAG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -302,4 +362,30 @@ impl W { pub fn countflag(&mut self) -> COUNTFLAG_W { COUNTFLAG_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SysTick Control and Status Register\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 [syst_csr](index.html) module"] +pub struct SYST_CSR_SPEC; +impl crate::RegisterSpec for SYST_CSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [syst_csr::R](R) reader structure"] +impl crate::Readable for SYST_CSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [syst_csr::W](W) writer structure"] +impl crate::Writable for SYST_CSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYST_CSR to value 0x04"] +impl crate::Resettable for SYST_CSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } } diff --git a/src/ppb/syst_cvr.rs b/src/ppb/syst_cvr.rs index 6d19941f..2852a0ae 100644 --- a/src/ppb/syst_cvr.rs +++ b/src/ppb/syst_cvr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SYST_CVR"] -pub type R = crate::R; -#[doc = "Writer for register SYST_CVR"] -pub type W = crate::W; -#[doc = "Register SYST_CVR `reset()`'s with value 0"] -impl crate::ResetValue for super::SYST_CVR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SYST_CVR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SYST_CVR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CURRENT`"] -pub type CURRENT_R = crate::R; -#[doc = "Write proxy for field `CURRENT`"] +#[doc = "Field `CURRENT` reader - Current Value"] +pub struct CURRENT_R(crate::FieldReader); +impl CURRENT_R { + pub(crate) fn new(bits: u32) -> Self { + CURRENT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CURRENT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CURRENT` writer - Current Value"] pub struct CURRENT_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CURRENT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff); + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn current(&mut self) -> CURRENT_W { CURRENT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SysTick Current Value Register\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 [syst_cvr](index.html) module"] +pub struct SYST_CVR_SPEC; +impl crate::RegisterSpec for SYST_CVR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [syst_cvr::R](R) reader structure"] +impl crate::Readable for SYST_CVR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [syst_cvr::W](W) writer structure"] +impl crate::Writable for SYST_CVR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYST_CVR to value 0"] +impl crate::Resettable for SYST_CVR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/syst_rvr.rs b/src/ppb/syst_rvr.rs index 578e8e6f..0bc36a62 100644 --- a/src/ppb/syst_rvr.rs +++ b/src/ppb/syst_rvr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SYST_RVR"] -pub type R = crate::R; -#[doc = "Writer for register SYST_RVR"] -pub type W = crate::W; -#[doc = "Register SYST_RVR `reset()`'s with value 0"] -impl crate::ResetValue for super::SYST_RVR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SYST_RVR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SYST_RVR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `RELOAD`"] -pub type RELOAD_R = crate::R; -#[doc = "Write proxy for field `RELOAD`"] +#[doc = "Field `RELOAD` reader - Reload Value"] +pub struct RELOAD_R(crate::FieldReader); +impl RELOAD_R { + pub(crate) fn new(bits: u32) -> Self { + RELOAD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RELOAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RELOAD` writer - Reload Value"] pub struct RELOAD_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> RELOAD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff); + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn reload(&mut self) -> RELOAD_W { RELOAD_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SysTick Reload Value Register\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 [syst_rvr](index.html) module"] +pub struct SYST_RVR_SPEC; +impl crate::RegisterSpec for SYST_RVR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [syst_rvr::R](R) reader structure"] +impl crate::Readable for SYST_RVR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [syst_rvr::W](W) writer structure"] +impl crate::Writable for SYST_RVR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYST_RVR to value 0"] +impl crate::Resettable for SYST_RVR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/ppb/vtor.rs b/src/ppb/vtor.rs index 95b76910..4faec151 100644 --- a/src/ppb/vtor.rs +++ b/src/ppb/vtor.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register VTOR"] -pub type R = crate::R; -#[doc = "Writer for register VTOR"] -pub type W = crate::W; -#[doc = "Register VTOR `reset()`'s with value 0"] -impl crate::ResetValue for super::VTOR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `VTOR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `VTOR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `TBLOFF`"] -pub type TBLOFF_R = crate::R; -#[doc = "Write proxy for field `TBLOFF`"] +#[doc = "Field `TBLOFF` reader - Vector table base offset field"] +pub struct TBLOFF_R(crate::FieldReader); +impl TBLOFF_R { + pub(crate) fn new(bits: u32) -> Self { + TBLOFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TBLOFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBLOFF` writer - Vector table base offset field"] pub struct TBLOFF_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> TBLOFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x003f_ffff << 10)) | (((value as u32) & 0x003f_ffff) << 10); + self.w.bits = (self.w.bits & !(0x003f_ffff << 10)) | ((value as u32 & 0x003f_ffff) << 10); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn tbloff(&mut self) -> TBLOFF_W { TBLOFF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Vector Table Offset Register\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 [vtor](index.html) module"] +pub struct VTOR_SPEC; +impl crate::RegisterSpec for VTOR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [vtor::R](R) reader structure"] +impl crate::Readable for VTOR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [vtor::W](W) writer structure"] +impl crate::Writable for VTOR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets VTOR to value 0"] +impl crate::Resettable for VTOR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/pref.rs b/src/pref.rs index c89320c3..c9efea44 100644 --- a/src/pref.rs +++ b/src/pref.rs @@ -2,16 +2,9 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Prefetch Configuration Register"] - pub pcon: PCON, + pub pcon: crate::Reg, } -#[doc = "Prefetch Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcon](pcon) module"] -pub type PCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCON; -#[doc = "`read()` method returns [pcon::R](pcon::R) reader structure"] -impl crate::Readable for PCON {} -#[doc = "`write(|w| ..)` method takes [pcon::W](pcon::W) writer structure"] -impl crate::Writable for PCON {} +#[doc = "PCON register accessor: an alias for `Reg`"] +pub type PCON = crate::Reg; #[doc = "Prefetch Configuration Register"] pub mod pcon; diff --git a/src/pref/pcon.rs b/src/pref/pcon.rs index b86168d4..b974f357 100644 --- a/src/pref/pcon.rs +++ b/src/pref/pcon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PCON"] -pub type R = crate::R; -#[doc = "Writer for register PCON"] -pub type W = crate::W; -#[doc = "Register PCON `reset()`'s with value 0"] -impl crate::ResetValue for super::PCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Instruction Prefetch Buffer Bypass\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IBYP`"] -pub type IBYP_R = crate::R; +#[doc = "Field `IBYP` reader - Instruction Prefetch Buffer Bypass"] +pub struct IBYP_R(crate::FieldReader); impl IBYP_R { + pub(crate) fn new(bits: bool) -> Self { + IBYP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IBYP_A { @@ -38,15 +65,22 @@ impl IBYP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IBYP_A::VALUE1 + **self == IBYP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IBYP_A::VALUE2 + **self == IBYP_A::VALUE2 + } +} +impl core::ops::Deref for IBYP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IBYP`"] +#[doc = "Field `IBYP` writer - Instruction Prefetch Buffer Bypass"] pub struct IBYP_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> IBYP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IBYP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Instruction prefetch buffer not bypassed."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> IBYP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,7 +131,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `IINV`"] +#[doc = "Field `IINV` writer - Instruction Prefetch Buffer Invalidate"] pub struct IINV_W<'a> { w: &'a mut W, } @@ -107,9 +139,7 @@ impl<'a> IINV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IINV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -134,7 +164,7 @@ impl<'a> IINV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -152,9 +182,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DBYP`"] -pub type DBYP_R = crate::R; +#[doc = "Field `DBYP` reader - Data Buffer Bypass"] +pub struct DBYP_R(crate::FieldReader); impl DBYP_R { + pub(crate) fn new(bits: bool) -> Self { + DBYP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DBYP_A { @@ -166,15 +199,22 @@ impl DBYP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DBYP_A::VALUE1 + **self == DBYP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DBYP_A::VALUE2 + **self == DBYP_A::VALUE2 } } -#[doc = "Write proxy for field `DBYP`"] +impl core::ops::Deref for DBYP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBYP` writer - Data Buffer Bypass"] pub struct DBYP_W<'a> { w: &'a mut W, } @@ -182,9 +222,7 @@ impl<'a> DBYP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DBYP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Prefetch Data buffer not bypassed."] #[inline(always)] @@ -209,7 +247,7 @@ impl<'a> DBYP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -241,4 +279,30 @@ impl W { pub fn dbyp(&mut self) -> DBYP_W { DBYP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prefetch Configuration Register\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 [pcon](index.html) module"] +pub struct PCON_SPEC; +impl crate::RegisterSpec for PCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcon::R](R) reader structure"] +impl crate::Readable for PCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcon::W](W) writer structure"] +impl crate::Writable for PCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCON to value 0"] +impl crate::Resettable for PCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc.rs b/src/rtc.rs index 63955d37..de96226d 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -2,125 +2,63 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - RTC ID Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x04 - RTC Control Register"] - pub ctr: CTR, + pub ctr: crate::Reg, #[doc = "0x08 - RTC Raw Service Request Register"] - pub rawstat: RAWSTAT, + pub rawstat: crate::Reg, #[doc = "0x0c - RTC Service Request Status Register"] - pub stssr: STSSR, + pub stssr: crate::Reg, #[doc = "0x10 - RTC Service Request Mask Register"] - pub msksr: MSKSR, + pub msksr: crate::Reg, #[doc = "0x14 - RTC Clear Service Request Register"] - pub clrsr: CLRSR, + pub clrsr: crate::Reg, #[doc = "0x18 - RTC Alarm Time Register 0"] - pub atim0: ATIM0, + pub atim0: crate::Reg, #[doc = "0x1c - RTC Alarm Time Register 1"] - pub atim1: ATIM1, + pub atim1: crate::Reg, #[doc = "0x20 - RTC Time Register 0"] - pub tim0: TIM0, + pub tim0: crate::Reg, #[doc = "0x24 - RTC Time Register 1"] - pub tim1: TIM1, + pub tim1: crate::Reg, } -#[doc = "RTC ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "RTC ID Register"] pub mod id; -#[doc = "RTC Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctr](ctr) module"] -pub type CTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTR; -#[doc = "`read()` method returns [ctr::R](ctr::R) reader structure"] -impl crate::Readable for CTR {} -#[doc = "`write(|w| ..)` method takes [ctr::W](ctr::W) writer structure"] -impl crate::Writable for CTR {} +#[doc = "CTR register accessor: an alias for `Reg`"] +pub type CTR = crate::Reg; #[doc = "RTC Control Register"] pub mod ctr; -#[doc = "RTC Raw Service Request Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawstat](rawstat) module"] -pub type RAWSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RAWSTAT; -#[doc = "`read()` method returns [rawstat::R](rawstat::R) reader structure"] -impl crate::Readable for RAWSTAT {} +#[doc = "RAWSTAT register accessor: an alias for `Reg`"] +pub type RAWSTAT = crate::Reg; #[doc = "RTC Raw Service Request Register"] pub mod rawstat; -#[doc = "RTC Service Request Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stssr](stssr) module"] -pub type STSSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STSSR; -#[doc = "`read()` method returns [stssr::R](stssr::R) reader structure"] -impl crate::Readable for STSSR {} +#[doc = "STSSR register accessor: an alias for `Reg`"] +pub type STSSR = crate::Reg; #[doc = "RTC Service Request Status Register"] pub mod stssr; -#[doc = "RTC Service Request Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [msksr](msksr) module"] -pub type MSKSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MSKSR; -#[doc = "`read()` method returns [msksr::R](msksr::R) reader structure"] -impl crate::Readable for MSKSR {} -#[doc = "`write(|w| ..)` method takes [msksr::W](msksr::W) writer structure"] -impl crate::Writable for MSKSR {} +#[doc = "MSKSR register accessor: an alias for `Reg`"] +pub type MSKSR = crate::Reg; #[doc = "RTC Service Request Mask Register"] pub mod msksr; -#[doc = "RTC Clear Service Request Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clrsr](clrsr) module"] -pub type CLRSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLRSR; -#[doc = "`write(|w| ..)` method takes [clrsr::W](clrsr::W) writer structure"] -impl crate::Writable for CLRSR {} +#[doc = "CLRSR register accessor: an alias for `Reg`"] +pub type CLRSR = crate::Reg; #[doc = "RTC Clear Service Request Register"] pub mod clrsr; -#[doc = "RTC Alarm Time Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [atim0](atim0) module"] -pub type ATIM0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ATIM0; -#[doc = "`read()` method returns [atim0::R](atim0::R) reader structure"] -impl crate::Readable for ATIM0 {} -#[doc = "`write(|w| ..)` method takes [atim0::W](atim0::W) writer structure"] -impl crate::Writable for ATIM0 {} +#[doc = "ATIM0 register accessor: an alias for `Reg`"] +pub type ATIM0 = crate::Reg; #[doc = "RTC Alarm Time Register 0"] pub mod atim0; -#[doc = "RTC Alarm Time Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [atim1](atim1) module"] -pub type ATIM1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ATIM1; -#[doc = "`read()` method returns [atim1::R](atim1::R) reader structure"] -impl crate::Readable for ATIM1 {} -#[doc = "`write(|w| ..)` method takes [atim1::W](atim1::W) writer structure"] -impl crate::Writable for ATIM1 {} +#[doc = "ATIM1 register accessor: an alias for `Reg`"] +pub type ATIM1 = crate::Reg; #[doc = "RTC Alarm Time Register 1"] pub mod atim1; -#[doc = "RTC Time Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tim0](tim0) module"] -pub type TIM0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TIM0; -#[doc = "`read()` method returns [tim0::R](tim0::R) reader structure"] -impl crate::Readable for TIM0 {} -#[doc = "`write(|w| ..)` method takes [tim0::W](tim0::W) writer structure"] -impl crate::Writable for TIM0 {} +#[doc = "TIM0 register accessor: an alias for `Reg`"] +pub type TIM0 = crate::Reg; #[doc = "RTC Time Register 0"] pub mod tim0; -#[doc = "RTC Time Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tim1](tim1) module"] -pub type TIM1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TIM1; -#[doc = "`read()` method returns [tim1::R](tim1::R) reader structure"] -impl crate::Readable for TIM1 {} -#[doc = "`write(|w| ..)` method takes [tim1::W](tim1::W) writer structure"] -impl crate::Writable for TIM1 {} +#[doc = "TIM1 register accessor: an alias for `Reg`"] +pub type TIM1 = crate::Reg; #[doc = "RTC Time Register 1"] pub mod tim1; diff --git a/src/rtc/atim0.rs b/src/rtc/atim0.rs index 49333908..b2a83a65 100644 --- a/src/rtc/atim0.rs +++ b/src/rtc/atim0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register ATIM0"] -pub type R = crate::R; -#[doc = "Writer for register ATIM0"] -pub type W = crate::W; -#[doc = "Register ATIM0 `reset()`'s with value 0"] -impl crate::ResetValue for super::ATIM0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ATIM0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ATIM0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `ASE`"] -pub type ASE_R = crate::R; -#[doc = "Write proxy for field `ASE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ASE` reader - Alarm Seconds Compare Value"] +pub struct ASE_R(crate::FieldReader); +impl ASE_R { + pub(crate) fn new(bits: u8) -> Self { + ASE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ASE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ASE` writer - Alarm Seconds Compare Value"] pub struct ASE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> ASE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `AMI`"] -pub type AMI_R = crate::R; -#[doc = "Write proxy for field `AMI`"] +#[doc = "Field `AMI` reader - Alarm Minutes Compare Value"] +pub struct AMI_R(crate::FieldReader); +impl AMI_R { + pub(crate) fn new(bits: u8) -> Self { + AMI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AMI` writer - Alarm Minutes Compare Value"] pub struct AMI_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> AMI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } -#[doc = "Reader of field `AHO`"] -pub type AHO_R = crate::R; -#[doc = "Write proxy for field `AHO`"] +#[doc = "Field `AHO` reader - Alarm Hours Compare Value"] +pub struct AHO_R(crate::FieldReader); +impl AHO_R { + pub(crate) fn new(bits: u8) -> Self { + AHO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHO` writer - Alarm Hours Compare Value"] pub struct AHO_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> AHO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); + self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16); self.w } } -#[doc = "Reader of field `ADA`"] -pub type ADA_R = crate::R; -#[doc = "Write proxy for field `ADA`"] +#[doc = "Field `ADA` reader - Alarm Days Compare Value"] +pub struct ADA_R(crate::FieldReader); +impl ADA_R { + pub(crate) fn new(bits: u8) -> Self { + ADA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADA` writer - Alarm Days Compare Value"] pub struct ADA_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> ADA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 24)) | (((value as u32) & 0x1f) << 24); + self.w.bits = (self.w.bits & !(0x1f << 24)) | ((value as u32 & 0x1f) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn ada(&mut self) -> ADA_W { ADA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Alarm Time Register 0\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 [atim0](index.html) module"] +pub struct ATIM0_SPEC; +impl crate::RegisterSpec for ATIM0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [atim0::R](R) reader structure"] +impl crate::Readable for ATIM0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [atim0::W](W) writer structure"] +impl crate::Writable for ATIM0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ATIM0 to value 0"] +impl crate::Resettable for ATIM0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc/atim1.rs b/src/rtc/atim1.rs index deef2639..2fac4ace 100644 --- a/src/rtc/atim1.rs +++ b/src/rtc/atim1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register ATIM1"] -pub type R = crate::R; -#[doc = "Writer for register ATIM1"] -pub type W = crate::W; -#[doc = "Register ATIM1 `reset()`'s with value 0"] -impl crate::ResetValue for super::ATIM1 { - type Type = u32; +#[doc = "Register `ATIM1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ATIM1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `AMO` reader - Alarm Month Compare Value"] +pub struct AMO_R(crate::FieldReader); +impl AMO_R { + pub(crate) fn new(bits: u8) -> Self { + AMO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `AMO`"] -pub type AMO_R = crate::R; -#[doc = "Write proxy for field `AMO`"] +#[doc = "Field `AMO` writer - Alarm Month Compare Value"] pub struct AMO_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> AMO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `AYE`"] -pub type AYE_R = crate::R; -#[doc = "Write proxy for field `AYE`"] +#[doc = "Field `AYE` reader - Alarm Year Compare Value"] +pub struct AYE_R(crate::FieldReader); +impl AYE_R { + pub(crate) fn new(bits: u16) -> Self { + AYE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AYE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AYE` writer - Alarm Year Compare Value"] pub struct AYE_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> AYE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn aye(&mut self) -> AYE_W { AYE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Alarm Time Register 1\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 [atim1](index.html) module"] +pub struct ATIM1_SPEC; +impl crate::RegisterSpec for ATIM1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [atim1::R](R) reader structure"] +impl crate::Readable for ATIM1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [atim1::W](W) writer structure"] +impl crate::Writable for ATIM1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ATIM1 to value 0"] +impl crate::Resettable for ATIM1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc/clrsr.rs b/src/rtc/clrsr.rs index 7fdfe119..1edf2efc 100644 --- a/src/rtc/clrsr.rs +++ b/src/rtc/clrsr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register CLRSR"] -pub type W = crate::W; -#[doc = "Register CLRSR `reset()`'s with value 0"] -impl crate::ResetValue for super::CLRSR { - type Type = u32; +#[doc = "Register `CLRSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `RPSE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RPSE` writer - Periodic Seconds Interrupt Clear"] pub struct RPSE_W<'a> { w: &'a mut W, } @@ -26,11 +37,11 @@ impl<'a> RPSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Write proxy for field `RPMI`"] +#[doc = "Field `RPMI` writer - Periodic Minutes Interrupt Clear"] pub struct RPMI_W<'a> { w: &'a mut W, } @@ -48,11 +59,11 @@ impl<'a> RPMI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Write proxy for field `RPHO`"] +#[doc = "Field `RPHO` writer - Periodic Hours Interrupt Clear"] pub struct RPHO_W<'a> { w: &'a mut W, } @@ -70,11 +81,11 @@ impl<'a> RPHO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `RPDA`"] +#[doc = "Field `RPDA` writer - Periodic Days Interrupt Clear"] pub struct RPDA_W<'a> { w: &'a mut W, } @@ -92,11 +103,11 @@ impl<'a> RPDA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Write proxy for field `RPMO`"] +#[doc = "Field `RPMO` writer - Periodic Months Interrupt Clear"] pub struct RPMO_W<'a> { w: &'a mut W, } @@ -114,11 +125,11 @@ impl<'a> RPMO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Write proxy for field `RPYE`"] +#[doc = "Field `RPYE` writer - Periodic Years Interrupt Clear"] pub struct RPYE_W<'a> { w: &'a mut W, } @@ -136,11 +147,11 @@ impl<'a> RPYE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Write proxy for field `RAI`"] +#[doc = "Field `RAI` writer - Alarm Interrupt Clear"] pub struct RAI_W<'a> { w: &'a mut W, } @@ -158,7 +169,7 @@ impl<'a> RAI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -198,4 +209,26 @@ impl W { pub fn rai(&mut self) -> RAI_W { RAI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Clear Service Request Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clrsr](index.html) module"] +pub struct CLRSR_SPEC; +impl crate::RegisterSpec for CLRSR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clrsr::W](W) writer structure"] +impl crate::Writable for CLRSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLRSR to value 0"] +impl crate::Resettable for CLRSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc/ctr.rs b/src/rtc/ctr.rs index e73e33ff..07ec6dac 100644 --- a/src/rtc/ctr.rs +++ b/src/rtc/ctr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTR"] -pub type R = crate::R; -#[doc = "Writer for register CTR"] -pub type W = crate::W; -#[doc = "Register CTR `reset()`'s with value 0x7fff_0000"] -impl crate::ResetValue for super::CTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x7fff_0000 +#[doc = "Register `CTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENB` reader - RTC Module Enable"] +pub struct ENB_R(crate::FieldReader); +impl ENB_R { + pub(crate) fn new(bits: bool) -> Self { + ENB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ENB`"] -pub type ENB_R = crate::R; -#[doc = "Write proxy for field `ENB`"] +#[doc = "Field `ENB` writer - RTC Module Enable"] pub struct ENB_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `TAE`"] -pub type TAE_R = crate::R; -#[doc = "Write proxy for field `TAE`"] +#[doc = "Field `TAE` reader - Timer Alarm Enable for Hibernation Wake-up"] +pub struct TAE_R(crate::FieldReader); +impl TAE_R { + pub(crate) fn new(bits: bool) -> Self { + TAE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TAE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TAE` writer - Timer Alarm Enable for Hibernation Wake-up"] pub struct TAE_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> TAE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `ESEC`"] -pub type ESEC_R = crate::R; -#[doc = "Write proxy for field `ESEC`"] +#[doc = "Field `ESEC` reader - Enable Seconds Comparison for Hibernation Wake-up"] +pub struct ESEC_R(crate::FieldReader); +impl ESEC_R { + pub(crate) fn new(bits: bool) -> Self { + ESEC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ESEC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ESEC` writer - Enable Seconds Comparison for Hibernation Wake-up"] pub struct ESEC_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> ESEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `EMIC`"] -pub type EMIC_R = crate::R; -#[doc = "Write proxy for field `EMIC`"] +#[doc = "Field `EMIC` reader - Enable Minutes Comparison for Hibernation Wake-up"] +pub struct EMIC_R(crate::FieldReader); +impl EMIC_R { + pub(crate) fn new(bits: bool) -> Self { + EMIC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMIC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMIC` writer - Enable Minutes Comparison for Hibernation Wake-up"] pub struct EMIC_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> EMIC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `EHOC`"] -pub type EHOC_R = crate::R; -#[doc = "Write proxy for field `EHOC`"] +#[doc = "Field `EHOC` reader - Enable Hours Comparison for Hibernation Wake-up"] +pub struct EHOC_R(crate::FieldReader); +impl EHOC_R { + pub(crate) fn new(bits: bool) -> Self { + EHOC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EHOC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EHOC` writer - Enable Hours Comparison for Hibernation Wake-up"] pub struct EHOC_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> EHOC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Reader of field `EDAC`"] -pub type EDAC_R = crate::R; -#[doc = "Write proxy for field `EDAC`"] +#[doc = "Field `EDAC` reader - Enable Days Comparison for Hibernation Wake-up"] +pub struct EDAC_R(crate::FieldReader); +impl EDAC_R { + pub(crate) fn new(bits: bool) -> Self { + EDAC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EDAC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDAC` writer - Enable Days Comparison for Hibernation Wake-up"] pub struct EDAC_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> EDAC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `EMOC`"] -pub type EMOC_R = crate::R; -#[doc = "Write proxy for field `EMOC`"] +#[doc = "Field `EMOC` reader - Enable Months Comparison for Hibernation Wake-up"] +pub struct EMOC_R(crate::FieldReader); +impl EMOC_R { + pub(crate) fn new(bits: bool) -> Self { + EMOC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMOC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMOC` writer - Enable Months Comparison for Hibernation Wake-up"] pub struct EMOC_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> EMOC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `EYEC`"] -pub type EYEC_R = crate::R; -#[doc = "Write proxy for field `EYEC`"] +#[doc = "Field `EYEC` reader - Enable Years Comparison for Hibernation Wake-up"] +pub struct EYEC_R(crate::FieldReader); +impl EYEC_R { + pub(crate) fn new(bits: bool) -> Self { + EYEC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EYEC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EYEC` writer - Enable Years Comparison for Hibernation Wake-up"] pub struct EYEC_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> EYEC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `DIV`"] -pub type DIV_R = crate::R; -#[doc = "Write proxy for field `DIV`"] +#[doc = "Field `DIV` reader - RTC Clock Divider Value"] +pub struct DIV_R(crate::FieldReader); +impl DIV_R { + pub(crate) fn new(bits: u16) -> Self { + DIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIV` writer - RTC Clock Divider Value"] pub struct DIV_W<'a> { w: &'a mut W, } @@ -212,7 +344,7 @@ impl<'a> DIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -309,4 +441,30 @@ impl W { pub fn div(&mut self) -> DIV_W { DIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Control Register\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 [ctr](index.html) module"] +pub struct CTR_SPEC; +impl crate::RegisterSpec for CTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctr::R](R) reader structure"] +impl crate::Readable for CTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctr::W](W) writer structure"] +impl crate::Writable for CTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTR to value 0x7fff_0000"] +impl crate::Resettable for CTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x7fff_0000 + } } diff --git a/src/rtc/id.rs b/src/rtc/id.rs index f22f9749..d464422c 100644 --- a/src/rtc/id.rs +++ b/src/rtc/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "RTC ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00a3_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00a3_c000 + } +} diff --git a/src/rtc/msksr.rs b/src/rtc/msksr.rs index 8004c6cb..59456826 100644 --- a/src/rtc/msksr.rs +++ b/src/rtc/msksr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MSKSR"] -pub type R = crate::R; -#[doc = "Writer for register MSKSR"] -pub type W = crate::W; -#[doc = "Register MSKSR `reset()`'s with value 0"] -impl crate::ResetValue for super::MSKSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MSKSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MSKSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MPSE`"] -pub type MPSE_R = crate::R; -#[doc = "Write proxy for field `MPSE`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MPSE` reader - Periodic Seconds Interrupt Mask"] +pub struct MPSE_R(crate::FieldReader); +impl MPSE_R { + pub(crate) fn new(bits: bool) -> Self { + MPSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPSE` writer - Periodic Seconds Interrupt Mask"] pub struct MPSE_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> MPSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `MPMI`"] -pub type MPMI_R = crate::R; -#[doc = "Write proxy for field `MPMI`"] +#[doc = "Field `MPMI` reader - Periodic Minutes Interrupt Mask"] +pub struct MPMI_R(crate::FieldReader); +impl MPMI_R { + pub(crate) fn new(bits: bool) -> Self { + MPMI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPMI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPMI` writer - Periodic Minutes Interrupt Mask"] pub struct MPMI_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> MPMI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `MPHO`"] -pub type MPHO_R = crate::R; -#[doc = "Write proxy for field `MPHO`"] +#[doc = "Field `MPHO` reader - Periodic Hours Interrupt Mask"] +pub struct MPHO_R(crate::FieldReader); +impl MPHO_R { + pub(crate) fn new(bits: bool) -> Self { + MPHO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPHO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPHO` writer - Periodic Hours Interrupt Mask"] pub struct MPHO_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> MPHO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `MPDA`"] -pub type MPDA_R = crate::R; -#[doc = "Write proxy for field `MPDA`"] +#[doc = "Field `MPDA` reader - Periodic Days Interrupt Mask"] +pub struct MPDA_R(crate::FieldReader); +impl MPDA_R { + pub(crate) fn new(bits: bool) -> Self { + MPDA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPDA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPDA` writer - Periodic Days Interrupt Mask"] pub struct MPDA_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> MPDA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `MPMO`"] -pub type MPMO_R = crate::R; -#[doc = "Write proxy for field `MPMO`"] +#[doc = "Field `MPMO` reader - Periodic Months Interrupt Mask"] +pub struct MPMO_R(crate::FieldReader); +impl MPMO_R { + pub(crate) fn new(bits: bool) -> Self { + MPMO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPMO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPMO` writer - Periodic Months Interrupt Mask"] pub struct MPMO_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> MPMO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `MPYE`"] -pub type MPYE_R = crate::R; -#[doc = "Write proxy for field `MPYE`"] +#[doc = "Field `MPYE` reader - Periodic Years Interrupt Mask"] +pub struct MPYE_R(crate::FieldReader); +impl MPYE_R { + pub(crate) fn new(bits: bool) -> Self { + MPYE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPYE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPYE` writer - Periodic Years Interrupt Mask"] pub struct MPYE_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> MPYE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `MAI`"] -pub type MAI_R = crate::R; -#[doc = "Write proxy for field `MAI`"] +#[doc = "Field `MAI` reader - Alarm Interrupt Mask"] +pub struct MAI_R(crate::FieldReader); +impl MAI_R { + pub(crate) fn new(bits: bool) -> Self { + MAI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAI` writer - Alarm Interrupt Mask"] pub struct MAI_W<'a> { w: &'a mut W, } @@ -174,7 +282,7 @@ impl<'a> MAI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -251,4 +359,30 @@ impl W { pub fn mai(&mut self) -> MAI_W { MAI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Service Request Mask Register\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 [msksr](index.html) module"] +pub struct MSKSR_SPEC; +impl crate::RegisterSpec for MSKSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [msksr::R](R) reader structure"] +impl crate::Readable for MSKSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [msksr::W](W) writer structure"] +impl crate::Writable for MSKSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MSKSR to value 0"] +impl crate::Resettable for MSKSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc/rawstat.rs b/src/rtc/rawstat.rs index 992af66f..9a48cdda 100644 --- a/src/rtc/rawstat.rs +++ b/src/rtc/rawstat.rs @@ -1,19 +1,116 @@ -#[doc = "Reader of register RAWSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `RPSE`"] -pub type RPSE_R = crate::R; -#[doc = "Reader of field `RPMI`"] -pub type RPMI_R = crate::R; -#[doc = "Reader of field `RPHO`"] -pub type RPHO_R = crate::R; -#[doc = "Reader of field `RPDA`"] -pub type RPDA_R = crate::R; -#[doc = "Reader of field `RPMO`"] -pub type RPMO_R = crate::R; -#[doc = "Reader of field `RPYE`"] -pub type RPYE_R = crate::R; -#[doc = "Reader of field `RAI`"] -pub type RAI_R = crate::R; +#[doc = "Register `RAWSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RPSE` reader - Raw Periodic Seconds Service Request"] +pub struct RPSE_R(crate::FieldReader); +impl RPSE_R { + pub(crate) fn new(bits: bool) -> Self { + RPSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RPMI` reader - Raw Periodic Minutes Service Request"] +pub struct RPMI_R(crate::FieldReader); +impl RPMI_R { + pub(crate) fn new(bits: bool) -> Self { + RPMI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPMI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RPHO` reader - Raw Periodic Hours Service Request"] +pub struct RPHO_R(crate::FieldReader); +impl RPHO_R { + pub(crate) fn new(bits: bool) -> Self { + RPHO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPHO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RPDA` reader - Raw Periodic Days Service Request"] +pub struct RPDA_R(crate::FieldReader); +impl RPDA_R { + pub(crate) fn new(bits: bool) -> Self { + RPDA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPDA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RPMO` reader - Raw Periodic Months Service Request"] +pub struct RPMO_R(crate::FieldReader); +impl RPMO_R { + pub(crate) fn new(bits: bool) -> Self { + RPMO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPMO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RPYE` reader - Raw Periodic Years Service Request"] +pub struct RPYE_R(crate::FieldReader); +impl RPYE_R { + pub(crate) fn new(bits: bool) -> Self { + RPYE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RPYE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RAI` reader - Raw Alarm Service Request"] +pub struct RAI_R(crate::FieldReader); +impl RAI_R { + pub(crate) fn new(bits: bool) -> Self { + RAI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RAI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Raw Periodic Seconds Service Request"] #[inline(always)] @@ -51,3 +148,19 @@ impl R { RAI_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "RTC Raw Service Request Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rawstat](index.html) module"] +pub struct RAWSTAT_SPEC; +impl crate::RegisterSpec for RAWSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rawstat::R](R) reader structure"] +impl crate::Readable for RAWSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RAWSTAT to value 0"] +impl crate::Resettable for RAWSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc/stssr.rs b/src/rtc/stssr.rs index b18fe159..cde2a697 100644 --- a/src/rtc/stssr.rs +++ b/src/rtc/stssr.rs @@ -1,19 +1,116 @@ -#[doc = "Reader of register STSSR"] -pub type R = crate::R; -#[doc = "Reader of field `SPSE`"] -pub type SPSE_R = crate::R; -#[doc = "Reader of field `SPMI`"] -pub type SPMI_R = crate::R; -#[doc = "Reader of field `SPHO`"] -pub type SPHO_R = crate::R; -#[doc = "Reader of field `SPDA`"] -pub type SPDA_R = crate::R; -#[doc = "Reader of field `SPMO`"] -pub type SPMO_R = crate::R; -#[doc = "Reader of field `SPYE`"] -pub type SPYE_R = crate::R; -#[doc = "Reader of field `SAI`"] -pub type SAI_R = crate::R; +#[doc = "Register `STSSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `SPSE` reader - Periodic Seconds Service Request Status after Masking"] +pub struct SPSE_R(crate::FieldReader); +impl SPSE_R { + pub(crate) fn new(bits: bool) -> Self { + SPSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPMI` reader - Periodic Minutes Service Request Status after Masking"] +pub struct SPMI_R(crate::FieldReader); +impl SPMI_R { + pub(crate) fn new(bits: bool) -> Self { + SPMI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPMI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPHO` reader - Periodic Hours Service Request Status after Masking"] +pub struct SPHO_R(crate::FieldReader); +impl SPHO_R { + pub(crate) fn new(bits: bool) -> Self { + SPHO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPHO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPDA` reader - Periodic Days Service Request Status after Masking"] +pub struct SPDA_R(crate::FieldReader); +impl SPDA_R { + pub(crate) fn new(bits: bool) -> Self { + SPDA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPDA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPMO` reader - Periodic Months Service Request Status after Masking"] +pub struct SPMO_R(crate::FieldReader); +impl SPMO_R { + pub(crate) fn new(bits: bool) -> Self { + SPMO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPMO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPYE` reader - Periodic Years Service Request Status after Masking"] +pub struct SPYE_R(crate::FieldReader); +impl SPYE_R { + pub(crate) fn new(bits: bool) -> Self { + SPYE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPYE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAI` reader - Alarm Service Request Status after Masking"] +pub struct SAI_R(crate::FieldReader); +impl SAI_R { + pub(crate) fn new(bits: bool) -> Self { + SAI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SAI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Periodic Seconds Service Request Status after Masking"] #[inline(always)] @@ -51,3 +148,19 @@ impl R { SAI_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "RTC Service Request Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stssr](index.html) module"] +pub struct STSSR_SPEC; +impl crate::RegisterSpec for STSSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [stssr::R](R) reader structure"] +impl crate::Readable for STSSR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STSSR to value 0"] +impl crate::Resettable for STSSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc/tim0.rs b/src/rtc/tim0.rs index 561fd747..63e7e75f 100644 --- a/src/rtc/tim0.rs +++ b/src/rtc/tim0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TIM0"] -pub type R = crate::R; -#[doc = "Writer for register TIM0"] -pub type W = crate::W; -#[doc = "Register TIM0 `reset()`'s with value 0"] -impl crate::ResetValue for super::TIM0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TIM0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TIM0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `SE`"] -pub type SE_R = crate::R; -#[doc = "Write proxy for field `SE`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SE` reader - Seconds Time Value"] +pub struct SE_R(crate::FieldReader); +impl SE_R { + pub(crate) fn new(bits: u8) -> Self { + SE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SE` writer - Seconds Time Value"] pub struct SE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> SE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `MI`"] -pub type MI_R = crate::R; -#[doc = "Write proxy for field `MI`"] +#[doc = "Field `MI` reader - Minutes Time Value"] +pub struct MI_R(crate::FieldReader); +impl MI_R { + pub(crate) fn new(bits: u8) -> Self { + MI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MI` writer - Minutes Time Value"] pub struct MI_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> MI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } -#[doc = "Reader of field `HO`"] -pub type HO_R = crate::R; -#[doc = "Write proxy for field `HO`"] +#[doc = "Field `HO` reader - Hours Time Value"] +pub struct HO_R(crate::FieldReader); +impl HO_R { + pub(crate) fn new(bits: u8) -> Self { + HO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HO` writer - Hours Time Value"] pub struct HO_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> HO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); + self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16); self.w } } -#[doc = "Reader of field `DA`"] -pub type DA_R = crate::R; -#[doc = "Write proxy for field `DA`"] +#[doc = "Field `DA` reader - Days Time Value"] +pub struct DA_R(crate::FieldReader); +impl DA_R { + pub(crate) fn new(bits: u8) -> Self { + DA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DA` writer - Days Time Value"] pub struct DA_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> DA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 24)) | (((value as u32) & 0x1f) << 24); + self.w.bits = (self.w.bits & !(0x1f << 24)) | ((value as u32 & 0x1f) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn da(&mut self) -> DA_W { DA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Time Register 0\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 [tim0](index.html) module"] +pub struct TIM0_SPEC; +impl crate::RegisterSpec for TIM0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tim0::R](R) reader structure"] +impl crate::Readable for TIM0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tim0::W](W) writer structure"] +impl crate::Writable for TIM0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TIM0 to value 0"] +impl crate::Resettable for TIM0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/rtc/tim1.rs b/src/rtc/tim1.rs index 19256ef5..36c166fb 100644 --- a/src/rtc/tim1.rs +++ b/src/rtc/tim1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register TIM1"] -pub type R = crate::R; -#[doc = "Writer for register TIM1"] -pub type W = crate::W; -#[doc = "Register TIM1 `reset()`'s with value 0"] -impl crate::ResetValue for super::TIM1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TIM1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TIM1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DAWE` reader - Days of Week Time Value"] +pub struct DAWE_R(crate::FieldReader); +impl DAWE_R { + pub(crate) fn new(bits: u8) -> Self { + DAWE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAWE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `DAWE`"] -pub type DAWE_R = crate::R; -#[doc = "Write proxy for field `DAWE`"] +#[doc = "Field `DAWE` writer - Days of Week Time Value"] pub struct DAWE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> DAWE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `MO`"] -pub type MO_R = crate::R; -#[doc = "Write proxy for field `MO`"] +#[doc = "Field `MO` reader - Month Time Value"] +pub struct MO_R(crate::FieldReader); +impl MO_R { + pub(crate) fn new(bits: u8) -> Self { + MO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MO` writer - Month Time Value"] pub struct MO_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> MO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `YE`"] -pub type YE_R = crate::R; -#[doc = "Write proxy for field `YE`"] +#[doc = "Field `YE` reader - Year Time Value"] +pub struct YE_R(crate::FieldReader); +impl YE_R { + pub(crate) fn new(bits: u16) -> Self { + YE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for YE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `YE` writer - Year Time Value"] pub struct YE_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> YE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -85,4 +145,30 @@ impl W { pub fn ye(&mut self) -> YE_W { YE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RTC Time Register 1\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 [tim1](index.html) module"] +pub struct TIM1_SPEC; +impl crate::RegisterSpec for TIM1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tim1::R](R) reader structure"] +impl crate::Readable for TIM1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tim1::W](W) writer structure"] +impl crate::Writable for TIM1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TIM1 to value 0"] +impl crate::Resettable for TIM1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk.rs b/src/scu_clk.rs index 6b85a89d..a454d139 100644 --- a/src/scu_clk.rs +++ b/src/scu_clk.rs @@ -2,267 +2,137 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Clock Status Register"] - pub clkstat: CLKSTAT, + pub clkstat: crate::Reg, #[doc = "0x04 - CLK Set Register"] - pub clkset: CLKSET, + pub clkset: crate::Reg, #[doc = "0x08 - CLK Clear Register"] - pub clkclr: CLKCLR, + pub clkclr: crate::Reg, #[doc = "0x0c - System Clock Control Register"] - pub sysclkcr: SYSCLKCR, + pub sysclkcr: crate::Reg, #[doc = "0x10 - CPU Clock Control Register"] - pub cpuclkcr: CPUCLKCR, + pub cpuclkcr: crate::Reg, #[doc = "0x14 - Peripheral Bus Clock Control Register"] - pub pbclkcr: PBCLKCR, + pub pbclkcr: crate::Reg, #[doc = "0x18 - USB Clock Control Register"] - pub usbclkcr: USBCLKCR, - _reserved7: [u8; 4usize], + pub usbclkcr: crate::Reg, + _reserved7: [u8; 0x04], #[doc = "0x20 - CCU Clock Control Register"] - pub ccuclkcr: CCUCLKCR, + pub ccuclkcr: crate::Reg, #[doc = "0x24 - WDT Clock Control Register"] - pub wdtclkcr: WDTCLKCR, + pub wdtclkcr: crate::Reg, #[doc = "0x28 - External Clock Control"] - pub extclkcr: EXTCLKCR, + pub extclkcr: crate::Reg, #[doc = "0x2c - Multi-Link Clock Control"] - pub mlinkclkcr: MLINKCLKCR, + pub mlinkclkcr: crate::Reg, #[doc = "0x30 - Sleep Control Register"] - pub sleepcr: SLEEPCR, + pub sleepcr: crate::Reg, #[doc = "0x34 - Deep Sleep Control Register"] - pub dsleepcr: DSLEEPCR, - _reserved13: [u8; 8usize], + pub dsleepcr: crate::Reg, + _reserved13: [u8; 0x08], #[doc = "0x40 - Peripheral 0 Clock Gating Status"] - pub cgatstat0: CGATSTAT0, + pub cgatstat0: crate::Reg, #[doc = "0x44 - Peripheral 0 Clock Gating Set"] - pub cgatset0: CGATSET0, + pub cgatset0: crate::Reg, #[doc = "0x48 - Peripheral 0 Clock Gating Clear"] - pub cgatclr0: CGATCLR0, + pub cgatclr0: crate::Reg, #[doc = "0x4c - Peripheral 1 Clock Gating Status"] - pub cgatstat1: CGATSTAT1, + pub cgatstat1: crate::Reg, #[doc = "0x50 - Peripheral 1 Clock Gating Set"] - pub cgatset1: CGATSET1, + pub cgatset1: crate::Reg, #[doc = "0x54 - Peripheral 1 Clock Gating Clear"] - pub cgatclr1: CGATCLR1, + pub cgatclr1: crate::Reg, #[doc = "0x58 - Peripheral 2 Clock Gating Status"] - pub cgatstat2: CGATSTAT2, + pub cgatstat2: crate::Reg, #[doc = "0x5c - Peripheral 2 Clock Gating Set"] - pub cgatset2: CGATSET2, + pub cgatset2: crate::Reg, #[doc = "0x60 - Peripheral 2 Clock Gating Clear"] - pub cgatclr2: CGATCLR2, + pub cgatclr2: crate::Reg, } -#[doc = "Clock Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkstat](clkstat) module"] -pub type CLKSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLKSTAT; -#[doc = "`read()` method returns [clkstat::R](clkstat::R) reader structure"] -impl crate::Readable for CLKSTAT {} +#[doc = "CLKSTAT register accessor: an alias for `Reg`"] +pub type CLKSTAT = crate::Reg; #[doc = "Clock Status Register"] pub mod clkstat; -#[doc = "CLK Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkset](clkset) module"] -pub type CLKSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLKSET; -#[doc = "`write(|w| ..)` method takes [clkset::W](clkset::W) writer structure"] -impl crate::Writable for CLKSET {} +#[doc = "CLKSET register accessor: an alias for `Reg`"] +pub type CLKSET = crate::Reg; #[doc = "CLK Set Register"] pub mod clkset; -#[doc = "CLK Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkclr](clkclr) module"] -pub type CLKCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLKCLR; -#[doc = "`write(|w| ..)` method takes [clkclr::W](clkclr::W) writer structure"] -impl crate::Writable for CLKCLR {} +#[doc = "CLKCLR register accessor: an alias for `Reg`"] +pub type CLKCLR = crate::Reg; #[doc = "CLK Clear Register"] pub mod clkclr; -#[doc = "System Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sysclkcr](sysclkcr) module"] -pub type SYSCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYSCLKCR; -#[doc = "`read()` method returns [sysclkcr::R](sysclkcr::R) reader structure"] -impl crate::Readable for SYSCLKCR {} -#[doc = "`write(|w| ..)` method takes [sysclkcr::W](sysclkcr::W) writer structure"] -impl crate::Writable for SYSCLKCR {} +#[doc = "SYSCLKCR register accessor: an alias for `Reg`"] +pub type SYSCLKCR = crate::Reg; #[doc = "System Clock Control Register"] pub mod sysclkcr; -#[doc = "CPU Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cpuclkcr](cpuclkcr) module"] -pub type CPUCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CPUCLKCR; -#[doc = "`read()` method returns [cpuclkcr::R](cpuclkcr::R) reader structure"] -impl crate::Readable for CPUCLKCR {} -#[doc = "`write(|w| ..)` method takes [cpuclkcr::W](cpuclkcr::W) writer structure"] -impl crate::Writable for CPUCLKCR {} +#[doc = "CPUCLKCR register accessor: an alias for `Reg`"] +pub type CPUCLKCR = crate::Reg; #[doc = "CPU Clock Control Register"] pub mod cpuclkcr; -#[doc = "Peripheral Bus Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pbclkcr](pbclkcr) module"] -pub type PBCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PBCLKCR; -#[doc = "`read()` method returns [pbclkcr::R](pbclkcr::R) reader structure"] -impl crate::Readable for PBCLKCR {} -#[doc = "`write(|w| ..)` method takes [pbclkcr::W](pbclkcr::W) writer structure"] -impl crate::Writable for PBCLKCR {} +#[doc = "PBCLKCR register accessor: an alias for `Reg`"] +pub type PBCLKCR = crate::Reg; #[doc = "Peripheral Bus Clock Control Register"] pub mod pbclkcr; -#[doc = "USB Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbclkcr](usbclkcr) module"] -pub type USBCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _USBCLKCR; -#[doc = "`read()` method returns [usbclkcr::R](usbclkcr::R) reader structure"] -impl crate::Readable for USBCLKCR {} -#[doc = "`write(|w| ..)` method takes [usbclkcr::W](usbclkcr::W) writer structure"] -impl crate::Writable for USBCLKCR {} +#[doc = "USBCLKCR register accessor: an alias for `Reg`"] +pub type USBCLKCR = crate::Reg; #[doc = "USB Clock Control Register"] pub mod usbclkcr; -#[doc = "CCU Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccuclkcr](ccuclkcr) module"] -pub type CCUCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CCUCLKCR; -#[doc = "`read()` method returns [ccuclkcr::R](ccuclkcr::R) reader structure"] -impl crate::Readable for CCUCLKCR {} -#[doc = "`write(|w| ..)` method takes [ccuclkcr::W](ccuclkcr::W) writer structure"] -impl crate::Writable for CCUCLKCR {} +#[doc = "CCUCLKCR register accessor: an alias for `Reg`"] +pub type CCUCLKCR = crate::Reg; #[doc = "CCU Clock Control Register"] pub mod ccuclkcr; -#[doc = "WDT Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtclkcr](wdtclkcr) module"] -pub type WDTCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WDTCLKCR; -#[doc = "`read()` method returns [wdtclkcr::R](wdtclkcr::R) reader structure"] -impl crate::Readable for WDTCLKCR {} -#[doc = "`write(|w| ..)` method takes [wdtclkcr::W](wdtclkcr::W) writer structure"] -impl crate::Writable for WDTCLKCR {} +#[doc = "WDTCLKCR register accessor: an alias for `Reg`"] +pub type WDTCLKCR = crate::Reg; #[doc = "WDT Clock Control Register"] pub mod wdtclkcr; -#[doc = "External Clock Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [extclkcr](extclkcr) module"] -pub type EXTCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EXTCLKCR; -#[doc = "`read()` method returns [extclkcr::R](extclkcr::R) reader structure"] -impl crate::Readable for EXTCLKCR {} -#[doc = "`write(|w| ..)` method takes [extclkcr::W](extclkcr::W) writer structure"] -impl crate::Writable for EXTCLKCR {} +#[doc = "EXTCLKCR register accessor: an alias for `Reg`"] +pub type EXTCLKCR = crate::Reg; #[doc = "External Clock Control"] pub mod extclkcr; -#[doc = "Multi-Link Clock Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mlinkclkcr](mlinkclkcr) module"] -pub type MLINKCLKCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MLINKCLKCR; -#[doc = "`read()` method returns [mlinkclkcr::R](mlinkclkcr::R) reader structure"] -impl crate::Readable for MLINKCLKCR {} -#[doc = "`write(|w| ..)` method takes [mlinkclkcr::W](mlinkclkcr::W) writer structure"] -impl crate::Writable for MLINKCLKCR {} +#[doc = "MLINKCLKCR register accessor: an alias for `Reg`"] +pub type MLINKCLKCR = crate::Reg; #[doc = "Multi-Link Clock Control"] pub mod mlinkclkcr; -#[doc = "Sleep Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sleepcr](sleepcr) module"] -pub type SLEEPCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SLEEPCR; -#[doc = "`read()` method returns [sleepcr::R](sleepcr::R) reader structure"] -impl crate::Readable for SLEEPCR {} -#[doc = "`write(|w| ..)` method takes [sleepcr::W](sleepcr::W) writer structure"] -impl crate::Writable for SLEEPCR {} +#[doc = "SLEEPCR register accessor: an alias for `Reg`"] +pub type SLEEPCR = crate::Reg; #[doc = "Sleep Control Register"] pub mod sleepcr; -#[doc = "Deep Sleep Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsleepcr](dsleepcr) module"] -pub type DSLEEPCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSLEEPCR; -#[doc = "`read()` method returns [dsleepcr::R](dsleepcr::R) reader structure"] -impl crate::Readable for DSLEEPCR {} -#[doc = "`write(|w| ..)` method takes [dsleepcr::W](dsleepcr::W) writer structure"] -impl crate::Writable for DSLEEPCR {} +#[doc = "DSLEEPCR register accessor: an alias for `Reg`"] +pub type DSLEEPCR = crate::Reg; #[doc = "Deep Sleep Control Register"] pub mod dsleepcr; -#[doc = "Peripheral 0 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat0](cgatstat0) module"] -pub type CGATSTAT0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSTAT0; -#[doc = "`read()` method returns [cgatstat0::R](cgatstat0::R) reader structure"] -impl crate::Readable for CGATSTAT0 {} +#[doc = "CGATSTAT0 register accessor: an alias for `Reg`"] +pub type CGATSTAT0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Status"] pub mod cgatstat0; -#[doc = "Peripheral 0 Clock Gating Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset0](cgatset0) module"] -pub type CGATSET0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSET0; -#[doc = "`write(|w| ..)` method takes [cgatset0::W](cgatset0::W) writer structure"] -impl crate::Writable for CGATSET0 {} +#[doc = "CGATSET0 register accessor: an alias for `Reg`"] +pub type CGATSET0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Set"] pub mod cgatset0; -#[doc = "Peripheral 0 Clock Gating Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr0](cgatclr0) module"] -pub type CGATCLR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATCLR0; -#[doc = "`write(|w| ..)` method takes [cgatclr0::W](cgatclr0::W) writer structure"] -impl crate::Writable for CGATCLR0 {} +#[doc = "CGATCLR0 register accessor: an alias for `Reg`"] +pub type CGATCLR0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Clear"] pub mod cgatclr0; -#[doc = "Peripheral 1 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat1](cgatstat1) module"] -pub type CGATSTAT1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSTAT1; -#[doc = "`read()` method returns [cgatstat1::R](cgatstat1::R) reader structure"] -impl crate::Readable for CGATSTAT1 {} +#[doc = "CGATSTAT1 register accessor: an alias for `Reg`"] +pub type CGATSTAT1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Status"] pub mod cgatstat1; -#[doc = "Peripheral 1 Clock Gating Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset1](cgatset1) module"] -pub type CGATSET1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSET1; -#[doc = "`write(|w| ..)` method takes [cgatset1::W](cgatset1::W) writer structure"] -impl crate::Writable for CGATSET1 {} +#[doc = "CGATSET1 register accessor: an alias for `Reg`"] +pub type CGATSET1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Set"] pub mod cgatset1; -#[doc = "Peripheral 1 Clock Gating Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr1](cgatclr1) module"] -pub type CGATCLR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATCLR1; -#[doc = "`write(|w| ..)` method takes [cgatclr1::W](cgatclr1::W) writer structure"] -impl crate::Writable for CGATCLR1 {} +#[doc = "CGATCLR1 register accessor: an alias for `Reg`"] +pub type CGATCLR1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Clear"] pub mod cgatclr1; -#[doc = "Peripheral 2 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat2](cgatstat2) module"] -pub type CGATSTAT2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSTAT2; -#[doc = "`read()` method returns [cgatstat2::R](cgatstat2::R) reader structure"] -impl crate::Readable for CGATSTAT2 {} +#[doc = "CGATSTAT2 register accessor: an alias for `Reg`"] +pub type CGATSTAT2 = crate::Reg; #[doc = "Peripheral 2 Clock Gating Status"] pub mod cgatstat2; -#[doc = "Peripheral 2 Clock Gating Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset2](cgatset2) module"] -pub type CGATSET2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATSET2; -#[doc = "`write(|w| ..)` method takes [cgatset2::W](cgatset2::W) writer structure"] -impl crate::Writable for CGATSET2 {} +#[doc = "CGATSET2 register accessor: an alias for `Reg`"] +pub type CGATSET2 = crate::Reg; #[doc = "Peripheral 2 Clock Gating Set"] pub mod cgatset2; -#[doc = "Peripheral 2 Clock Gating Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr2](cgatclr2) module"] -pub type CGATCLR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CGATCLR2; -#[doc = "`write(|w| ..)` method takes [cgatclr2::W](cgatclr2::W) writer structure"] -impl crate::Writable for CGATCLR2 {} +#[doc = "CGATCLR2 register accessor: an alias for `Reg`"] +pub type CGATCLR2 = crate::Reg; #[doc = "Peripheral 2 Clock Gating Clear"] pub mod cgatclr2; diff --git a/src/scu_clk/ccuclkcr.rs b/src/scu_clk/ccuclkcr.rs index de990722..4b070838 100644 --- a/src/scu_clk/ccuclkcr.rs +++ b/src/scu_clk/ccuclkcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CCUCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register CCUCLKCR"] -pub type W = crate::W; -#[doc = "Register CCUCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::CCUCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CCUCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCUCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "CCU Clock Divider Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCUDIV`"] -pub type CCUDIV_R = crate::R; +#[doc = "Field `CCUDIV` reader - CCU Clock Divider Enable"] +pub struct CCUDIV_R(crate::FieldReader); impl CCUDIV_R { + pub(crate) fn new(bits: bool) -> Self { + CCUDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCUDIV_A { @@ -38,15 +65,22 @@ impl CCUDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCUDIV_A::VALUE1 + **self == CCUDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCUDIV_A::VALUE2 + **self == CCUDIV_A::VALUE2 + } +} +impl core::ops::Deref for CCUDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CCUDIV`"] +#[doc = "Field `CCUDIV` writer - CCU Clock Divider Enable"] pub struct CCUDIV_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CCUDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fCCU = fSYS"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CCUDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn ccudiv(&mut self) -> CCUDIV_W { CCUDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CCU Clock Control Register\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 [ccuclkcr](index.html) module"] +pub struct CCUCLKCR_SPEC; +impl crate::RegisterSpec for CCUCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccuclkcr::R](R) reader structure"] +impl crate::Readable for CCUCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccuclkcr::W](W) writer structure"] +impl crate::Writable for CCUCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCUCLKCR to value 0"] +impl crate::Resettable for CCUCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatclr0.rs b/src/scu_clk/cgatclr0.rs index 253ad7b6..ec099a45 100644 --- a/src/scu_clk/cgatclr0.rs +++ b/src/scu_clk/cgatclr0.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATCLR0"] -pub type W = crate::W; -#[doc = "Register CGATCLR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATCLR0 { - type Type = u32; +#[doc = "Register `CGATCLR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VADC Gating Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VADC`"] +#[doc = "Field `VADC` writer - VADC Gating Clear"] pub struct VADC_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VADC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VADC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VADC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU40`"] +#[doc = "Field `CCU40` writer - CCU40 Gating Clear"] pub struct CCU40_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCU40_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU40_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCU40_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU41`"] +#[doc = "Field `CCU41` writer - CCU41 Gating Clear"] pub struct CCU41_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CCU41_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU41_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CCU41_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU80`"] +#[doc = "Field `CCU80` writer - CCU80 Gating Clear"] pub struct CCU80_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CCU80_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU80_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CCU80_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POSIF0`"] +#[doc = "Field `POSIF0` writer - POSIF0 Gating Clear"] pub struct POSIF0_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> POSIF0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSIF0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> POSIF0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC0`"] +#[doc = "Field `USIC0` writer - USIC0 Gating Clear"] pub struct USIC0_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> USIC0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> USIC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ERU1`"] +#[doc = "Field `ERU1` writer - ERU1 Gating Clear"] pub struct ERU1_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> ERU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> ERU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HRPWM0`"] +#[doc = "Field `HRPWM0` writer - HRPWM0 Gating Clear"] pub struct HRPWM0_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> HRPWM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRPWM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> HRPWM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn hrpwm0(&mut self) -> HRPWM0_W { HRPWM0_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 0 Clock Gating Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr0](index.html) module"] +pub struct CGATCLR0_SPEC; +impl crate::RegisterSpec for CGATCLR0_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatclr0::W](W) writer structure"] +impl crate::Writable for CGATCLR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATCLR0 to value 0"] +impl crate::Resettable for CGATCLR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatclr1.rs b/src/scu_clk/cgatclr1.rs index 0b8a4aff..68d07eb6 100644 --- a/src/scu_clk/cgatclr1.rs +++ b/src/scu_clk/cgatclr1.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATCLR1"] -pub type W = crate::W; -#[doc = "Register CGATCLR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATCLR1 { - type Type = u32; +#[doc = "Register `CGATCLR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "LEDTS Gating Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LEDTSCU0`"] +#[doc = "Field `LEDTSCU0` writer - LEDTS Gating Clear"] pub struct LEDTSCU0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> LEDTSCU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LEDTSCU0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> LEDTSCU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `MCAN0`"] +#[doc = "Field `MCAN0` writer - MultiCAN Gating Clear"] pub struct MCAN0_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> MCAN0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCAN0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> MCAN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DAC`"] +#[doc = "Field `DAC` writer - DAC Gating Clear"] pub struct DAC_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> DAC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DAC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> DAC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC1`"] +#[doc = "Field `USIC1` writer - USIC1 Gating Clear"] pub struct USIC1_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USIC1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USIC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PPORTS`"] +#[doc = "Field `PPORTS` writer - PORTS Gating Clear"] pub struct PPORTS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> PPORTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPORTS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> PPORTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -299,4 +300,26 @@ impl W { pub fn pports(&mut self) -> PPORTS_W { PPORTS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 1 Clock Gating Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr1](index.html) module"] +pub struct CGATCLR1_SPEC; +impl crate::RegisterSpec for CGATCLR1_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatclr1::W](W) writer structure"] +impl crate::Writable for CGATCLR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATCLR1 to value 0"] +impl crate::Resettable for CGATCLR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatclr2.rs b/src/scu_clk/cgatclr2.rs index 4fccaa08..293a9c70 100644 --- a/src/scu_clk/cgatclr2.rs +++ b/src/scu_clk/cgatclr2.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATCLR2"] -pub type W = crate::W; -#[doc = "Register CGATCLR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATCLR2 { - type Type = u32; +#[doc = "Register `CGATCLR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT Gating Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDT`"] +#[doc = "Field `WDT` writer - WDT Gating Clear"] pub struct WDT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> WDT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> WDT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DMA0`"] +#[doc = "Field `DMA0` writer - DMA0 Gating Clear"] pub struct DMA0_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> DMA0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMA0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> DMA0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FCE`"] +#[doc = "Field `FCE` writer - FCE Gating Clear"] pub struct FCE_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCE_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USB`"] +#[doc = "Field `USB` writer - USB Gating Clear"] pub struct USB_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn usb(&mut self) -> USB_W { USB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 2 Clock Gating Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatclr2](index.html) module"] +pub struct CGATCLR2_SPEC; +impl crate::RegisterSpec for CGATCLR2_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatclr2::W](W) writer structure"] +impl crate::Writable for CGATCLR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATCLR2 to value 0"] +impl crate::Resettable for CGATCLR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatset0.rs b/src/scu_clk/cgatset0.rs index 66e4fba1..d84c60c6 100644 --- a/src/scu_clk/cgatset0.rs +++ b/src/scu_clk/cgatset0.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATSET0"] -pub type W = crate::W; -#[doc = "Register CGATSET0 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATSET0 { - type Type = u32; +#[doc = "Register `CGATSET0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VADC Gating Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VADC`"] +#[doc = "Field `VADC` writer - VADC Gating Set"] pub struct VADC_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VADC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VADC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VADC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU40`"] +#[doc = "Field `CCU40` writer - CCU40 Gating Set"] pub struct CCU40_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCU40_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU40_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCU40_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU41`"] +#[doc = "Field `CCU41` writer - CCU41 Gating Set"] pub struct CCU41_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CCU41_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU41_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CCU41_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU80`"] +#[doc = "Field `CCU80` writer - CCU80 Gating Set"] pub struct CCU80_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CCU80_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU80_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CCU80_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POSIF0`"] +#[doc = "Field `POSIF0` writer - POSIF0 Gating Set"] pub struct POSIF0_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> POSIF0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSIF0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> POSIF0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC0`"] +#[doc = "Field `USIC0` writer - USIC0 Gating Set"] pub struct USIC0_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> USIC0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> USIC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ERU1`"] +#[doc = "Field `ERU1` writer - ERU1 Gating Set"] pub struct ERU1_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> ERU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> ERU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HRPWM0`"] +#[doc = "Field `HRPWM0` writer - HRPWM0 Gating Set"] pub struct HRPWM0_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> HRPWM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRPWM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> HRPWM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn hrpwm0(&mut self) -> HRPWM0_W { HRPWM0_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 0 Clock Gating Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset0](index.html) module"] +pub struct CGATSET0_SPEC; +impl crate::RegisterSpec for CGATSET0_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatset0::W](W) writer structure"] +impl crate::Writable for CGATSET0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATSET0 to value 0"] +impl crate::Resettable for CGATSET0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatset1.rs b/src/scu_clk/cgatset1.rs index be3648af..a8c02fa5 100644 --- a/src/scu_clk/cgatset1.rs +++ b/src/scu_clk/cgatset1.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATSET1"] -pub type W = crate::W; -#[doc = "Register CGATSET1 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATSET1 { - type Type = u32; +#[doc = "Register `CGATSET1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "LEDTS Gating Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LEDTSCU0`"] +#[doc = "Field `LEDTSCU0` writer - LEDTS Gating Set"] pub struct LEDTSCU0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> LEDTSCU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LEDTSCU0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> LEDTSCU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `MCAN0`"] +#[doc = "Field `MCAN0` writer - MultiCAN Gating Set"] pub struct MCAN0_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> MCAN0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCAN0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> MCAN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DAC`"] +#[doc = "Field `DAC` writer - DAC Gating Set"] pub struct DAC_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> DAC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DAC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> DAC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC1`"] +#[doc = "Field `USIC1` writer - USIC1 Gating Set"] pub struct USIC1_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USIC1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USIC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PPORTS`"] +#[doc = "Field `PPORTS` writer - PORTS Gating Set"] pub struct PPORTS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> PPORTS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPORTS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> PPORTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -299,4 +300,26 @@ impl W { pub fn pports(&mut self) -> PPORTS_W { PPORTS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 1 Clock Gating Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset1](index.html) module"] +pub struct CGATSET1_SPEC; +impl crate::RegisterSpec for CGATSET1_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatset1::W](W) writer structure"] +impl crate::Writable for CGATSET1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATSET1 to value 0"] +impl crate::Resettable for CGATSET1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatset2.rs b/src/scu_clk/cgatset2.rs index a2263cbd..d8264cf7 100644 --- a/src/scu_clk/cgatset2.rs +++ b/src/scu_clk/cgatset2.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CGATSET2"] -pub type W = crate::W; -#[doc = "Register CGATSET2 `reset()`'s with value 0"] -impl crate::ResetValue for super::CGATSET2 { - type Type = u32; +#[doc = "Register `CGATSET2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT Gating Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDT`"] +#[doc = "Field `WDT` writer - WDT Gating Set"] pub struct WDT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> WDT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> WDT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DMA0`"] +#[doc = "Field `DMA0` writer - DMA0 Gating Set"] pub struct DMA0_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> DMA0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMA0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> DMA0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FCE`"] +#[doc = "Field `FCE` writer - FCE Gating Set"] pub struct FCE_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCE_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USB`"] +#[doc = "Field `USB` writer - USB Gating Set"] pub struct USB_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn usb(&mut self) -> USB_W { USB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral 2 Clock Gating Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatset2](index.html) module"] +pub struct CGATSET2_SPEC; +impl crate::RegisterSpec for CGATSET2_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cgatset2::W](W) writer structure"] +impl crate::Writable for CGATSET2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CGATSET2 to value 0"] +impl crate::Resettable for CGATSET2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/cgatstat0.rs b/src/scu_clk/cgatstat0.rs index 84070ba2..adaacb13 100644 --- a/src/scu_clk/cgatstat0.rs +++ b/src/scu_clk/cgatstat0.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CGATSTAT0"] -pub type R = crate::R; +#[doc = "Register `CGATSTAT0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "VADC Gating Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VADC_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VADC`"] -pub type VADC_R = crate::R; +#[doc = "Field `VADC` reader - VADC Gating Status"] +pub struct VADC_R(crate::FieldReader); impl VADC_R { + pub(crate) fn new(bits: bool) -> Self { + VADC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VADC_A { @@ -28,12 +44,19 @@ impl VADC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VADC_A::VALUE1 + **self == VADC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VADC_A::VALUE2 + **self == VADC_A::VALUE2 + } +} +impl core::ops::Deref for VADC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU40 Gating Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU40`"] -pub type CCU40_R = crate::R; +#[doc = "Field `CCU40` reader - CCU40 Gating Status"] +pub struct CCU40_R(crate::FieldReader); impl CCU40_R { + pub(crate) fn new(bits: bool) -> Self { + CCU40_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU40_A { @@ -64,12 +90,19 @@ impl CCU40_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU40_A::VALUE1 + **self == CCU40_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU40_A::VALUE2 + **self == CCU40_A::VALUE2 + } +} +impl core::ops::Deref for CCU40_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU41 Gating Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU41`"] -pub type CCU41_R = crate::R; +#[doc = "Field `CCU41` reader - CCU41 Gating Status"] +pub struct CCU41_R(crate::FieldReader); impl CCU41_R { + pub(crate) fn new(bits: bool) -> Self { + CCU41_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU41_A { @@ -100,12 +136,19 @@ impl CCU41_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU41_A::VALUE1 + **self == CCU41_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU41_A::VALUE2 + **self == CCU41_A::VALUE2 + } +} +impl core::ops::Deref for CCU41_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU80 Gating Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU80`"] -pub type CCU80_R = crate::R; +#[doc = "Field `CCU80` reader - CCU80 Gating Status"] +pub struct CCU80_R(crate::FieldReader); impl CCU80_R { + pub(crate) fn new(bits: bool) -> Self { + CCU80_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU80_A { @@ -136,12 +182,19 @@ impl CCU80_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU80_A::VALUE1 + **self == CCU80_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU80_A::VALUE2 + **self == CCU80_A::VALUE2 + } +} +impl core::ops::Deref for CCU80_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "POSIF0 Gating Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `POSIF0`"] -pub type POSIF0_R = crate::R; +#[doc = "Field `POSIF0` reader - POSIF0 Gating Status"] +pub struct POSIF0_R(crate::FieldReader); impl POSIF0_R { + pub(crate) fn new(bits: bool) -> Self { + POSIF0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POSIF0_A { @@ -172,12 +228,19 @@ impl POSIF0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POSIF0_A::VALUE1 + **self == POSIF0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POSIF0_A::VALUE2 + **self == POSIF0_A::VALUE2 + } +} +impl core::ops::Deref for POSIF0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USIC0 Gating Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC0`"] -pub type USIC0_R = crate::R; +#[doc = "Field `USIC0` reader - USIC0 Gating Status"] +pub struct USIC0_R(crate::FieldReader); impl USIC0_R { + pub(crate) fn new(bits: bool) -> Self { + USIC0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC0_A { @@ -208,12 +274,19 @@ impl USIC0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC0_A::VALUE1 + **self == USIC0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC0_A::VALUE2 + **self == USIC0_A::VALUE2 + } +} +impl core::ops::Deref for USIC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "ERU1 Gating Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU1`"] -pub type ERU1_R = crate::R; +#[doc = "Field `ERU1` reader - ERU1 Gating Status"] +pub struct ERU1_R(crate::FieldReader); impl ERU1_R { + pub(crate) fn new(bits: bool) -> Self { + ERU1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU1_A { @@ -244,12 +320,19 @@ impl ERU1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU1_A::VALUE1 + **self == ERU1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU1_A::VALUE2 + **self == ERU1_A::VALUE2 + } +} +impl core::ops::Deref for ERU1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRPWM0 Gating Status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRPWM0`"] -pub type HRPWM0_R = crate::R; +#[doc = "Field `HRPWM0` reader - HRPWM0 Gating Status"] +pub struct HRPWM0_R(crate::FieldReader); impl HRPWM0_R { + pub(crate) fn new(bits: bool) -> Self { + HRPWM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRPWM0_A { @@ -280,12 +366,19 @@ impl HRPWM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRPWM0_A::VALUE1 + **self == HRPWM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRPWM0_A::VALUE2 + **self == HRPWM0_A::VALUE2 + } +} +impl core::ops::Deref for HRPWM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -330,3 +423,19 @@ impl R { HRPWM0_R::new(((self.bits >> 23) & 0x01) != 0) } } +#[doc = "Peripheral 0 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat0](index.html) module"] +pub struct CGATSTAT0_SPEC; +impl crate::RegisterSpec for CGATSTAT0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cgatstat0::R](R) reader structure"] +impl crate::Readable for CGATSTAT0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CGATSTAT0 to value 0"] +impl crate::Resettable for CGATSTAT0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_clk/cgatstat1.rs b/src/scu_clk/cgatstat1.rs index 09cb4c15..61b057fc 100644 --- a/src/scu_clk/cgatstat1.rs +++ b/src/scu_clk/cgatstat1.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CGATSTAT1"] -pub type R = crate::R; +#[doc = "Register `CGATSTAT1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "LEDTS Gating Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LEDTSCU0_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LEDTSCU0`"] -pub type LEDTSCU0_R = crate::R; +#[doc = "Field `LEDTSCU0` reader - LEDTS Gating Status"] +pub struct LEDTSCU0_R(crate::FieldReader); impl LEDTSCU0_R { + pub(crate) fn new(bits: bool) -> Self { + LEDTSCU0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LEDTSCU0_A { @@ -28,12 +44,19 @@ impl LEDTSCU0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LEDTSCU0_A::VALUE1 + **self == LEDTSCU0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LEDTSCU0_A::VALUE2 + **self == LEDTSCU0_A::VALUE2 + } +} +impl core::ops::Deref for LEDTSCU0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "MultiCAN Gating Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCAN0`"] -pub type MCAN0_R = crate::R; +#[doc = "Field `MCAN0` reader - MultiCAN Gating Status"] +pub struct MCAN0_R(crate::FieldReader); impl MCAN0_R { + pub(crate) fn new(bits: bool) -> Self { + MCAN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCAN0_A { @@ -64,12 +90,19 @@ impl MCAN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCAN0_A::VALUE1 + **self == MCAN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCAN0_A::VALUE2 + **self == MCAN0_A::VALUE2 + } +} +impl core::ops::Deref for MCAN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC Gating Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DAC`"] -pub type DAC_R = crate::R; +#[doc = "Field `DAC` reader - DAC Gating Status"] +pub struct DAC_R(crate::FieldReader); impl DAC_R { + pub(crate) fn new(bits: bool) -> Self { + DAC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DAC_A { @@ -100,12 +136,19 @@ impl DAC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DAC_A::VALUE1 + **self == DAC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DAC_A::VALUE2 + **self == DAC_A::VALUE2 + } +} +impl core::ops::Deref for DAC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USIC1 Gating Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC1`"] -pub type USIC1_R = crate::R; +#[doc = "Field `USIC1` reader - USIC1 Gating Status"] +pub struct USIC1_R(crate::FieldReader); impl USIC1_R { + pub(crate) fn new(bits: bool) -> Self { + USIC1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC1_A { @@ -136,12 +182,19 @@ impl USIC1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC1_A::VALUE1 + **self == USIC1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC1_A::VALUE2 + **self == USIC1_A::VALUE2 + } +} +impl core::ops::Deref for USIC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PORTS Gating Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPORTS`"] -pub type PPORTS_R = crate::R; +#[doc = "Field `PPORTS` reader - PORTS Gating Status"] +pub struct PPORTS_R(crate::FieldReader); impl PPORTS_R { + pub(crate) fn new(bits: bool) -> Self { + PPORTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPORTS_A { @@ -172,12 +228,19 @@ impl PPORTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPORTS_A::VALUE1 + **self == PPORTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPORTS_A::VALUE2 + **self == PPORTS_A::VALUE2 + } +} +impl core::ops::Deref for PPORTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -207,3 +270,19 @@ impl R { PPORTS_R::new(((self.bits >> 9) & 0x01) != 0) } } +#[doc = "Peripheral 1 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat1](index.html) module"] +pub struct CGATSTAT1_SPEC; +impl crate::RegisterSpec for CGATSTAT1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cgatstat1::R](R) reader structure"] +impl crate::Readable for CGATSTAT1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CGATSTAT1 to value 0"] +impl crate::Resettable for CGATSTAT1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_clk/cgatstat2.rs b/src/scu_clk/cgatstat2.rs index beccd85a..4f714b1c 100644 --- a/src/scu_clk/cgatstat2.rs +++ b/src/scu_clk/cgatstat2.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CGATSTAT2"] -pub type R = crate::R; +#[doc = "Register `CGATSTAT2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "WDT Gating Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WDT_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WDT`"] -pub type WDT_R = crate::R; +#[doc = "Field `WDT` reader - WDT Gating Status"] +pub struct WDT_R(crate::FieldReader); impl WDT_R { + pub(crate) fn new(bits: bool) -> Self { + WDT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDT_A { @@ -28,12 +44,19 @@ impl WDT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDT_A::VALUE1 + **self == WDT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDT_A::VALUE2 + **self == WDT_A::VALUE2 + } +} +impl core::ops::Deref for WDT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DMA0 Gating Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DMA0`"] -pub type DMA0_R = crate::R; +#[doc = "Field `DMA0` reader - DMA0 Gating Status"] +pub struct DMA0_R(crate::FieldReader); impl DMA0_R { + pub(crate) fn new(bits: bool) -> Self { + DMA0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DMA0_A { @@ -64,12 +90,19 @@ impl DMA0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DMA0_A::VALUE1 + **self == DMA0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DMA0_A::VALUE2 + **self == DMA0_A::VALUE2 + } +} +impl core::ops::Deref for DMA0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "FCE Gating Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCE`"] -pub type FCE_R = crate::R; +#[doc = "Field `FCE` reader - FCE Gating Status"] +pub struct FCE_R(crate::FieldReader); impl FCE_R { + pub(crate) fn new(bits: bool) -> Self { + FCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCE_A { @@ -100,12 +136,19 @@ impl FCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCE_A::VALUE1 + **self == FCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCE_A::VALUE2 + **self == FCE_A::VALUE2 + } +} +impl core::ops::Deref for FCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB Gating Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USB`"] -pub type USB_R = crate::R; +#[doc = "Field `USB` reader - USB Gating Status"] +pub struct USB_R(crate::FieldReader); impl USB_R { + pub(crate) fn new(bits: bool) -> Self { + USB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USB_A { @@ -136,12 +182,19 @@ impl USB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USB_A::VALUE1 + **self == USB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USB_A::VALUE2 + **self == USB_A::VALUE2 + } +} +impl core::ops::Deref for USB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -166,3 +219,19 @@ impl R { USB_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "Peripheral 2 Clock Gating Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cgatstat2](index.html) module"] +pub struct CGATSTAT2_SPEC; +impl crate::RegisterSpec for CGATSTAT2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cgatstat2::R](R) reader structure"] +impl crate::Readable for CGATSTAT2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CGATSTAT2 to value 0"] +impl crate::Resettable for CGATSTAT2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_clk/clkclr.rs b/src/scu_clk/clkclr.rs index ca7268a0..707ecb2a 100644 --- a/src/scu_clk/clkclr.rs +++ b/src/scu_clk/clkclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLKCLR"] -pub type W = crate::W; -#[doc = "Register CLKCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::CLKCLR { - type Type = u32; +#[doc = "Register `CLKCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "USB Clock Disable\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBCDI`"] +#[doc = "Field `USBCDI` writer - USB Clock Disable"] pub struct USBCDI_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> USBCDI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBCDI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> USBCDI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCUCDI`"] +#[doc = "Field `CCUCDI` writer - CCU Clock Disable"] pub struct CCUCDI_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCUCDI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUCDI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCUCDI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDTCDI`"] +#[doc = "Field `WDTCDI` writer - WDT Clock Disable"] pub struct WDTCDI_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> WDTCDI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTCDI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> WDTCDI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -183,4 +188,26 @@ impl W { pub fn wdtcdi(&mut self) -> WDTCDI_W { WDTCDI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CLK Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkclr](index.html) module"] +pub struct CLKCLR_SPEC; +impl crate::RegisterSpec for CLKCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clkclr::W](W) writer structure"] +impl crate::Writable for CLKCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLKCLR to value 0"] +impl crate::Resettable for CLKCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/clkset.rs b/src/scu_clk/clkset.rs index d78e4cd7..b17f80a1 100644 --- a/src/scu_clk/clkset.rs +++ b/src/scu_clk/clkset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CLKSET"] -pub type W = crate::W; -#[doc = "Register CLKSET `reset()`'s with value 0"] -impl crate::ResetValue for super::CLKSET { - type Type = u32; +#[doc = "Register `CLKSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "USB Clock Enable\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBCEN`"] +#[doc = "Field `USBCEN` writer - USB Clock Enable"] pub struct USBCEN_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> USBCEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBCEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> USBCEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCUCEN`"] +#[doc = "Field `CCUCEN` writer - CCU Clock Enable"] pub struct CCUCEN_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCUCEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUCEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCUCEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDTCEN`"] +#[doc = "Field `WDTCEN` writer - WDT Clock Enable"] pub struct WDTCEN_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> WDTCEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTCEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> WDTCEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -183,4 +188,26 @@ impl W { pub fn wdtcen(&mut self) -> WDTCEN_W { WDTCEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CLK Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkset](index.html) module"] +pub struct CLKSET_SPEC; +impl crate::RegisterSpec for CLKSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [clkset::W](W) writer structure"] +impl crate::Writable for CLKSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLKSET to value 0"] +impl crate::Resettable for CLKSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/clkstat.rs b/src/scu_clk/clkstat.rs index 5e061677..70bea5b2 100644 --- a/src/scu_clk/clkstat.rs +++ b/src/scu_clk/clkstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CLKSTAT"] -pub type R = crate::R; +#[doc = "Register `CLKSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "USB Clock Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum USBCST_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBCST`"] -pub type USBCST_R = crate::R; +#[doc = "Field `USBCST` reader - USB Clock Status"] +pub struct USBCST_R(crate::FieldReader); impl USBCST_R { + pub(crate) fn new(bits: bool) -> Self { + USBCST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBCST_A { @@ -28,12 +44,19 @@ impl USBCST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBCST_A::VALUE1 + **self == USBCST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBCST_A::VALUE2 + **self == USBCST_A::VALUE2 + } +} +impl core::ops::Deref for USBCST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU Clock Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCUCST`"] -pub type CCUCST_R = crate::R; +#[doc = "Field `CCUCST` reader - CCU Clock Status"] +pub struct CCUCST_R(crate::FieldReader); impl CCUCST_R { + pub(crate) fn new(bits: bool) -> Self { + CCUCST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCUCST_A { @@ -64,12 +90,19 @@ impl CCUCST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCUCST_A::VALUE1 + **self == CCUCST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCUCST_A::VALUE2 + **self == CCUCST_A::VALUE2 + } +} +impl core::ops::Deref for CCUCST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "WDT Clock Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WDTCST`"] -pub type WDTCST_R = crate::R; +#[doc = "Field `WDTCST` reader - WDT Clock Status"] +pub struct WDTCST_R(crate::FieldReader); impl WDTCST_R { + pub(crate) fn new(bits: bool) -> Self { + WDTCST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDTCST_A { @@ -100,12 +136,19 @@ impl WDTCST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTCST_A::VALUE1 + **self == WDTCST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTCST_A::VALUE2 + **self == WDTCST_A::VALUE2 + } +} +impl core::ops::Deref for WDTCST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -125,3 +168,19 @@ impl R { WDTCST_R::new(((self.bits >> 5) & 0x01) != 0) } } +#[doc = "Clock Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkstat](index.html) module"] +pub struct CLKSTAT_SPEC; +impl crate::RegisterSpec for CLKSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clkstat::R](R) reader structure"] +impl crate::Readable for CLKSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CLKSTAT to value 0"] +impl crate::Resettable for CLKSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_clk/cpuclkcr.rs b/src/scu_clk/cpuclkcr.rs index b4c0eb1c..89d4d74d 100644 --- a/src/scu_clk/cpuclkcr.rs +++ b/src/scu_clk/cpuclkcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CPUCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register CPUCLKCR"] -pub type W = crate::W; -#[doc = "Register CPUCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::CPUCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CPUCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CPUCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "CPU Clock Divider Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CPUDIV`"] -pub type CPUDIV_R = crate::R; +#[doc = "Field `CPUDIV` reader - CPU Clock Divider Enable"] +pub struct CPUDIV_R(crate::FieldReader); impl CPUDIV_R { + pub(crate) fn new(bits: bool) -> Self { + CPUDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CPUDIV_A { @@ -38,15 +65,22 @@ impl CPUDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CPUDIV_A::VALUE1 + **self == CPUDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CPUDIV_A::VALUE2 + **self == CPUDIV_A::VALUE2 + } +} +impl core::ops::Deref for CPUDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CPUDIV`"] +#[doc = "Field `CPUDIV` writer - CPU Clock Divider Enable"] pub struct CPUDIV_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CPUDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CPUDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fCPU = fSYS"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CPUDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn cpudiv(&mut self) -> CPUDIV_W { CPUDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CPU Clock Control Register\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 [cpuclkcr](index.html) module"] +pub struct CPUCLKCR_SPEC; +impl crate::RegisterSpec for CPUCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cpuclkcr::R](R) reader structure"] +impl crate::Readable for CPUCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cpuclkcr::W](W) writer structure"] +impl crate::Writable for CPUCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CPUCLKCR to value 0"] +impl crate::Resettable for CPUCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/dsleepcr.rs b/src/scu_clk/dsleepcr.rs index 2c02598e..cd95e0b2 100644 --- a/src/scu_clk/dsleepcr.rs +++ b/src/scu_clk/dsleepcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DSLEEPCR"] -pub type R = crate::R; -#[doc = "Writer for register DSLEEPCR"] -pub type W = crate::W; -#[doc = "Register DSLEEPCR `reset()`'s with value 0"] -impl crate::ResetValue for super::DSLEEPCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DSLEEPCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DSLEEPCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SYSSEL`"] -pub type SYSSEL_R = crate::R; +#[doc = "Field `SYSSEL` reader - System Clock Selection Value"] +pub struct SYSSEL_R(crate::FieldReader); impl SYSSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SYSSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYSSEL_A { @@ -38,15 +65,22 @@ impl SYSSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYSSEL_A::VALUE1 + **self == SYSSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYSSEL_A::VALUE2 + **self == SYSSEL_A::VALUE2 } } -#[doc = "Write proxy for field `SYSSEL`"] +impl core::ops::Deref for SYSSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SYSSEL` writer - System Clock Selection Value"] pub struct SYSSEL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYSSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOFI clock"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FPDN`"] -pub type FPDN_R = crate::R; +#[doc = "Field `FPDN` reader - Flash Power Down"] +pub struct FPDN_R(crate::FieldReader); impl FPDN_R { + pub(crate) fn new(bits: bool) -> Self { + FPDN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FPDN_A { @@ -113,15 +148,22 @@ impl FPDN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FPDN_A::VALUE1 + **self == FPDN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FPDN_A::VALUE2 + **self == FPDN_A::VALUE2 + } +} +impl core::ops::Deref for FPDN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FPDN`"] +#[doc = "Field `FPDN` writer - Flash Power Down"] pub struct FPDN_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> FPDN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FPDN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flash power down module"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> FPDN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLPDN`"] -pub type PLLPDN_R = crate::R; +#[doc = "Field `PLLPDN` reader - PLL Power Down"] +pub struct PLLPDN_R(crate::FieldReader); impl PLLPDN_R { + pub(crate) fn new(bits: bool) -> Self { + PLLPDN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLPDN_A { @@ -188,15 +231,22 @@ impl PLLPDN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLPDN_A::VALUE1 + **self == PLLPDN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLPDN_A::VALUE2 + **self == PLLPDN_A::VALUE2 } } -#[doc = "Write proxy for field `PLLPDN`"] +impl core::ops::Deref for PLLPDN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PLLPDN` writer - PLL Power Down"] pub struct PLLPDN_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PLLPDN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PLLPDN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Switch off main PLL"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PLLPDN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOPDN`"] -pub type VCOPDN_R = crate::R; +#[doc = "Field `VCOPDN` reader - VCO Power Down"] +pub struct VCOPDN_R(crate::FieldReader); impl VCOPDN_R { + pub(crate) fn new(bits: bool) -> Self { + VCOPDN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOPDN_A { @@ -263,15 +314,22 @@ impl VCOPDN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOPDN_A::VALUE1 + **self == VCOPDN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOPDN_A::VALUE2 + **self == VCOPDN_A::VALUE2 + } +} +impl core::ops::Deref for VCOPDN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VCOPDN`"] +#[doc = "Field `VCOPDN` writer - VCO Power Down"] pub struct VCOPDN_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> VCOPDN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOPDN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Switch off VCO of main PLL"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> VCOPDN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBCR`"] -pub type USBCR_R = crate::R; +#[doc = "Field `USBCR` reader - USB Clock Control"] +pub struct USBCR_R(crate::FieldReader); impl USBCR_R { + pub(crate) fn new(bits: bool) -> Self { + USBCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBCR_A { @@ -338,15 +397,22 @@ impl USBCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBCR_A::VALUE1 + **self == USBCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBCR_A::VALUE2 + **self == USBCR_A::VALUE2 } } -#[doc = "Write proxy for field `USBCR`"] +impl core::ops::Deref for USBCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBCR` writer - USB Clock Control"] pub struct USBCR_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> USBCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> USBCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCUCR`"] -pub type CCUCR_R = crate::R; +#[doc = "Field `CCUCR` reader - CCU Clock Control"] +pub struct CCUCR_R(crate::FieldReader); impl CCUCR_R { + pub(crate) fn new(bits: bool) -> Self { + CCUCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCUCR_A { @@ -413,15 +480,22 @@ impl CCUCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCUCR_A::VALUE1 + **self == CCUCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCUCR_A::VALUE2 + **self == CCUCR_A::VALUE2 } } -#[doc = "Write proxy for field `CCUCR`"] +impl core::ops::Deref for CCUCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCUCR` writer - CCU Clock Control"] pub struct CCUCR_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> CCUCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> CCUCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WDTCR`"] -pub type WDTCR_R = crate::R; +#[doc = "Field `WDTCR` reader - WDT Clock Control"] +pub struct WDTCR_R(crate::FieldReader); impl WDTCR_R { + pub(crate) fn new(bits: bool) -> Self { + WDTCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDTCR_A { @@ -488,15 +563,22 @@ impl WDTCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTCR_A::VALUE1 + **self == WDTCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTCR_A::VALUE2 + **self == WDTCR_A::VALUE2 + } +} +impl core::ops::Deref for WDTCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WDTCR`"] +#[doc = "Field `WDTCR` writer - WDT Clock Control"] pub struct WDTCR_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> WDTCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> WDTCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn wdtcr(&mut self) -> WDTCR_W { WDTCR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deep Sleep Control Register\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 [dsleepcr](index.html) module"] +pub struct DSLEEPCR_SPEC; +impl crate::RegisterSpec for DSLEEPCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dsleepcr::R](R) reader structure"] +impl crate::Readable for DSLEEPCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dsleepcr::W](W) writer structure"] +impl crate::Writable for DSLEEPCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DSLEEPCR to value 0"] +impl crate::Resettable for DSLEEPCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/extclkcr.rs b/src/scu_clk/extclkcr.rs index 35af1cc6..ef9b4b48 100644 --- a/src/scu_clk/extclkcr.rs +++ b/src/scu_clk/extclkcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register EXTCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register EXTCLKCR"] -pub type W = crate::W; -#[doc = "Register EXTCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::EXTCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `EXTCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXTCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "External Clock Selection Value\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ECKSEL`"] -pub type ECKSEL_R = crate::R; +#[doc = "Field `ECKSEL` reader - External Clock Selection Value"] +pub struct ECKSEL_R(crate::FieldReader); impl ECKSEL_R { + pub(crate) fn new(bits: u8) -> Self { + ECKSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ECKSEL_A::VALUE1), - 2 => Val(ECKSEL_A::VALUE3), - 3 => Val(ECKSEL_A::VALUE4), - 4 => Val(ECKSEL_A::VALUE5), - i => Res(i), + 0 => Some(ECKSEL_A::VALUE1), + 2 => Some(ECKSEL_A::VALUE3), + 3 => Some(ECKSEL_A::VALUE4), + 4 => Some(ECKSEL_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ECKSEL_A::VALUE1 + **self == ECKSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ECKSEL_A::VALUE3 + **self == ECKSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ECKSEL_A::VALUE4 + **self == ECKSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == ECKSEL_A::VALUE5 + **self == ECKSEL_A::VALUE5 + } +} +impl core::ops::Deref for ECKSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ECKSEL`"] +#[doc = "Field `ECKSEL` writer - External Clock Selection Value"] pub struct ECKSEL_W<'a> { w: &'a mut W, } @@ -98,13 +131,25 @@ impl<'a> ECKSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `ECKDIV`"] -pub type ECKDIV_R = crate::R; -#[doc = "Write proxy for field `ECKDIV`"] +#[doc = "Field `ECKDIV` reader - External Clock Divider Value"] +pub struct ECKDIV_R(crate::FieldReader); +impl ECKDIV_R { + pub(crate) fn new(bits: u16) -> Self { + ECKDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ECKDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ECKDIV` writer - External Clock Divider Value"] pub struct ECKDIV_W<'a> { w: &'a mut W, } @@ -112,7 +157,7 @@ impl<'a> ECKDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01ff << 16)) | (((value as u32) & 0x01ff) << 16); + self.w.bits = (self.w.bits & !(0x01ff << 16)) | ((value as u32 & 0x01ff) << 16); self.w } } @@ -139,4 +184,30 @@ impl W { pub fn eckdiv(&mut self) -> ECKDIV_W { ECKDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External Clock Control\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 [extclkcr](index.html) module"] +pub struct EXTCLKCR_SPEC; +impl crate::RegisterSpec for EXTCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [extclkcr::R](R) reader structure"] +impl crate::Readable for EXTCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [extclkcr::W](W) writer structure"] +impl crate::Writable for EXTCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXTCLKCR to value 0"] +impl crate::Resettable for EXTCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/mlinkclkcr.rs b/src/scu_clk/mlinkclkcr.rs index c7a53f43..cc124c0e 100644 --- a/src/scu_clk/mlinkclkcr.rs +++ b/src/scu_clk/mlinkclkcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register MLINKCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register MLINKCLKCR"] -pub type W = crate::W; -#[doc = "Register MLINKCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::MLINKCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MLINKCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MLINKCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `SYSDIV`"] -pub type SYSDIV_R = crate::R; -#[doc = "Write proxy for field `SYSDIV`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SYSDIV` reader - System Clock Division Value"] +pub struct SYSDIV_R(crate::FieldReader); +impl SYSDIV_R { + pub(crate) fn new(bits: u8) -> Self { + SYSDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SYSDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SYSDIV` writer - System Clock Division Value"] pub struct SYSDIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SYSDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SYSSEL`"] -pub type SYSSEL_R = crate::R; +#[doc = "Field `SYSSEL` reader - System Clock Selection Value"] +pub struct SYSSEL_R(crate::FieldReader); impl SYSSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SYSSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYSSEL_A { @@ -52,15 +91,22 @@ impl SYSSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYSSEL_A::VALUE1 + **self == SYSSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYSSEL_A::VALUE2 + **self == SYSSEL_A::VALUE2 + } +} +impl core::ops::Deref for SYSSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SYSSEL`"] +#[doc = "Field `SYSSEL` writer - System Clock Selection Value"] pub struct SYSSEL_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYSSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOFI clock"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -113,9 +157,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CPUDIV`"] -pub type CPUDIV_R = crate::R; +#[doc = "Field `CPUDIV` reader - CPU Clock Divider Enable"] +pub struct CPUDIV_R(crate::FieldReader); impl CPUDIV_R { + pub(crate) fn new(bits: bool) -> Self { + CPUDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CPUDIV_A { @@ -127,15 +174,22 @@ impl CPUDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CPUDIV_A::VALUE1 + **self == CPUDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CPUDIV_A::VALUE2 + **self == CPUDIV_A::VALUE2 } } -#[doc = "Write proxy for field `CPUDIV`"] +impl core::ops::Deref for CPUDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPUDIV` writer - CPU Clock Divider Enable"] pub struct CPUDIV_W<'a> { w: &'a mut W, } @@ -143,9 +197,7 @@ impl<'a> CPUDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CPUDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fCPU = fSYS"] #[inline(always)] @@ -170,7 +222,7 @@ impl<'a> CPUDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -188,9 +240,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PBDIV`"] -pub type PBDIV_R = crate::R; +#[doc = "Field `PBDIV` reader - PB Clock Divider Enable"] +pub struct PBDIV_R(crate::FieldReader); impl PBDIV_R { + pub(crate) fn new(bits: bool) -> Self { + PBDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PBDIV_A { @@ -202,15 +257,22 @@ impl PBDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PBDIV_A::VALUE1 + **self == PBDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PBDIV_A::VALUE2 + **self == PBDIV_A::VALUE2 + } +} +impl core::ops::Deref for PBDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PBDIV`"] +#[doc = "Field `PBDIV` writer - PB Clock Divider Enable"] pub struct PBDIV_W<'a> { w: &'a mut W, } @@ -218,9 +280,7 @@ impl<'a> PBDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PBDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fPERIPH = fCPU"] #[inline(always)] @@ -245,7 +305,7 @@ impl<'a> PBDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -263,9 +323,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCUDIV`"] -pub type CCUDIV_R = crate::R; +#[doc = "Field `CCUDIV` reader - CCU Clock Divider Enable"] +pub struct CCUDIV_R(crate::FieldReader); impl CCUDIV_R { + pub(crate) fn new(bits: bool) -> Self { + CCUDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCUDIV_A { @@ -277,15 +340,22 @@ impl CCUDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCUDIV_A::VALUE1 + **self == CCUDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCUDIV_A::VALUE2 + **self == CCUDIV_A::VALUE2 + } +} +impl core::ops::Deref for CCUDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CCUDIV`"] +#[doc = "Field `CCUDIV` writer - CCU Clock Divider Enable"] pub struct CCUDIV_W<'a> { w: &'a mut W, } @@ -293,9 +363,7 @@ impl<'a> CCUDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fCCU = fSYS"] #[inline(always)] @@ -320,13 +388,25 @@ impl<'a> CCUDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `WDTDIV`"] -pub type WDTDIV_R = crate::R; -#[doc = "Write proxy for field `WDTDIV`"] +#[doc = "Field `WDTDIV` reader - WDT Clock Divider Value"] +pub struct WDTDIV_R(crate::FieldReader); +impl WDTDIV_R { + pub(crate) fn new(bits: u8) -> Self { + WDTDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WDTDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WDTDIV` writer - WDT Clock Divider Value"] pub struct WDTDIV_W<'a> { w: &'a mut W, } @@ -334,7 +414,7 @@ impl<'a> WDTDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } @@ -355,37 +435,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `WDTSEL`"] -pub type WDTSEL_R = crate::R; +#[doc = "Field `WDTSEL` reader - WDT Clock Selection Value"] +pub struct WDTSEL_R(crate::FieldReader); impl WDTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + WDTSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(WDTSEL_A::VALUE1), - 1 => Val(WDTSEL_A::VALUE2), - 2 => Val(WDTSEL_A::VALUE3), - i => Res(i), + 0 => Some(WDTSEL_A::VALUE1), + 1 => Some(WDTSEL_A::VALUE2), + 2 => Some(WDTSEL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTSEL_A::VALUE1 + **self == WDTSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTSEL_A::VALUE2 + **self == WDTSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == WDTSEL_A::VALUE3 + **self == WDTSEL_A::VALUE3 } } -#[doc = "Write proxy for field `WDTSEL`"] +impl core::ops::Deref for WDTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WDTSEL` writer - WDT Clock Selection Value"] pub struct WDTSEL_W<'a> { w: &'a mut W, } @@ -413,7 +502,7 @@ impl<'a> WDTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -490,4 +579,30 @@ impl W { pub fn wdtsel(&mut self) -> WDTSEL_W { WDTSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Multi-Link Clock Control\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 [mlinkclkcr](index.html) module"] +pub struct MLINKCLKCR_SPEC; +impl crate::RegisterSpec for MLINKCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mlinkclkcr::R](R) reader structure"] +impl crate::Readable for MLINKCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mlinkclkcr::W](W) writer structure"] +impl crate::Writable for MLINKCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MLINKCLKCR to value 0"] +impl crate::Resettable for MLINKCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/pbclkcr.rs b/src/scu_clk/pbclkcr.rs index c4a0d81c..76b7713d 100644 --- a/src/scu_clk/pbclkcr.rs +++ b/src/scu_clk/pbclkcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PBCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register PBCLKCR"] -pub type W = crate::W; -#[doc = "Register PBCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::PBCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PBCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PBCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "PB Clock Divider Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PBDIV`"] -pub type PBDIV_R = crate::R; +#[doc = "Field `PBDIV` reader - PB Clock Divider Enable"] +pub struct PBDIV_R(crate::FieldReader); impl PBDIV_R { + pub(crate) fn new(bits: bool) -> Self { + PBDIV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PBDIV_A { @@ -38,15 +65,22 @@ impl PBDIV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PBDIV_A::VALUE1 + **self == PBDIV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PBDIV_A::VALUE2 + **self == PBDIV_A::VALUE2 + } +} +impl core::ops::Deref for PBDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PBDIV`"] +#[doc = "Field `PBDIV` writer - PB Clock Divider Enable"] pub struct PBDIV_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PBDIV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PBDIV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fPERIPH = fCPU"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PBDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn pbdiv(&mut self) -> PBDIV_W { PBDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral Bus Clock Control Register\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 [pbclkcr](index.html) module"] +pub struct PBCLKCR_SPEC; +impl crate::RegisterSpec for PBCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pbclkcr::R](R) reader structure"] +impl crate::Readable for PBCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pbclkcr::W](W) writer structure"] +impl crate::Writable for PBCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PBCLKCR to value 0"] +impl crate::Resettable for PBCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/sleepcr.rs b/src/scu_clk/sleepcr.rs index e03ee2c8..6766f8db 100644 --- a/src/scu_clk/sleepcr.rs +++ b/src/scu_clk/sleepcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SLEEPCR"] -pub type R = crate::R; -#[doc = "Writer for register SLEEPCR"] -pub type W = crate::W; -#[doc = "Register SLEEPCR `reset()`'s with value 0"] -impl crate::ResetValue for super::SLEEPCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SLEEPCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SLEEPCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SYSSEL`"] -pub type SYSSEL_R = crate::R; +#[doc = "Field `SYSSEL` reader - System Clock Selection Value"] +pub struct SYSSEL_R(crate::FieldReader); impl SYSSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SYSSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYSSEL_A { @@ -38,15 +65,22 @@ impl SYSSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYSSEL_A::VALUE1 + **self == SYSSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYSSEL_A::VALUE2 + **self == SYSSEL_A::VALUE2 } } -#[doc = "Write proxy for field `SYSSEL`"] +impl core::ops::Deref for SYSSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SYSSEL` writer - System Clock Selection Value"] pub struct SYSSEL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYSSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOFI clock"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBCR`"] -pub type USBCR_R = crate::R; +#[doc = "Field `USBCR` reader - USB Clock Control"] +pub struct USBCR_R(crate::FieldReader); impl USBCR_R { + pub(crate) fn new(bits: bool) -> Self { + USBCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBCR_A { @@ -113,15 +148,22 @@ impl USBCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBCR_A::VALUE1 + **self == USBCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBCR_A::VALUE2 + **self == USBCR_A::VALUE2 } } -#[doc = "Write proxy for field `USBCR`"] +impl core::ops::Deref for USBCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBCR` writer - USB Clock Control"] pub struct USBCR_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> USBCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> USBCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCUCR`"] -pub type CCUCR_R = crate::R; +#[doc = "Field `CCUCR` reader - CCU Clock Control"] +pub struct CCUCR_R(crate::FieldReader); impl CCUCR_R { + pub(crate) fn new(bits: bool) -> Self { + CCUCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCUCR_A { @@ -188,15 +231,22 @@ impl CCUCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCUCR_A::VALUE1 + **self == CCUCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCUCR_A::VALUE2 + **self == CCUCR_A::VALUE2 + } +} +impl core::ops::Deref for CCUCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CCUCR`"] +#[doc = "Field `CCUCR` writer - CCU Clock Control"] pub struct CCUCR_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CCUCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCUCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CCUCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WDTCR`"] -pub type WDTCR_R = crate::R; +#[doc = "Field `WDTCR` reader - WDT Clock Control"] +pub struct WDTCR_R(crate::FieldReader); impl WDTCR_R { + pub(crate) fn new(bits: bool) -> Self { + WDTCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDTCR_A { @@ -263,15 +314,22 @@ impl WDTCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTCR_A::VALUE1 + **self == WDTCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTCR_A::VALUE2 + **self == WDTCR_A::VALUE2 + } +} +impl core::ops::Deref for WDTCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WDTCR`"] +#[doc = "Field `WDTCR` writer - WDT Clock Control"] pub struct WDTCR_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> WDTCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> WDTCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -353,4 +409,30 @@ impl W { pub fn wdtcr(&mut self) -> WDTCR_W { WDTCR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sleep Control Register\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 [sleepcr](index.html) module"] +pub struct SLEEPCR_SPEC; +impl crate::RegisterSpec for SLEEPCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sleepcr::R](R) reader structure"] +impl crate::Readable for SLEEPCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sleepcr::W](W) writer structure"] +impl crate::Writable for SLEEPCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SLEEPCR to value 0"] +impl crate::Resettable for SLEEPCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/sysclkcr.rs b/src/scu_clk/sysclkcr.rs index b1233325..743184bc 100644 --- a/src/scu_clk/sysclkcr.rs +++ b/src/scu_clk/sysclkcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register SYSCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register SYSCLKCR"] -pub type W = crate::W; -#[doc = "Register SYSCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::SYSCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SYSCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `SYSDIV`"] -pub type SYSDIV_R = crate::R; -#[doc = "Write proxy for field `SYSDIV`"] +#[doc = "Register `SYSCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SYSDIV` reader - System Clock Division Value"] +pub struct SYSDIV_R(crate::FieldReader); +impl SYSDIV_R { + pub(crate) fn new(bits: u8) -> Self { + SYSDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SYSDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SYSDIV` writer - System Clock Division Value"] pub struct SYSDIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SYSDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SYSSEL`"] -pub type SYSSEL_R = crate::R; +#[doc = "Field `SYSSEL` reader - System Clock Selection Value"] +pub struct SYSSEL_R(crate::FieldReader); impl SYSSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SYSSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYSSEL_A { @@ -52,15 +91,22 @@ impl SYSSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYSSEL_A::VALUE1 + **self == SYSSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYSSEL_A::VALUE2 + **self == SYSSEL_A::VALUE2 + } +} +impl core::ops::Deref for SYSSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SYSSEL`"] +#[doc = "Field `SYSSEL` writer - System Clock Selection Value"] pub struct SYSSEL_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYSSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOFI clock"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> SYSSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -122,4 +166,30 @@ impl W { pub fn syssel(&mut self) -> SYSSEL_W { SYSSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System Clock Control Register\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 [sysclkcr](index.html) module"] +pub struct SYSCLKCR_SPEC; +impl crate::RegisterSpec for SYSCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sysclkcr::R](R) reader structure"] +impl crate::Readable for SYSCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sysclkcr::W](W) writer structure"] +impl crate::Writable for SYSCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYSCLKCR to value 0"] +impl crate::Resettable for SYSCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/usbclkcr.rs b/src/scu_clk/usbclkcr.rs index 9db89e75..e50e05a0 100644 --- a/src/scu_clk/usbclkcr.rs +++ b/src/scu_clk/usbclkcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register USBCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register USBCLKCR"] -pub type W = crate::W; -#[doc = "Register USBCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::USBCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `USBCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `USBDIV`"] -pub type USBDIV_R = crate::R; -#[doc = "Write proxy for field `USBDIV`"] +#[doc = "Register `USBCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `USBDIV` reader - USB Clock Divider Value"] +pub struct USBDIV_R(crate::FieldReader); +impl USBDIV_R { + pub(crate) fn new(bits: u8) -> Self { + USBDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBDIV` writer - USB Clock Divider Value"] pub struct USBDIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> USBDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBSEL`"] -pub type USBSEL_R = crate::R; +#[doc = "Field `USBSEL` reader - USB Clock Selection Value"] +pub struct USBSEL_R(crate::FieldReader); impl USBSEL_R { + pub(crate) fn new(bits: bool) -> Self { + USBSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBSEL_A { @@ -52,15 +91,22 @@ impl USBSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBSEL_A::VALUE1 + **self == USBSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBSEL_A::VALUE2 + **self == USBSEL_A::VALUE2 + } +} +impl core::ops::Deref for USBSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `USBSEL`"] +#[doc = "Field `USBSEL` writer - USB Clock Selection Value"] pub struct USBSEL_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> USBSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "USB PLL Clock"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> USBSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -122,4 +166,30 @@ impl W { pub fn usbsel(&mut self) -> USBSEL_W { USBSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "USB Clock Control Register\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 [usbclkcr](index.html) module"] +pub struct USBCLKCR_SPEC; +impl crate::RegisterSpec for USBCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [usbclkcr::R](R) reader structure"] +impl crate::Readable for USBCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [usbclkcr::W](W) writer structure"] +impl crate::Writable for USBCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets USBCLKCR to value 0"] +impl crate::Resettable for USBCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_clk/wdtclkcr.rs b/src/scu_clk/wdtclkcr.rs index 22a3d3e4..bf794325 100644 --- a/src/scu_clk/wdtclkcr.rs +++ b/src/scu_clk/wdtclkcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register WDTCLKCR"] -pub type R = crate::R; -#[doc = "Writer for register WDTCLKCR"] -pub type W = crate::W; -#[doc = "Register WDTCLKCR `reset()`'s with value 0"] -impl crate::ResetValue for super::WDTCLKCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `WDTCLKCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WDTCLKCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `WDTDIV` reader - WDT Clock Divider Value"] +pub struct WDTDIV_R(crate::FieldReader); +impl WDTDIV_R { + pub(crate) fn new(bits: u8) -> Self { + WDTDIV_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `WDTDIV`"] -pub type WDTDIV_R = crate::R; -#[doc = "Write proxy for field `WDTDIV`"] +impl core::ops::Deref for WDTDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WDTDIV` writer - WDT Clock Divider Value"] pub struct WDTDIV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> WDTDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -41,37 +77,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `WDTSEL`"] -pub type WDTSEL_R = crate::R; +#[doc = "Field `WDTSEL` reader - WDT Clock Selection Value"] +pub struct WDTSEL_R(crate::FieldReader); impl WDTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + WDTSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(WDTSEL_A::VALUE1), - 1 => Val(WDTSEL_A::VALUE2), - 2 => Val(WDTSEL_A::VALUE3), - i => Res(i), + 0 => Some(WDTSEL_A::VALUE1), + 1 => Some(WDTSEL_A::VALUE2), + 2 => Some(WDTSEL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTSEL_A::VALUE1 + **self == WDTSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTSEL_A::VALUE2 + **self == WDTSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == WDTSEL_A::VALUE3 + **self == WDTSEL_A::VALUE3 } } -#[doc = "Write proxy for field `WDTSEL`"] +impl core::ops::Deref for WDTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WDTSEL` writer - WDT Clock Selection Value"] pub struct WDTSEL_W<'a> { w: &'a mut W, } @@ -99,7 +144,7 @@ impl<'a> WDTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -126,4 +171,30 @@ impl W { pub fn wdtsel(&mut self) -> WDTSEL_W { WDTSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Clock Control Register\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 [wdtclkcr](index.html) module"] +pub struct WDTCLKCR_SPEC; +impl crate::RegisterSpec for WDTCLKCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wdtclkcr::R](R) reader structure"] +impl crate::Readable for WDTCLKCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wdtclkcr::W](W) writer structure"] +impl crate::Writable for WDTCLKCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WDTCLKCR to value 0"] +impl crate::Resettable for WDTCLKCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general.rs b/src/scu_general.rs index 1bc8af4c..1746da06 100644 --- a/src/scu_general.rs +++ b/src/scu_general.rs @@ -2,227 +2,117 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - SCU Module ID Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x04 - Chip ID Register"] - pub idchip: IDCHIP, + pub idchip: crate::Reg, #[doc = "0x08 - Manufactory ID Register"] - pub idmanuf: IDMANUF, - _reserved3: [u8; 4usize], + pub idmanuf: crate::Reg, + _reserved3: [u8; 0x04], #[doc = "0x10 - Startup Configuration Register"] - pub stcon: STCON, - _reserved4: [u8; 24usize], + pub stcon: crate::Reg, + _reserved4: [u8; 0x18], #[doc = "0x2c - General Purpose Register 0"] - pub gpr0: GPR0, + pub gpr0: crate::Reg, #[doc = "0x30 - General Purpose Register 1"] - pub gpr1: GPR1, - _reserved6: [u8; 24usize], + pub gpr1: crate::Reg, + _reserved6: [u8; 0x18], #[doc = "0x4c - CCU Control Register"] - pub ccucon: CCUCON, - _reserved7: [u8; 60usize], + pub ccucon: crate::Reg, + _reserved7: [u8; 0x3c], #[doc = "0x8c - Die Temperature Sensor Control Register"] - pub dtscon: DTSCON, + pub dtscon: crate::Reg, #[doc = "0x90 - Die Temperature Sensor Status Register"] - pub dtsstat: DTSSTAT, - _reserved9: [u8; 12usize], + pub dtsstat: crate::Reg, + _reserved9: [u8; 0x0c], #[doc = "0xa0 - Out of Range Comparator Enable Register 0"] - pub g0orcen: G0ORCEN, + pub g0orcen: crate::Reg, #[doc = "0xa4 - Out of Range Comparator Enable Register 1"] - pub g1orcen: G1ORCEN, + pub g1orcen: crate::Reg, #[doc = "0xa8 - Die Temperature Sensor Limit Register"] - pub dtemplim: DTEMPLIM, + pub dtemplim: crate::Reg, #[doc = "0xac - Die Temperature Sensor Alarm Register"] - pub dtempalarm: DTEMPALARM, - _reserved13: [u8; 20usize], + pub dtempalarm: crate::Reg, + _reserved13: [u8; 0x14], #[doc = "0xc4 - Mirror Write Status Register"] - pub mirrsts: MIRRSTS, + pub mirrsts: crate::Reg, #[doc = "0xc8 - Retention Memory Access Control Register"] - pub rmacr: RMACR, + pub rmacr: crate::Reg, #[doc = "0xcc - Retention Memory Access Data Register"] - pub rmdata: RMDATA, + pub rmdata: crate::Reg, #[doc = "0xd0 - Mirror All Status"] - pub mirrallstat: MIRRALLSTAT, + pub mirrallstat: crate::Reg, #[doc = "0xd4 - Mirror All Request"] - pub mirrallreq: MIRRALLREQ, + pub mirrallreq: crate::Reg, } -#[doc = "SCU Module ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "SCU Module ID Register"] pub mod id; -#[doc = "Chip ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idchip](idchip) module"] -pub type IDCHIP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IDCHIP; -#[doc = "`read()` method returns [idchip::R](idchip::R) reader structure"] -impl crate::Readable for IDCHIP {} +#[doc = "IDCHIP register accessor: an alias for `Reg`"] +pub type IDCHIP = crate::Reg; #[doc = "Chip ID Register"] pub mod idchip; -#[doc = "Manufactory ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idmanuf](idmanuf) module"] -pub type IDMANUF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IDMANUF; -#[doc = "`read()` method returns [idmanuf::R](idmanuf::R) reader structure"] -impl crate::Readable for IDMANUF {} +#[doc = "IDMANUF register accessor: an alias for `Reg`"] +pub type IDMANUF = crate::Reg; #[doc = "Manufactory ID Register"] pub mod idmanuf; -#[doc = "Startup Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stcon](stcon) module"] -pub type STCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _STCON; -#[doc = "`read()` method returns [stcon::R](stcon::R) reader structure"] -impl crate::Readable for STCON {} -#[doc = "`write(|w| ..)` method takes [stcon::W](stcon::W) writer structure"] -impl crate::Writable for STCON {} +#[doc = "STCON register accessor: an alias for `Reg`"] +pub type STCON = crate::Reg; #[doc = "Startup Configuration Register"] pub mod stcon; -#[doc = "General Purpose Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpr0](gpr0) module"] -pub type GPR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GPR0; -#[doc = "`read()` method returns [gpr0::R](gpr0::R) reader structure"] -impl crate::Readable for GPR0 {} -#[doc = "`write(|w| ..)` method takes [gpr0::W](gpr0::W) writer structure"] -impl crate::Writable for GPR0 {} +#[doc = "GPR0 register accessor: an alias for `Reg`"] +pub type GPR0 = crate::Reg; #[doc = "General Purpose Register 0"] pub mod gpr0; -#[doc = "General Purpose Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpr1](gpr1) module"] -pub type GPR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GPR1; -#[doc = "`read()` method returns [gpr1::R](gpr1::R) reader structure"] -impl crate::Readable for GPR1 {} -#[doc = "`write(|w| ..)` method takes [gpr1::W](gpr1::W) writer structure"] -impl crate::Writable for GPR1 {} +#[doc = "GPR1 register accessor: an alias for `Reg`"] +pub type GPR1 = crate::Reg; #[doc = "General Purpose Register 1"] pub mod gpr1; -#[doc = "CCU Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccucon](ccucon) module"] -pub type CCUCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CCUCON; -#[doc = "`read()` method returns [ccucon::R](ccucon::R) reader structure"] -impl crate::Readable for CCUCON {} -#[doc = "`write(|w| ..)` method takes [ccucon::W](ccucon::W) writer structure"] -impl crate::Writable for CCUCON {} +#[doc = "CCUCON register accessor: an alias for `Reg`"] +pub type CCUCON = crate::Reg; #[doc = "CCU Control Register"] pub mod ccucon; -#[doc = "Die Temperature Sensor Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtscon](dtscon) module"] -pub type DTSCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTSCON; -#[doc = "`read()` method returns [dtscon::R](dtscon::R) reader structure"] -impl crate::Readable for DTSCON {} -#[doc = "`write(|w| ..)` method takes [dtscon::W](dtscon::W) writer structure"] -impl crate::Writable for DTSCON {} +#[doc = "DTSCON register accessor: an alias for `Reg`"] +pub type DTSCON = crate::Reg; #[doc = "Die Temperature Sensor Control Register"] pub mod dtscon; -#[doc = "Die Temperature Sensor Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtsstat](dtsstat) module"] -pub type DTSSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTSSTAT; -#[doc = "`read()` method returns [dtsstat::R](dtsstat::R) reader structure"] -impl crate::Readable for DTSSTAT {} +#[doc = "DTSSTAT register accessor: an alias for `Reg`"] +pub type DTSSTAT = crate::Reg; #[doc = "Die Temperature Sensor Status Register"] pub mod dtsstat; -#[doc = "Out of Range Comparator Enable Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [g0orcen](g0orcen) module"] -pub type G0ORCEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _G0ORCEN; -#[doc = "`read()` method returns [g0orcen::R](g0orcen::R) reader structure"] -impl crate::Readable for G0ORCEN {} -#[doc = "`write(|w| ..)` method takes [g0orcen::W](g0orcen::W) writer structure"] -impl crate::Writable for G0ORCEN {} +#[doc = "G0ORCEN register accessor: an alias for `Reg`"] +pub type G0ORCEN = crate::Reg; #[doc = "Out of Range Comparator Enable Register 0"] pub mod g0orcen; -#[doc = "Out of Range Comparator Enable Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [g1orcen](g1orcen) module"] -pub type G1ORCEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _G1ORCEN; -#[doc = "`read()` method returns [g1orcen::R](g1orcen::R) reader structure"] -impl crate::Readable for G1ORCEN {} -#[doc = "`write(|w| ..)` method takes [g1orcen::W](g1orcen::W) writer structure"] -impl crate::Writable for G1ORCEN {} +#[doc = "G1ORCEN register accessor: an alias for `Reg`"] +pub type G1ORCEN = crate::Reg; #[doc = "Out of Range Comparator Enable Register 1"] pub mod g1orcen; -#[doc = "Die Temperature Sensor Limit Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtemplim](dtemplim) module"] -pub type DTEMPLIM = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTEMPLIM; -#[doc = "`read()` method returns [dtemplim::R](dtemplim::R) reader structure"] -impl crate::Readable for DTEMPLIM {} -#[doc = "`write(|w| ..)` method takes [dtemplim::W](dtemplim::W) writer structure"] -impl crate::Writable for DTEMPLIM {} +#[doc = "DTEMPLIM register accessor: an alias for `Reg`"] +pub type DTEMPLIM = crate::Reg; #[doc = "Die Temperature Sensor Limit Register"] pub mod dtemplim; -#[doc = "Die Temperature Sensor Alarm Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtempalarm](dtempalarm) module"] -pub type DTEMPALARM = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTEMPALARM; -#[doc = "`read()` method returns [dtempalarm::R](dtempalarm::R) reader structure"] -impl crate::Readable for DTEMPALARM {} +#[doc = "DTEMPALARM register accessor: an alias for `Reg`"] +pub type DTEMPALARM = crate::Reg; #[doc = "Die Temperature Sensor Alarm Register"] pub mod dtempalarm; -#[doc = "Mirror Write Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrsts](mirrsts) module"] -pub type MIRRSTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIRRSTS; -#[doc = "`read()` method returns [mirrsts::R](mirrsts::R) reader structure"] -impl crate::Readable for MIRRSTS {} +#[doc = "MIRRSTS register accessor: an alias for `Reg`"] +pub type MIRRSTS = crate::Reg; #[doc = "Mirror Write Status Register"] pub mod mirrsts; -#[doc = "Retention Memory Access Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rmacr](rmacr) module"] -pub type RMACR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RMACR; -#[doc = "`read()` method returns [rmacr::R](rmacr::R) reader structure"] -impl crate::Readable for RMACR {} -#[doc = "`write(|w| ..)` method takes [rmacr::W](rmacr::W) writer structure"] -impl crate::Writable for RMACR {} +#[doc = "RMACR register accessor: an alias for `Reg`"] +pub type RMACR = crate::Reg; #[doc = "Retention Memory Access Control Register"] pub mod rmacr; -#[doc = "Retention Memory Access Data Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rmdata](rmdata) module"] -pub type RMDATA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RMDATA; -#[doc = "`read()` method returns [rmdata::R](rmdata::R) reader structure"] -impl crate::Readable for RMDATA {} -#[doc = "`write(|w| ..)` method takes [rmdata::W](rmdata::W) writer structure"] -impl crate::Writable for RMDATA {} +#[doc = "RMDATA register accessor: an alias for `Reg`"] +pub type RMDATA = crate::Reg; #[doc = "Retention Memory Access Data Register"] pub mod rmdata; -#[doc = "Mirror All Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrallstat](mirrallstat) module"] -pub type MIRRALLSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIRRALLSTAT; -#[doc = "`read()` method returns [mirrallstat::R](mirrallstat::R) reader structure"] -impl crate::Readable for MIRRALLSTAT {} +#[doc = "MIRRALLSTAT register accessor: an alias for `Reg`"] +pub type MIRRALLSTAT = crate::Reg; #[doc = "Mirror All Status"] pub mod mirrallstat; -#[doc = "Mirror All Request\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrallreq](mirrallreq) module"] -pub type MIRRALLREQ = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MIRRALLREQ; -#[doc = "`write(|w| ..)` method takes [mirrallreq::W](mirrallreq::W) writer structure"] -impl crate::Writable for MIRRALLREQ {} +#[doc = "MIRRALLREQ register accessor: an alias for `Reg`"] +pub type MIRRALLREQ = crate::Reg; #[doc = "Mirror All Request"] pub mod mirrallreq; diff --git a/src/scu_general/ccucon.rs b/src/scu_general/ccucon.rs index 6d981c61..ddb02a51 100644 --- a/src/scu_general/ccucon.rs +++ b/src/scu_general/ccucon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CCUCON"] -pub type R = crate::R; -#[doc = "Writer for register CCUCON"] -pub type W = crate::W; -#[doc = "Register CCUCON `reset()`'s with value 0"] -impl crate::ResetValue for super::CCUCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CCUCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCUCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Global Start Control CCU40\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GSC40`"] -pub type GSC40_R = crate::R; +#[doc = "Field `GSC40` reader - Global Start Control CCU40"] +pub struct GSC40_R(crate::FieldReader); impl GSC40_R { + pub(crate) fn new(bits: bool) -> Self { + GSC40_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GSC40_A { @@ -38,15 +65,22 @@ impl GSC40_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GSC40_A::VALUE1 + **self == GSC40_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GSC40_A::VALUE2 + **self == GSC40_A::VALUE2 } } -#[doc = "Write proxy for field `GSC40`"] +impl core::ops::Deref for GSC40_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GSC40` writer - Global Start Control CCU40"] pub struct GSC40_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> GSC40_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GSC40_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> GSC40_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GSC41`"] -pub type GSC41_R = crate::R; +#[doc = "Field `GSC41` reader - Global Start Control CCU41"] +pub struct GSC41_R(crate::FieldReader); impl GSC41_R { + pub(crate) fn new(bits: bool) -> Self { + GSC41_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GSC41_A { @@ -113,15 +148,22 @@ impl GSC41_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GSC41_A::VALUE1 + **self == GSC41_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GSC41_A::VALUE2 + **self == GSC41_A::VALUE2 } } -#[doc = "Write proxy for field `GSC41`"] +impl core::ops::Deref for GSC41_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GSC41` writer - Global Start Control CCU41"] pub struct GSC41_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> GSC41_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GSC41_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> GSC41_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GSC80`"] -pub type GSC80_R = crate::R; +#[doc = "Field `GSC80` reader - Global Start Control CCU80"] +pub struct GSC80_R(crate::FieldReader); impl GSC80_R { + pub(crate) fn new(bits: bool) -> Self { + GSC80_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GSC80_A { @@ -188,15 +231,22 @@ impl GSC80_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GSC80_A::VALUE1 + **self == GSC80_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GSC80_A::VALUE2 + **self == GSC80_A::VALUE2 + } +} +impl core::ops::Deref for GSC80_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GSC80`"] +#[doc = "Field `GSC80` writer - Global Start Control CCU80"] pub struct GSC80_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> GSC80_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GSC80_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> GSC80_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GSHR0`"] -pub type GSHR0_R = crate::R; +#[doc = "Field `GSHR0` reader - Global Start Control HRPWM0"] +pub struct GSHR0_R(crate::FieldReader); impl GSHR0_R { + pub(crate) fn new(bits: bool) -> Self { + GSHR0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GSHR0_A { @@ -263,15 +314,22 @@ impl GSHR0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GSHR0_A::VALUE1 + **self == GSHR0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GSHR0_A::VALUE2 + **self == GSHR0_A::VALUE2 + } +} +impl core::ops::Deref for GSHR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GSHR0`"] +#[doc = "Field `GSHR0` writer - Global Start Control HRPWM0"] pub struct GSHR0_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> GSHR0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GSHR0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> GSHR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -353,4 +409,30 @@ impl W { pub fn gshr0(&mut self) -> GSHR0_W { GSHR0_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CCU Control Register\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 [ccucon](index.html) module"] +pub struct CCUCON_SPEC; +impl crate::RegisterSpec for CCUCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccucon::R](R) reader structure"] +impl crate::Readable for CCUCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccucon::W](W) writer structure"] +impl crate::Writable for CCUCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCUCON to value 0"] +impl crate::Resettable for CCUCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/dtempalarm.rs b/src/scu_general/dtempalarm.rs index 30a353d0..d8682617 100644 --- a/src/scu_general/dtempalarm.rs +++ b/src/scu_general/dtempalarm.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register DTEMPALARM"] -pub type R = crate::R; +#[doc = "Register `DTEMPALARM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Lower Limit Underflow\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum UNDERFL_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UNDERFL`"] -pub type UNDERFL_R = crate::R; +#[doc = "Field `UNDERFL` reader - Lower Limit Underflow"] +pub struct UNDERFL_R(crate::FieldReader); impl UNDERFL_R { + pub(crate) fn new(bits: bool) -> Self { + UNDERFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UNDERFL_A { @@ -28,12 +44,19 @@ impl UNDERFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UNDERFL_A::VALUE1 + **self == UNDERFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UNDERFL_A::VALUE2 + **self == UNDERFL_A::VALUE2 + } +} +impl core::ops::Deref for UNDERFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Upper Limit Overflow\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OVERFL`"] -pub type OVERFL_R = crate::R; +#[doc = "Field `OVERFL` reader - Upper Limit Overflow"] +pub struct OVERFL_R(crate::FieldReader); impl OVERFL_R { + pub(crate) fn new(bits: bool) -> Self { + OVERFL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OVERFL_A { @@ -64,12 +90,19 @@ impl OVERFL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OVERFL_A::VALUE1 + **self == OVERFL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OVERFL_A::VALUE2 + **self == OVERFL_A::VALUE2 + } +} +impl core::ops::Deref for OVERFL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -84,3 +117,19 @@ impl R { OVERFL_R::new(((self.bits >> 16) & 0x01) != 0) } } +#[doc = "Die Temperature Sensor Alarm Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtempalarm](index.html) module"] +pub struct DTEMPALARM_SPEC; +impl crate::RegisterSpec for DTEMPALARM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtempalarm::R](R) reader structure"] +impl crate::Readable for DTEMPALARM_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DTEMPALARM to value 0"] +impl crate::Resettable for DTEMPALARM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_general/dtemplim.rs b/src/scu_general/dtemplim.rs index 6c2555d4..7a554d5f 100644 --- a/src/scu_general/dtemplim.rs +++ b/src/scu_general/dtemplim.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DTEMPLIM"] -pub type R = crate::R; -#[doc = "Writer for register DTEMPLIM"] -pub type W = crate::W; -#[doc = "Register DTEMPLIM `reset()`'s with value 0"] -impl crate::ResetValue for super::DTEMPLIM { - type Type = u32; +#[doc = "Register `DTEMPLIM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DTEMPLIM` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LOWER` reader - Lower Limit"] +pub struct LOWER_R(crate::FieldReader); +impl LOWER_R { + pub(crate) fn new(bits: u16) -> Self { + LOWER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOWER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `LOWER`"] -pub type LOWER_R = crate::R; -#[doc = "Write proxy for field `LOWER`"] +#[doc = "Field `LOWER` writer - Lower Limit"] pub struct LOWER_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> LOWER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } -#[doc = "Reader of field `UPPER`"] -pub type UPPER_R = crate::R; -#[doc = "Write proxy for field `UPPER`"] +#[doc = "Field `UPPER` reader - Upper Limit"] +pub struct UPPER_R(crate::FieldReader); +impl UPPER_R { + pub(crate) fn new(bits: u16) -> Self { + UPPER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UPPER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UPPER` writer - Upper Limit"] pub struct UPPER_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> UPPER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 16)) | (((value as u32) & 0x03ff) << 16); + self.w.bits = (self.w.bits & !(0x03ff << 16)) | ((value as u32 & 0x03ff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn upper(&mut self) -> UPPER_W { UPPER_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Die Temperature Sensor Limit Register\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 [dtemplim](index.html) module"] +pub struct DTEMPLIM_SPEC; +impl crate::RegisterSpec for DTEMPLIM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtemplim::R](R) reader structure"] +impl crate::Readable for DTEMPLIM_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dtemplim::W](W) writer structure"] +impl crate::Writable for DTEMPLIM_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DTEMPLIM to value 0"] +impl crate::Resettable for DTEMPLIM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/dtscon.rs b/src/scu_general/dtscon.rs index 1a6de52d..fb7b5b9a 100644 --- a/src/scu_general/dtscon.rs +++ b/src/scu_general/dtscon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DTSCON"] -pub type R = crate::R; -#[doc = "Writer for register DTSCON"] -pub type W = crate::W; -#[doc = "Register DTSCON `reset()`'s with value 0x01"] -impl crate::ResetValue for super::DTSCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `DTSCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DTSCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Sensor Power Down\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PWD`"] -pub type PWD_R = crate::R; +#[doc = "Field `PWD` reader - Sensor Power Down"] +pub struct PWD_R(crate::FieldReader); impl PWD_R { + pub(crate) fn new(bits: bool) -> Self { + PWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PWD_A { @@ -38,15 +65,22 @@ impl PWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PWD_A::VALUE1 + **self == PWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PWD_A::VALUE2 + **self == PWD_A::VALUE2 + } +} +impl core::ops::Deref for PWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PWD`"] +#[doc = "Field `PWD` writer - Sensor Power Down"] pub struct PWD_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The DTS is powered"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,7 +131,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `START`"] +#[doc = "Field `START` writer - Sensor Measurement Start"] pub struct START_W<'a> { w: &'a mut W, } @@ -107,9 +139,7 @@ impl<'a> START_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: START_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No DTS measurement is started"] #[inline(always)] @@ -134,13 +164,25 @@ impl<'a> START_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `OFFSET`"] -pub type OFFSET_R = crate::R; -#[doc = "Write proxy for field `OFFSET`"] +#[doc = "Field `OFFSET` reader - Offset Calibration Value"] +pub struct OFFSET_R(crate::FieldReader); +impl OFFSET_R { + pub(crate) fn new(bits: u8) -> Self { + OFFSET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OFFSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFSET` writer - Offset Calibration Value"] pub struct OFFSET_W<'a> { w: &'a mut W, } @@ -148,13 +190,25 @@ impl<'a> OFFSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x7f << 4)) | (((value as u32) & 0x7f) << 4); + self.w.bits = (self.w.bits & !(0x7f << 4)) | ((value as u32 & 0x7f) << 4); self.w } } -#[doc = "Reader of field `GAIN`"] -pub type GAIN_R = crate::R; -#[doc = "Write proxy for field `GAIN`"] +#[doc = "Field `GAIN` reader - Gain Calibration Value"] +pub struct GAIN_R(crate::FieldReader); +impl GAIN_R { + pub(crate) fn new(bits: u8) -> Self { + GAIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GAIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GAIN` writer - Gain Calibration Value"] pub struct GAIN_W<'a> { w: &'a mut W, } @@ -162,13 +216,25 @@ impl<'a> GAIN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 11)) | (((value as u32) & 0x3f) << 11); + self.w.bits = (self.w.bits & !(0x3f << 11)) | ((value as u32 & 0x3f) << 11); self.w } } -#[doc = "Reader of field `REFTRIM`"] -pub type REFTRIM_R = crate::R; -#[doc = "Write proxy for field `REFTRIM`"] +#[doc = "Field `REFTRIM` reader - Reference Trim Calibration Value"] +pub struct REFTRIM_R(crate::FieldReader); +impl REFTRIM_R { + pub(crate) fn new(bits: u8) -> Self { + REFTRIM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REFTRIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFTRIM` writer - Reference Trim Calibration Value"] pub struct REFTRIM_W<'a> { w: &'a mut W, } @@ -176,13 +242,25 @@ impl<'a> REFTRIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 17)) | (((value as u32) & 0x07) << 17); + self.w.bits = (self.w.bits & !(0x07 << 17)) | ((value as u32 & 0x07) << 17); self.w } } -#[doc = "Reader of field `BGTRIM`"] -pub type BGTRIM_R = crate::R; -#[doc = "Write proxy for field `BGTRIM`"] +#[doc = "Field `BGTRIM` reader - Bandgap Trim Calibration Value"] +pub struct BGTRIM_R(crate::FieldReader); +impl BGTRIM_R { + pub(crate) fn new(bits: u8) -> Self { + BGTRIM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BGTRIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BGTRIM` writer - Bandgap Trim Calibration Value"] pub struct BGTRIM_W<'a> { w: &'a mut W, } @@ -190,7 +268,7 @@ impl<'a> BGTRIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } @@ -252,4 +330,30 @@ impl W { pub fn bgtrim(&mut self) -> BGTRIM_W { BGTRIM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Die Temperature Sensor Control Register\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 [dtscon](index.html) module"] +pub struct DTSCON_SPEC; +impl crate::RegisterSpec for DTSCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtscon::R](R) reader structure"] +impl crate::Readable for DTSCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dtscon::W](W) writer structure"] +impl crate::Writable for DTSCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DTSCON to value 0x01"] +impl crate::Resettable for DTSCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/scu_general/dtsstat.rs b/src/scu_general/dtsstat.rs index 61b3f4d0..4acd57f9 100644 --- a/src/scu_general/dtsstat.rs +++ b/src/scu_general/dtsstat.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DTSSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; +#[doc = "Register `DTSSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RESULT` reader - Result of the DTS Measurement"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Sensor Ready Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RDY_A { @@ -16,9 +41,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDY`"] -pub type RDY_R = crate::R; +#[doc = "Field `RDY` reader - Sensor Ready Status"] +pub struct RDY_R(crate::FieldReader); impl RDY_R { + pub(crate) fn new(bits: bool) -> Self { + RDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDY_A { @@ -30,12 +58,19 @@ impl RDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDY_A::VALUE1 + **self == RDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDY_A::VALUE2 + **self == RDY_A::VALUE2 + } +} +impl core::ops::Deref for RDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sensor Busy Status\n\nValue on reset: 0"] @@ -52,9 +87,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BUSY`"] -pub type BUSY_R = crate::R; +#[doc = "Field `BUSY` reader - Sensor Busy Status"] +pub struct BUSY_R(crate::FieldReader); impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BUSY_A { @@ -66,12 +104,19 @@ impl BUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BUSY_A::VALUE1 + **self == BUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BUSY_A::VALUE2 + **self == BUSY_A::VALUE2 + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -91,3 +136,19 @@ impl R { BUSY_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Die Temperature Sensor Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtsstat](index.html) module"] +pub struct DTSSTAT_SPEC; +impl crate::RegisterSpec for DTSSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtsstat::R](R) reader structure"] +impl crate::Readable for DTSSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DTSSTAT to value 0"] +impl crate::Resettable for DTSSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_general/g0orcen.rs b/src/scu_general/g0orcen.rs index 26aa2c90..ea4c1aa9 100644 --- a/src/scu_general/g0orcen.rs +++ b/src/scu_general/g0orcen.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register G0ORCEN"] -pub type R = crate::R; -#[doc = "Writer for register G0ORCEN"] -pub type W = crate::W; -#[doc = "Register G0ORCEN `reset()`'s with value 0"] -impl crate::ResetValue for super::G0ORCEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `G0ORCEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `G0ORCEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable Out of Range Comparator, Channel 6\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENORC6`"] -pub type ENORC6_R = crate::R; +#[doc = "Field `ENORC6` reader - Enable Out of Range Comparator, Channel 6"] +pub struct ENORC6_R(crate::FieldReader); impl ENORC6_R { + pub(crate) fn new(bits: bool) -> Self { + ENORC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENORC6_A { @@ -38,15 +65,22 @@ impl ENORC6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENORC6_A::VALUE1 + **self == ENORC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENORC6_A::VALUE2 + **self == ENORC6_A::VALUE2 } } -#[doc = "Write proxy for field `ENORC6`"] +impl core::ops::Deref for ENORC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENORC6` writer - Enable Out of Range Comparator, Channel 6"] pub struct ENORC6_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ENORC6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENORC6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ENORC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENORC7`"] -pub type ENORC7_R = crate::R; +#[doc = "Field `ENORC7` reader - Enable Out of Range Comparator, Channel 7"] +pub struct ENORC7_R(crate::FieldReader); impl ENORC7_R { + pub(crate) fn new(bits: bool) -> Self { + ENORC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENORC7_A { @@ -113,15 +148,22 @@ impl ENORC7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENORC7_A::VALUE1 + **self == ENORC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENORC7_A::VALUE2 + **self == ENORC7_A::VALUE2 + } +} +impl core::ops::Deref for ENORC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENORC7`"] +#[doc = "Field `ENORC7` writer - Enable Out of Range Comparator, Channel 7"] pub struct ENORC7_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> ENORC7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENORC7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> ENORC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -183,4 +223,30 @@ impl W { pub fn enorc7(&mut self) -> ENORC7_W { ENORC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Out of Range Comparator Enable Register 0\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 [g0orcen](index.html) module"] +pub struct G0ORCEN_SPEC; +impl crate::RegisterSpec for G0ORCEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [g0orcen::R](R) reader structure"] +impl crate::Readable for G0ORCEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [g0orcen::W](W) writer structure"] +impl crate::Writable for G0ORCEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets G0ORCEN to value 0"] +impl crate::Resettable for G0ORCEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/g1orcen.rs b/src/scu_general/g1orcen.rs index f1433660..78a53caf 100644 --- a/src/scu_general/g1orcen.rs +++ b/src/scu_general/g1orcen.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register G1ORCEN"] -pub type R = crate::R; -#[doc = "Writer for register G1ORCEN"] -pub type W = crate::W; -#[doc = "Register G1ORCEN `reset()`'s with value 0"] -impl crate::ResetValue for super::G1ORCEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `G1ORCEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `G1ORCEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable Out of Range Comparator, Channel 6\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENORC6`"] -pub type ENORC6_R = crate::R; +#[doc = "Field `ENORC6` reader - Enable Out of Range Comparator, Channel 6"] +pub struct ENORC6_R(crate::FieldReader); impl ENORC6_R { + pub(crate) fn new(bits: bool) -> Self { + ENORC6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENORC6_A { @@ -38,15 +65,22 @@ impl ENORC6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENORC6_A::VALUE1 + **self == ENORC6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENORC6_A::VALUE2 + **self == ENORC6_A::VALUE2 } } -#[doc = "Write proxy for field `ENORC6`"] +impl core::ops::Deref for ENORC6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENORC6` writer - Enable Out of Range Comparator, Channel 6"] pub struct ENORC6_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ENORC6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENORC6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ENORC6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENORC7`"] -pub type ENORC7_R = crate::R; +#[doc = "Field `ENORC7` reader - Enable Out of Range Comparator, Channel 7"] +pub struct ENORC7_R(crate::FieldReader); impl ENORC7_R { + pub(crate) fn new(bits: bool) -> Self { + ENORC7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENORC7_A { @@ -113,15 +148,22 @@ impl ENORC7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENORC7_A::VALUE1 + **self == ENORC7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENORC7_A::VALUE2 + **self == ENORC7_A::VALUE2 + } +} +impl core::ops::Deref for ENORC7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENORC7`"] +#[doc = "Field `ENORC7` writer - Enable Out of Range Comparator, Channel 7"] pub struct ENORC7_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> ENORC7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENORC7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> ENORC7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -183,4 +223,30 @@ impl W { pub fn enorc7(&mut self) -> ENORC7_W { ENORC7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Out of Range Comparator Enable Register 1\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 [g1orcen](index.html) module"] +pub struct G1ORCEN_SPEC; +impl crate::RegisterSpec for G1ORCEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [g1orcen::R](R) reader structure"] +impl crate::Readable for G1ORCEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [g1orcen::W](W) writer structure"] +impl crate::Writable for G1ORCEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets G1ORCEN to value 0"] +impl crate::Resettable for G1ORCEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/gpr0.rs b/src/scu_general/gpr0.rs index c9a04045..546ee5e0 100644 --- a/src/scu_general/gpr0.rs +++ b/src/scu_general/gpr0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GPR0"] -pub type R = crate::R; -#[doc = "Writer for register GPR0"] -pub type W = crate::W; -#[doc = "Register GPR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::GPR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GPR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GPR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DAT`"] -pub type DAT_R = crate::R; -#[doc = "Write proxy for field `DAT`"] +#[doc = "Field `DAT` reader - User Data"] +pub struct DAT_R(crate::FieldReader); +impl DAT_R { + pub(crate) fn new(bits: u32) -> Self { + DAT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAT` writer - User Data"] pub struct DAT_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dat(&mut self) -> DAT_W { DAT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "General Purpose Register 0\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 [gpr0](index.html) module"] +pub struct GPR0_SPEC; +impl crate::RegisterSpec for GPR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gpr0::R](R) reader structure"] +impl crate::Readable for GPR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gpr0::W](W) writer structure"] +impl crate::Writable for GPR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GPR0 to value 0"] +impl crate::Resettable for GPR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/gpr1.rs b/src/scu_general/gpr1.rs index 15440c55..38a5690a 100644 --- a/src/scu_general/gpr1.rs +++ b/src/scu_general/gpr1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GPR1"] -pub type R = crate::R; -#[doc = "Writer for register GPR1"] -pub type W = crate::W; -#[doc = "Register GPR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::GPR1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GPR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GPR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DAT`"] -pub type DAT_R = crate::R; -#[doc = "Write proxy for field `DAT`"] +#[doc = "Field `DAT` reader - User Data"] +pub struct DAT_R(crate::FieldReader); +impl DAT_R { + pub(crate) fn new(bits: u32) -> Self { + DAT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAT` writer - User Data"] pub struct DAT_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DAT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dat(&mut self) -> DAT_W { DAT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "General Purpose Register 1\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 [gpr1](index.html) module"] +pub struct GPR1_SPEC; +impl crate::RegisterSpec for GPR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gpr1::R](R) reader structure"] +impl crate::Readable for GPR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gpr1::W](W) writer structure"] +impl crate::Writable for GPR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GPR1 to value 0"] +impl crate::Resettable for GPR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/id.rs b/src/scu_general/id.rs index f22f9749..49a410ea 100644 --- a/src/scu_general/id.rs +++ b/src/scu_general/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "SCU Module ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x009a_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x009a_c000 + } +} diff --git a/src/scu_general/idchip.rs b/src/scu_general/idchip.rs index 8b7478de..7f503d6a 100644 --- a/src/scu_general/idchip.rs +++ b/src/scu_general/idchip.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register IDCHIP"] -pub type R = crate::R; -#[doc = "Reader of field `IDCHIP`"] -pub type IDCHIP_R = crate::R; +#[doc = "Register `IDCHIP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `IDCHIP` reader - Chip ID"] +pub struct IDCHIP_R(crate::FieldReader); +impl IDCHIP_R { + pub(crate) fn new(bits: u32) -> Self { + IDCHIP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IDCHIP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Chip ID"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { IDCHIP_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "Chip ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idchip](index.html) module"] +pub struct IDCHIP_SPEC; +impl crate::RegisterSpec for IDCHIP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [idchip::R](R) reader structure"] +impl crate::Readable for IDCHIP_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IDCHIP to value 0"] +impl crate::Resettable for IDCHIP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_general/idmanuf.rs b/src/scu_general/idmanuf.rs index 6b276d3e..f7ef2b47 100644 --- a/src/scu_general/idmanuf.rs +++ b/src/scu_general/idmanuf.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register IDMANUF"] -pub type R = crate::R; -#[doc = "Reader of field `DEPT`"] -pub type DEPT_R = crate::R; -#[doc = "Reader of field `MANUF`"] -pub type MANUF_R = crate::R; +#[doc = "Register `IDMANUF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DEPT` reader - Department Identification Number"] +pub struct DEPT_R(crate::FieldReader); +impl DEPT_R { + pub(crate) fn new(bits: u8) -> Self { + DEPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MANUF` reader - Manufacturer Identification Number"] +pub struct MANUF_R(crate::FieldReader); +impl MANUF_R { + pub(crate) fn new(bits: u16) -> Self { + MANUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MANUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:4 - Department Identification Number"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { MANUF_R::new(((self.bits >> 5) & 0x07ff) as u16) } } +#[doc = "Manufactory ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idmanuf](index.html) module"] +pub struct IDMANUF_SPEC; +impl crate::RegisterSpec for IDMANUF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [idmanuf::R](R) reader structure"] +impl crate::Readable for IDMANUF_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IDMANUF to value 0x1820"] +impl crate::Resettable for IDMANUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1820 + } +} diff --git a/src/scu_general/mirrallreq.rs b/src/scu_general/mirrallreq.rs index 9081a4e9..13ac6d25 100644 --- a/src/scu_general/mirrallreq.rs +++ b/src/scu_general/mirrallreq.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register MIRRALLREQ"] -pub type W = crate::W; -#[doc = "Register MIRRALLREQ `reset()`'s with value 0"] -impl crate::ResetValue for super::MIRRALLREQ { - type Type = u32; +#[doc = "Register `MIRRALLREQ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Mirror All Execution Request\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REQ`"] +#[doc = "Field `REQ` writer - Mirror All Execution Request"] pub struct REQ_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> REQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> REQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -67,4 +76,26 @@ impl W { pub fn req(&mut self) -> REQ_W { REQ_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mirror All Request\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrallreq](index.html) module"] +pub struct MIRRALLREQ_SPEC; +impl crate::RegisterSpec for MIRRALLREQ_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [mirrallreq::W](W) writer structure"] +impl crate::Writable for MIRRALLREQ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MIRRALLREQ to value 0"] +impl crate::Resettable for MIRRALLREQ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/mirrallstat.rs b/src/scu_general/mirrallstat.rs index a8cea586..483270b5 100644 --- a/src/scu_general/mirrallstat.rs +++ b/src/scu_general/mirrallstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register MIRRALLSTAT"] -pub type R = crate::R; +#[doc = "Register `MIRRALLSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Mirror All Execution Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum BUSY_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BUSY`"] -pub type BUSY_R = crate::R; +#[doc = "Field `BUSY` reader - Mirror All Execution Status"] +pub struct BUSY_R(crate::FieldReader); impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BUSY_A { @@ -28,12 +44,19 @@ impl BUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BUSY_A::VALUE1 + **self == BUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BUSY_A::VALUE2 + **self == BUSY_A::VALUE2 + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { BUSY_R::new((self.bits & 0x01) != 0) } } +#[doc = "Mirror All Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrallstat](index.html) module"] +pub struct MIRRALLSTAT_SPEC; +impl crate::RegisterSpec for MIRRALLSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mirrallstat::R](R) reader structure"] +impl crate::Readable for MIRRALLSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIRRALLSTAT to value 0"] +impl crate::Resettable for MIRRALLSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_general/mirrsts.rs b/src/scu_general/mirrsts.rs index 7602db43..d21f67dd 100644 --- a/src/scu_general/mirrsts.rs +++ b/src/scu_general/mirrsts.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register MIRRSTS"] -pub type R = crate::R; +#[doc = "Register `MIRRSTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "HDCLR Mirror Register Write Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HDCLR_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCLR`"] -pub type HDCLR_R = crate::R; +#[doc = "Field `HDCLR` reader - HDCLR Mirror Register Write Status"] +pub struct HDCLR_R(crate::FieldReader); impl HDCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCLR_A { @@ -28,12 +44,19 @@ impl HDCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCLR_A::VALUE1 + **self == HDCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCLR_A::VALUE2 + **self == HDCLR_A::VALUE2 + } +} +impl core::ops::Deref for HDCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDSET Mirror Register Write Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDSET`"] -pub type HDSET_R = crate::R; +#[doc = "Field `HDSET` reader - HDSET Mirror Register Write Status"] +pub struct HDSET_R(crate::FieldReader); impl HDSET_R { + pub(crate) fn new(bits: bool) -> Self { + HDSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDSET_A { @@ -64,12 +90,19 @@ impl HDSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDSET_A::VALUE1 + **self == HDSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDSET_A::VALUE2 + **self == HDSET_A::VALUE2 + } +} +impl core::ops::Deref for HDSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDCR Mirror Register Write Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCR`"] -pub type HDCR_R = crate::R; +#[doc = "Field `HDCR` reader - HDCR Mirror Register Write Status"] +pub struct HDCR_R(crate::FieldReader); impl HDCR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCR_A { @@ -100,12 +136,19 @@ impl HDCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCR_A::VALUE1 + **self == HDCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCR_A::VALUE2 + **self == HDCR_A::VALUE2 + } +} +impl core::ops::Deref for HDCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCSICTRL Mirror Register Write Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCSICTRL`"] -pub type OSCSICTRL_R = crate::R; +#[doc = "Field `OSCSICTRL` reader - OSCSICTRL Mirror Register Write Status"] +pub struct OSCSICTRL_R(crate::FieldReader); impl OSCSICTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCSICTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCSICTRL_A { @@ -136,12 +182,19 @@ impl OSCSICTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCSICTRL_A::VALUE1 + **self == OSCSICTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCSICTRL_A::VALUE2 + **self == OSCSICTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCSICTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCULCTRL Mirror Register Write Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCULCTRL`"] -pub type OSCULCTRL_R = crate::R; +#[doc = "Field `OSCULCTRL` reader - OSCULCTRL Mirror Register Write Status"] +pub struct OSCULCTRL_R(crate::FieldReader); impl OSCULCTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCULCTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCULCTRL_A { @@ -172,12 +228,19 @@ impl OSCULCTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCULCTRL_A::VALUE1 + **self == OSCULCTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCULCTRL_A::VALUE2 + **self == OSCULCTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCULCTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC CTR Mirror Register Write Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_CTR`"] -pub type RTC_CTR_R = crate::R; +#[doc = "Field `RTC_CTR` reader - RTC CTR Mirror Register Write Status"] +pub struct RTC_CTR_R(crate::FieldReader); impl RTC_CTR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_CTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_CTR_A { @@ -208,12 +274,19 @@ impl RTC_CTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_CTR_A::VALUE1 + **self == RTC_CTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_CTR_A::VALUE2 + **self == RTC_CTR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_CTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM0 Mirror Register Write Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM0`"] -pub type RTC_ATIM0_R = crate::R; +#[doc = "Field `RTC_ATIM0` reader - RTC ATIM0 Mirror Register Write Status"] +pub struct RTC_ATIM0_R(crate::FieldReader); impl RTC_ATIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM0_A { @@ -244,12 +320,19 @@ impl RTC_ATIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM0_A::VALUE1 + **self == RTC_ATIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM0_A::VALUE2 + **self == RTC_ATIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM1 Mirror Register Write Status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM1`"] -pub type RTC_ATIM1_R = crate::R; +#[doc = "Field `RTC_ATIM1` reader - RTC ATIM1 Mirror Register Write Status"] +pub struct RTC_ATIM1_R(crate::FieldReader); impl RTC_ATIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM1_A { @@ -280,12 +366,19 @@ impl RTC_ATIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM1_A::VALUE1 + **self == RTC_ATIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM1_A::VALUE2 + **self == RTC_ATIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM0 Mirror Register Write Status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM0`"] -pub type RTC_TIM0_R = crate::R; +#[doc = "Field `RTC_TIM0` reader - RTC TIM0 Mirror Register Write Status"] +pub struct RTC_TIM0_R(crate::FieldReader); impl RTC_TIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM0_A { @@ -316,12 +412,19 @@ impl RTC_TIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM0_A::VALUE1 + **self == RTC_TIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM0_A::VALUE2 + **self == RTC_TIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM1 Mirror Register Write Status\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM1`"] -pub type RTC_TIM1_R = crate::R; +#[doc = "Field `RTC_TIM1` reader - RTC TIM1 Mirror Register Write Status"] +pub struct RTC_TIM1_R(crate::FieldReader); impl RTC_TIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM1_A { @@ -352,12 +458,19 @@ impl RTC_TIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM1_A::VALUE1 + **self == RTC_TIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM1_A::VALUE2 + **self == RTC_TIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Retention Memory Access Register Update Status\n\nValue on reset: 0"] @@ -374,9 +487,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RMX`"] -pub type RMX_R = crate::R; +#[doc = "Field `RMX` reader - Retention Memory Access Register Update Status"] +pub struct RMX_R(crate::FieldReader); impl RMX_R { + pub(crate) fn new(bits: bool) -> Self { + RMX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RMX_A { @@ -388,12 +504,19 @@ impl RMX_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RMX_A::VALUE1 + **self == RMX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RMX_A::VALUE2 + **self == RMX_A::VALUE2 + } +} +impl core::ops::Deref for RMX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC MSKSSR Mirror Register Write Status\n\nValue on reset: 0"] @@ -410,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_MSKSR`"] -pub type RTC_MSKSR_R = crate::R; +#[doc = "Field `RTC_MSKSR` reader - RTC MSKSSR Mirror Register Write Status"] +pub struct RTC_MSKSR_R(crate::FieldReader); impl RTC_MSKSR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_MSKSR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_MSKSR_A { @@ -424,12 +550,19 @@ impl RTC_MSKSR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_MSKSR_A::VALUE1 + **self == RTC_MSKSR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_MSKSR_A::VALUE2 + **self == RTC_MSKSR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_MSKSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC CLRSR Mirror Register Write Status\n\nValue on reset: 0"] @@ -446,9 +579,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_CLRSR`"] -pub type RTC_CLRSR_R = crate::R; +#[doc = "Field `RTC_CLRSR` reader - RTC CLRSR Mirror Register Write Status"] +pub struct RTC_CLRSR_R(crate::FieldReader); impl RTC_CLRSR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_CLRSR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_CLRSR_A { @@ -460,12 +596,19 @@ impl RTC_CLRSR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_CLRSR_A::VALUE1 + **self == RTC_CLRSR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_CLRSR_A::VALUE2 + **self == RTC_CLRSR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_CLRSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACCONF Mirror Register Write Interrupt Set\n\nValue on reset: 0"] @@ -482,9 +625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCONF`"] -pub type LPACCONF_R = crate::R; +#[doc = "Field `LPACCONF` reader - LPACCONF Mirror Register Write Interrupt Set"] +pub struct LPACCONF_R(crate::FieldReader); impl LPACCONF_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCONF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCONF_A { @@ -496,12 +642,19 @@ impl LPACCONF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCONF_A::VALUE1 + **self == LPACCONF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCONF_A::VALUE2 + **self == LPACCONF_A::VALUE2 + } +} +impl core::ops::Deref for LPACCONF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH0 Mirror Register Write Interrupt Set\n\nValue on reset: 0"] @@ -518,9 +671,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH0`"] -pub type LPACTH0_R = crate::R; +#[doc = "Field `LPACTH0` reader - LPACTH0 Mirror Register Write Interrupt Set"] +pub struct LPACTH0_R(crate::FieldReader); impl LPACTH0_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH0_A { @@ -532,12 +688,19 @@ impl LPACTH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH0_A::VALUE1 + **self == LPACTH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH0_A::VALUE2 + **self == LPACTH0_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH1 Mirror Register Write Interrupt Set\n\nValue on reset: 0"] @@ -554,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH1`"] -pub type LPACTH1_R = crate::R; +#[doc = "Field `LPACTH1` reader - LPACTH1 Mirror Register Write Interrupt Set"] +pub struct LPACTH1_R(crate::FieldReader); impl LPACTH1_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH1_A { @@ -568,12 +734,19 @@ impl LPACTH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH1_A::VALUE1 + **self == LPACTH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH1_A::VALUE2 + **self == LPACTH1_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACCLR Mirror Register Write Status\n\nValue on reset: 0"] @@ -590,9 +763,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCLR`"] -pub type LPACCLR_R = crate::R; +#[doc = "Field `LPACCLR` reader - LPACCLR Mirror Register Write Status"] +pub struct LPACCLR_R(crate::FieldReader); impl LPACCLR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCLR_A { @@ -604,12 +780,19 @@ impl LPACCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCLR_A::VALUE1 + **self == LPACCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCLR_A::VALUE2 + **self == LPACCLR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACSET Mirror Register Write Status\n\nValue on reset: 0"] @@ -626,9 +809,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACSET`"] -pub type LPACSET_R = crate::R; +#[doc = "Field `LPACSET` reader - LPACSET Mirror Register Write Status"] +pub struct LPACSET_R(crate::FieldReader); impl LPACSET_R { + pub(crate) fn new(bits: bool) -> Self { + LPACSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACSET_A { @@ -640,12 +826,19 @@ impl LPACSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACSET_A::VALUE1 + **self == LPACSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACSET_A::VALUE2 + **self == LPACSET_A::VALUE2 + } +} +impl core::ops::Deref for LPACSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTCLR Mirror Register Write Status\n\nValue on reset: 0"] @@ -662,9 +855,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTCLR`"] -pub type HINTCLR_R = crate::R; +#[doc = "Field `HINTCLR` reader - HINTCLR Mirror Register Write Status"] +pub struct HINTCLR_R(crate::FieldReader); impl HINTCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HINTCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTCLR_A { @@ -676,12 +872,19 @@ impl HINTCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTCLR_A::VALUE1 + **self == HINTCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTCLR_A::VALUE2 + **self == HINTCLR_A::VALUE2 + } +} +impl core::ops::Deref for HINTCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTSET Mirror Register Write Status\n\nValue on reset: 0"] @@ -698,9 +901,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTSET`"] -pub type HINTSET_R = crate::R; +#[doc = "Field `HINTSET` reader - HINTSET Mirror Register Write Status"] +pub struct HINTSET_R(crate::FieldReader); impl HINTSET_R { + pub(crate) fn new(bits: bool) -> Self { + HINTSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTSET_A { @@ -712,12 +918,19 @@ impl HINTSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTSET_A::VALUE1 + **self == HINTSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTSET_A::VALUE2 + **self == HINTSET_A::VALUE2 + } +} +impl core::ops::Deref for HINTSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -822,3 +1035,19 @@ impl R { HINTSET_R::new(((self.bits >> 24) & 0x01) != 0) } } +#[doc = "Mirror Write Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mirrsts](index.html) module"] +pub struct MIRRSTS_SPEC; +impl crate::RegisterSpec for MIRRSTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mirrsts::R](R) reader structure"] +impl crate::Readable for MIRRSTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MIRRSTS to value 0"] +impl crate::Resettable for MIRRSTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_general/rmacr.rs b/src/scu_general/rmacr.rs index f6c609e5..6e515d25 100644 --- a/src/scu_general/rmacr.rs +++ b/src/scu_general/rmacr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register RMACR"] -pub type R = crate::R; -#[doc = "Writer for register RMACR"] -pub type W = crate::W; -#[doc = "Register RMACR `reset()`'s with value 0"] -impl crate::ResetValue for super::RMACR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RMACR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RMACR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Hibernate Retention Memory Register Update Control\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDWR`"] -pub type RDWR_R = crate::R; +#[doc = "Field `RDWR` reader - Hibernate Retention Memory Register Update Control"] +pub struct RDWR_R(crate::FieldReader); impl RDWR_R { + pub(crate) fn new(bits: bool) -> Self { + RDWR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDWR_A { @@ -38,15 +65,22 @@ impl RDWR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDWR_A::VALUE1 + **self == RDWR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDWR_A::VALUE2 + **self == RDWR_A::VALUE2 } } -#[doc = "Write proxy for field `RDWR`"] +impl core::ops::Deref for RDWR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RDWR` writer - Hibernate Retention Memory Register Update Control"] pub struct RDWR_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> RDWR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RDWR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "transfer data from Retention Memory in Hibernate domain to RMDATA register"] #[inline(always)] @@ -81,13 +113,25 @@ impl<'a> RDWR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `ADDR`"] -pub type ADDR_R = crate::R; -#[doc = "Write proxy for field `ADDR`"] +#[doc = "Field `ADDR` reader - Hibernate Retention Memory Register Address Select"] +pub struct ADDR_R(crate::FieldReader); +impl ADDR_R { + pub(crate) fn new(bits: u8) -> Self { + ADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR` writer - Hibernate Retention Memory Register Address Select"] pub struct ADDR_W<'a> { w: &'a mut W, } @@ -95,7 +139,7 @@ impl<'a> ADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -122,4 +166,30 @@ impl W { pub fn addr(&mut self) -> ADDR_W { ADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Retention Memory Access Control Register\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 [rmacr](index.html) module"] +pub struct RMACR_SPEC; +impl crate::RegisterSpec for RMACR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rmacr::R](R) reader structure"] +impl crate::Readable for RMACR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rmacr::W](W) writer structure"] +impl crate::Writable for RMACR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RMACR to value 0"] +impl crate::Resettable for RMACR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/rmdata.rs b/src/scu_general/rmdata.rs index 65cd340b..5b58bc1c 100644 --- a/src/scu_general/rmdata.rs +++ b/src/scu_general/rmdata.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register RMDATA"] -pub type R = crate::R; -#[doc = "Writer for register RMDATA"] -pub type W = crate::W; -#[doc = "Register RMDATA `reset()`'s with value 0"] -impl crate::ResetValue for super::RMDATA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RMDATA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RMDATA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DATA`"] -pub type DATA_R = crate::R; -#[doc = "Write proxy for field `DATA`"] +#[doc = "Field `DATA` reader - Hibernate Retention Memory Data"] +pub struct DATA_R(crate::FieldReader); +impl DATA_R { + pub(crate) fn new(bits: u32) -> Self { + DATA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATA` writer - Hibernate Retention Memory Data"] pub struct DATA_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DATA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn data(&mut self) -> DATA_W { DATA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Retention Memory Access Data Register\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 [rmdata](index.html) module"] +pub struct RMDATA_SPEC; +impl crate::RegisterSpec for RMDATA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rmdata::R](R) reader structure"] +impl crate::Readable for RMDATA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rmdata::W](W) writer structure"] +impl crate::Writable for RMDATA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RMDATA to value 0"] +impl crate::Resettable for RMDATA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_general/stcon.rs b/src/scu_general/stcon.rs index 29f6e56d..30ad71a0 100644 --- a/src/scu_general/stcon.rs +++ b/src/scu_general/stcon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register STCON"] -pub type R = crate::R; -#[doc = "Writer for register STCON"] -pub type W = crate::W; -#[doc = "Register STCON `reset()`'s with value 0"] -impl crate::ResetValue for super::STCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `STCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "HW Configuration\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HWCON`"] -pub type HWCON_R = crate::R; +#[doc = "Field `HWCON` reader - HW Configuration"] +pub struct HWCON_R(crate::FieldReader); impl HWCON_R { + pub(crate) fn new(bits: u8) -> Self { + HWCON_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HWCON_A { @@ -46,22 +73,29 @@ impl HWCON_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HWCON_A::VALUE1 + **self == HWCON_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HWCON_A::VALUE2 + **self == HWCON_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HWCON_A::VALUE3 + **self == HWCON_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HWCON_A::VALUE4 + **self == HWCON_A::VALUE4 + } +} +impl core::ops::Deref for HWCON_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "SW Configuration\n\nValue on reset: 0"] @@ -91,67 +125,76 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SWCON`"] -pub type SWCON_R = crate::R; +#[doc = "Field `SWCON` reader - SW Configuration"] +pub struct SWCON_R(crate::FieldReader); impl SWCON_R { + pub(crate) fn new(bits: u8) -> Self { + SWCON_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SWCON_A::VALUE1), - 1 => Val(SWCON_A::VALUE2), - 2 => Val(SWCON_A::VALUE3), - 3 => Val(SWCON_A::VALUE4), - 4 => Val(SWCON_A::VALUE5), - 8 => Val(SWCON_A::VALUE6), - 12 => Val(SWCON_A::VALUE7), - 14 => Val(SWCON_A::VALUE8), - i => Res(i), + 0 => Some(SWCON_A::VALUE1), + 1 => Some(SWCON_A::VALUE2), + 2 => Some(SWCON_A::VALUE3), + 3 => Some(SWCON_A::VALUE4), + 4 => Some(SWCON_A::VALUE5), + 8 => Some(SWCON_A::VALUE6), + 12 => Some(SWCON_A::VALUE7), + 14 => Some(SWCON_A::VALUE8), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SWCON_A::VALUE1 + **self == SWCON_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SWCON_A::VALUE2 + **self == SWCON_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SWCON_A::VALUE3 + **self == SWCON_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SWCON_A::VALUE4 + **self == SWCON_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SWCON_A::VALUE5 + **self == SWCON_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SWCON_A::VALUE6 + **self == SWCON_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SWCON_A::VALUE7 + **self == SWCON_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == SWCON_A::VALUE8 + **self == SWCON_A::VALUE8 + } +} +impl core::ops::Deref for SWCON_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SWCON`"] +#[doc = "Field `SWCON` writer - SW Configuration"] pub struct SWCON_W<'a> { w: &'a mut W, } @@ -204,7 +247,7 @@ impl<'a> SWCON_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -226,4 +269,30 @@ impl W { pub fn swcon(&mut self) -> SWCON_W { SWCON_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Startup Configuration Register\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 [stcon](index.html) module"] +pub struct STCON_SPEC; +impl crate::RegisterSpec for STCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [stcon::R](R) reader structure"] +impl crate::Readable for STCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [stcon::W](W) writer structure"] +impl crate::Writable for STCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STCON to value 0"] +impl crate::Resettable for STCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate.rs b/src/scu_hibernate.rs index 10fe6c09..b41b51c0 100644 --- a/src/scu_hibernate.rs +++ b/src/scu_hibernate.rs @@ -2,192 +2,100 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Hibernate Domain Status Register"] - pub hdstat: HDSTAT, + pub hdstat: crate::Reg, #[doc = "0x04 - Hibernate Domain Status Clear Register"] - pub hdclr: HDCLR, + pub hdclr: crate::Reg, #[doc = "0x08 - Hibernate Domain Status Set Register"] - pub hdset: HDSET, + pub hdset: crate::Reg, #[doc = "0x0c - Hibernate Domain Control Register"] - pub hdcr: HDCR, - _reserved4: [u8; 4usize], + pub hdcr: crate::Reg, + _reserved4: [u8; 0x04], #[doc = "0x14 - fOSI Control Register"] - pub oscsictrl: OSCSICTRL, + pub oscsictrl: crate::Reg, #[doc = "0x18 - OSC_ULP Status Register"] - pub osculstat: OSCULSTAT, + pub osculstat: crate::Reg, #[doc = "0x1c - OSC_ULP Control Register"] - pub osculctrl: OSCULCTRL, + pub osculctrl: crate::Reg, #[doc = "0x20 - Analog Wake-up Configuration Register"] - pub lpacconf: LPACCONF, + pub lpacconf: crate::Reg, #[doc = "0x24 - LPAC Threshold Register 0"] - pub lpacth0: LPACTH0, + pub lpacth0: crate::Reg, #[doc = "0x28 - LPAC Threshold Register 1"] - pub lpacth1: LPACTH1, + pub lpacth1: crate::Reg, #[doc = "0x2c - Hibernate Analog Control State Register"] - pub lpacst: LPACST, + pub lpacst: crate::Reg, #[doc = "0x30 - LPAC Control Clear Register"] - pub lpacclr: LPACCLR, + pub lpacclr: crate::Reg, #[doc = "0x34 - LPAC Control Set Register"] - pub lpacset: LPACSET, + pub lpacset: crate::Reg, #[doc = "0x38 - Hibernate Internal Control State Register"] - pub hintst: HINTST, + pub hintst: crate::Reg, #[doc = "0x3c - Hibernate Internal Control Clear Register"] - pub hintclr: HINTCLR, + pub hintclr: crate::Reg, #[doc = "0x40 - Hibernate Internal Control Set Register"] - pub hintset: HINTSET, + pub hintset: crate::Reg, } -#[doc = "Hibernate Domain Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdstat](hdstat) module"] -pub type HDSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HDSTAT; -#[doc = "`read()` method returns [hdstat::R](hdstat::R) reader structure"] -impl crate::Readable for HDSTAT {} +#[doc = "HDSTAT register accessor: an alias for `Reg`"] +pub type HDSTAT = crate::Reg; #[doc = "Hibernate Domain Status Register"] pub mod hdstat; -#[doc = "Hibernate Domain Status Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdclr](hdclr) module"] -pub type HDCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HDCLR; -#[doc = "`write(|w| ..)` method takes [hdclr::W](hdclr::W) writer structure"] -impl crate::Writable for HDCLR {} +#[doc = "HDCLR register accessor: an alias for `Reg`"] +pub type HDCLR = crate::Reg; #[doc = "Hibernate Domain Status Clear Register"] pub mod hdclr; -#[doc = "Hibernate Domain Status Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdset](hdset) module"] -pub type HDSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HDSET; -#[doc = "`write(|w| ..)` method takes [hdset::W](hdset::W) writer structure"] -impl crate::Writable for HDSET {} +#[doc = "HDSET register accessor: an alias for `Reg`"] +pub type HDSET = crate::Reg; #[doc = "Hibernate Domain Status Set Register"] pub mod hdset; -#[doc = "Hibernate Domain Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdcr](hdcr) module"] -pub type HDCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HDCR; -#[doc = "`read()` method returns [hdcr::R](hdcr::R) reader structure"] -impl crate::Readable for HDCR {} -#[doc = "`write(|w| ..)` method takes [hdcr::W](hdcr::W) writer structure"] -impl crate::Writable for HDCR {} +#[doc = "HDCR register accessor: an alias for `Reg`"] +pub type HDCR = crate::Reg; #[doc = "Hibernate Domain Control Register"] pub mod hdcr; -#[doc = "fOSI Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oscsictrl](oscsictrl) module"] -pub type OSCSICTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OSCSICTRL; -#[doc = "`read()` method returns [oscsictrl::R](oscsictrl::R) reader structure"] -impl crate::Readable for OSCSICTRL {} -#[doc = "`write(|w| ..)` method takes [oscsictrl::W](oscsictrl::W) writer structure"] -impl crate::Writable for OSCSICTRL {} +#[doc = "OSCSICTRL register accessor: an alias for `Reg`"] +pub type OSCSICTRL = crate::Reg; #[doc = "fOSI Control Register"] pub mod oscsictrl; -#[doc = "OSC_ULP Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [osculstat](osculstat) module"] -pub type OSCULSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OSCULSTAT; -#[doc = "`read()` method returns [osculstat::R](osculstat::R) reader structure"] -impl crate::Readable for OSCULSTAT {} +#[doc = "OSCULSTAT register accessor: an alias for `Reg`"] +pub type OSCULSTAT = crate::Reg; #[doc = "OSC_ULP Status Register"] pub mod osculstat; -#[doc = "OSC_ULP Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [osculctrl](osculctrl) module"] -pub type OSCULCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OSCULCTRL; -#[doc = "`read()` method returns [osculctrl::R](osculctrl::R) reader structure"] -impl crate::Readable for OSCULCTRL {} -#[doc = "`write(|w| ..)` method takes [osculctrl::W](osculctrl::W) writer structure"] -impl crate::Writable for OSCULCTRL {} +#[doc = "OSCULCTRL register accessor: an alias for `Reg`"] +pub type OSCULCTRL = crate::Reg; #[doc = "OSC_ULP Control Register"] pub mod osculctrl; -#[doc = "Analog Wake-up Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacconf](lpacconf) module"] -pub type LPACCONF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACCONF; -#[doc = "`read()` method returns [lpacconf::R](lpacconf::R) reader structure"] -impl crate::Readable for LPACCONF {} -#[doc = "`write(|w| ..)` method takes [lpacconf::W](lpacconf::W) writer structure"] -impl crate::Writable for LPACCONF {} +#[doc = "LPACCONF register accessor: an alias for `Reg`"] +pub type LPACCONF = crate::Reg; #[doc = "Analog Wake-up Configuration Register"] pub mod lpacconf; -#[doc = "LPAC Threshold Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacth0](lpacth0) module"] -pub type LPACTH0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACTH0; -#[doc = "`read()` method returns [lpacth0::R](lpacth0::R) reader structure"] -impl crate::Readable for LPACTH0 {} -#[doc = "`write(|w| ..)` method takes [lpacth0::W](lpacth0::W) writer structure"] -impl crate::Writable for LPACTH0 {} +#[doc = "LPACTH0 register accessor: an alias for `Reg`"] +pub type LPACTH0 = crate::Reg; #[doc = "LPAC Threshold Register 0"] pub mod lpacth0; -#[doc = "LPAC Threshold Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacth1](lpacth1) module"] -pub type LPACTH1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACTH1; -#[doc = "`read()` method returns [lpacth1::R](lpacth1::R) reader structure"] -impl crate::Readable for LPACTH1 {} -#[doc = "`write(|w| ..)` method takes [lpacth1::W](lpacth1::W) writer structure"] -impl crate::Writable for LPACTH1 {} +#[doc = "LPACTH1 register accessor: an alias for `Reg`"] +pub type LPACTH1 = crate::Reg; #[doc = "LPAC Threshold Register 1"] pub mod lpacth1; -#[doc = "Hibernate Analog Control State Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacst](lpacst) module"] -pub type LPACST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACST; -#[doc = "`read()` method returns [lpacst::R](lpacst::R) reader structure"] -impl crate::Readable for LPACST {} +#[doc = "LPACST register accessor: an alias for `Reg`"] +pub type LPACST = crate::Reg; #[doc = "Hibernate Analog Control State Register"] pub mod lpacst; -#[doc = "LPAC Control Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacclr](lpacclr) module"] -pub type LPACCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACCLR; -#[doc = "`write(|w| ..)` method takes [lpacclr::W](lpacclr::W) writer structure"] -impl crate::Writable for LPACCLR {} +#[doc = "LPACCLR register accessor: an alias for `Reg`"] +pub type LPACCLR = crate::Reg; #[doc = "LPAC Control Clear Register"] pub mod lpacclr; -#[doc = "LPAC Control Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacset](lpacset) module"] -pub type LPACSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _LPACSET; -#[doc = "`write(|w| ..)` method takes [lpacset::W](lpacset::W) writer structure"] -impl crate::Writable for LPACSET {} +#[doc = "LPACSET register accessor: an alias for `Reg`"] +pub type LPACSET = crate::Reg; #[doc = "LPAC Control Set Register"] pub mod lpacset; -#[doc = "Hibernate Internal Control State Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintst](hintst) module"] -pub type HINTST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HINTST; -#[doc = "`read()` method returns [hintst::R](hintst::R) reader structure"] -impl crate::Readable for HINTST {} +#[doc = "HINTST register accessor: an alias for `Reg`"] +pub type HINTST = crate::Reg; #[doc = "Hibernate Internal Control State Register"] pub mod hintst; -#[doc = "Hibernate Internal Control Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintclr](hintclr) module"] -pub type HINTCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HINTCLR; -#[doc = "`write(|w| ..)` method takes [hintclr::W](hintclr::W) writer structure"] -impl crate::Writable for HINTCLR {} +#[doc = "HINTCLR register accessor: an alias for `Reg`"] +pub type HINTCLR = crate::Reg; #[doc = "Hibernate Internal Control Clear Register"] pub mod hintclr; -#[doc = "Hibernate Internal Control Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintset](hintset) module"] -pub type HINTSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _HINTSET; -#[doc = "`write(|w| ..)` method takes [hintset::W](hintset::W) writer structure"] -impl crate::Writable for HINTSET {} +#[doc = "HINTSET register accessor: an alias for `Reg`"] +pub type HINTSET = crate::Reg; #[doc = "Hibernate Internal Control Set Register"] pub mod hintset; diff --git a/src/scu_hibernate/hdclr.rs b/src/scu_hibernate/hdclr.rs index 3cd760ab..72bae2e2 100644 --- a/src/scu_hibernate/hdclr.rs +++ b/src/scu_hibernate/hdclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register HDCLR"] -pub type W = crate::W; -#[doc = "Register HDCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::HDCLR { - type Type = u32; +#[doc = "Register `HDCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Wake-up Pin Event Positive Edge Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `EPEV`"] +#[doc = "Field `EPEV` writer - Wake-up Pin Event Positive Edge Clear"] pub struct EPEV_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> EPEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> EPEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ENEV`"] +#[doc = "Field `ENEV` writer - Wake-up Pin Event Negative Edge Clear"] pub struct ENEV_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> ENEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> ENEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTCEV`"] +#[doc = "Field `RTCEV` writer - RTC Event Clear"] pub struct RTCEV_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> RTCEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTCEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> RTCEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ULPWDG`"] +#[doc = "Field `ULPWDG` writer - ULP WDG Alarm Clear"] pub struct ULPWDG_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> ULPWDG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDG_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> ULPWDG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATPEV`"] +#[doc = "Field `VBATPEV` writer - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Clear"] pub struct VBATPEV_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> VBATPEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATPEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> VBATPEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATNEV`"] +#[doc = "Field `VBATNEV` writer - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Clear"] pub struct VBATNEV_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> VBATNEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATNEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> VBATNEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0PEV`"] +#[doc = "Field `AHIBIO0PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Clear"] pub struct AHIBIO0PEV_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> AHIBIO0PEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0PEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> AHIBIO0PEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0NEV`"] +#[doc = "Field `AHIBIO0NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Clear"] pub struct AHIBIO0NEV_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> AHIBIO0NEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0NEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> AHIBIO0NEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W { AHIBIO0NEV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hibernate Domain Status Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdclr](index.html) module"] +pub struct HDCLR_SPEC; +impl crate::RegisterSpec for HDCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hdclr::W](W) writer structure"] +impl crate::Writable for HDCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HDCLR to value 0"] +impl crate::Resettable for HDCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/hdcr.rs b/src/scu_hibernate/hdcr.rs index ebba5676..06112dd4 100644 --- a/src/scu_hibernate/hdcr.rs +++ b/src/scu_hibernate/hdcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register HDCR"] -pub type R = crate::R; -#[doc = "Writer for register HDCR"] -pub type W = crate::W; -#[doc = "Register HDCR `reset()`'s with value 0x000c_2000"] -impl crate::ResetValue for super::HDCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x000c_2000 +#[doc = "Register `HDCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HDCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Wake-Up on Pin Event Positive Edge Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WKPEP`"] -pub type WKPEP_R = crate::R; +#[doc = "Field `WKPEP` reader - Wake-Up on Pin Event Positive Edge Enable"] +pub struct WKPEP_R(crate::FieldReader); impl WKPEP_R { + pub(crate) fn new(bits: bool) -> Self { + WKPEP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WKPEP_A { @@ -38,15 +65,22 @@ impl WKPEP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WKPEP_A::VALUE1 + **self == WKPEP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WKPEP_A::VALUE2 + **self == WKPEP_A::VALUE2 + } +} +impl core::ops::Deref for WKPEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WKPEP`"] +#[doc = "Field `WKPEP` writer - Wake-Up on Pin Event Positive Edge Enable"] pub struct WKPEP_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> WKPEP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WKPEP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> WKPEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WKPEN`"] -pub type WKPEN_R = crate::R; +#[doc = "Field `WKPEN` reader - Wake-up on Pin Event Negative Edge Enable"] +pub struct WKPEN_R(crate::FieldReader); impl WKPEN_R { + pub(crate) fn new(bits: bool) -> Self { + WKPEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WKPEN_A { @@ -113,15 +148,22 @@ impl WKPEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WKPEN_A::VALUE1 + **self == WKPEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WKPEN_A::VALUE2 + **self == WKPEN_A::VALUE2 } } -#[doc = "Write proxy for field `WKPEN`"] +impl core::ops::Deref for WKPEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WKPEN` writer - Wake-up on Pin Event Negative Edge Enable"] pub struct WKPEN_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> WKPEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WKPEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> WKPEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTCE`"] -pub type RTCE_R = crate::R; +#[doc = "Field `RTCE` reader - Wake-up on RTC Event Enable"] +pub struct RTCE_R(crate::FieldReader); impl RTCE_R { + pub(crate) fn new(bits: bool) -> Self { + RTCE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTCE_A { @@ -188,15 +231,22 @@ impl RTCE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTCE_A::VALUE1 + **self == RTCE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTCE_A::VALUE2 + **self == RTCE_A::VALUE2 + } +} +impl core::ops::Deref for RTCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RTCE`"] +#[doc = "Field `RTCE` writer - Wake-up on RTC Event Enable"] pub struct RTCE_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> RTCE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTCE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> RTCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ULPWDGEN`"] -pub type ULPWDGEN_R = crate::R; +#[doc = "Field `ULPWDGEN` reader - ULP WDG Alarm Enable"] +pub struct ULPWDGEN_R(crate::FieldReader); impl ULPWDGEN_R { + pub(crate) fn new(bits: bool) -> Self { + ULPWDGEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ULPWDGEN_A { @@ -263,15 +314,22 @@ impl ULPWDGEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ULPWDGEN_A::VALUE1 + **self == ULPWDGEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ULPWDGEN_A::VALUE2 + **self == ULPWDGEN_A::VALUE2 } } -#[doc = "Write proxy for field `ULPWDGEN`"] +impl core::ops::Deref for ULPWDGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ULPWDGEN` writer - ULP WDG Alarm Enable"] pub struct ULPWDGEN_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> ULPWDGEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDGEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> ULPWDGEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIB`"] -pub type HIB_R = crate::R; +#[doc = "Field `HIB` reader - Hibernate Request Value Set"] +pub struct HIB_R(crate::FieldReader); impl HIB_R { + pub(crate) fn new(bits: bool) -> Self { + HIB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIB_A { @@ -338,15 +397,22 @@ impl HIB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIB_A::VALUE1 + **self == HIB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIB_A::VALUE2 + **self == HIB_A::VALUE2 + } +} +impl core::ops::Deref for HIB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HIB`"] +#[doc = "Field `HIB` writer - Hibernate Request Value Set"] pub struct HIB_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External hibernate request inactive"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `XTALGPI1SEL`"] -pub type XTALGPI1SEL_R = crate::R; +#[doc = "Field `XTALGPI1SEL` reader - Multiplex Control for RTC_XTAL_1 Select as GPI Input"] +pub struct XTALGPI1SEL_R(crate::FieldReader); impl XTALGPI1SEL_R { + pub(crate) fn new(bits: bool) -> Self { + XTALGPI1SEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XTALGPI1SEL_A { @@ -413,15 +480,22 @@ impl XTALGPI1SEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XTALGPI1SEL_A::VALUE1 + **self == XTALGPI1SEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XTALGPI1SEL_A::VALUE2 + **self == XTALGPI1SEL_A::VALUE2 } } -#[doc = "Write proxy for field `XTALGPI1SEL`"] +impl core::ops::Deref for XTALGPI1SEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XTALGPI1SEL` writer - Multiplex Control for RTC_XTAL_1 Select as GPI Input"] pub struct XTALGPI1SEL_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> XTALGPI1SEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTALGPI1SEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "RTC_XTAL_1 input selected"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> XTALGPI1SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RCS`"] -pub type RCS_R = crate::R; +#[doc = "Field `RCS` reader - fRTC Clock Selection"] +pub struct RCS_R(crate::FieldReader); impl RCS_R { + pub(crate) fn new(bits: bool) -> Self { + RCS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RCS_A { @@ -488,15 +563,22 @@ impl RCS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RCS_A::VALUE1 + **self == RCS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RCS_A::VALUE2 + **self == RCS_A::VALUE2 + } +} +impl core::ops::Deref for RCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RCS`"] +#[doc = "Field `RCS` writer - fRTC Clock Selection"] pub struct RCS_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> RCS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RCS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOSI selected"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> RCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STDBYSEL`"] -pub type STDBYSEL_R = crate::R; +#[doc = "Field `STDBYSEL` reader - fSTDBY Clock Selection"] +pub struct STDBYSEL_R(crate::FieldReader); impl STDBYSEL_R { + pub(crate) fn new(bits: bool) -> Self { + STDBYSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STDBYSEL_A { @@ -563,15 +646,22 @@ impl STDBYSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STDBYSEL_A::VALUE1 + **self == STDBYSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STDBYSEL_A::VALUE2 + **self == STDBYSEL_A::VALUE2 + } +} +impl core::ops::Deref for STDBYSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STDBYSEL`"] +#[doc = "Field `STDBYSEL` writer - fSTDBY Clock Selection"] pub struct STDBYSEL_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> STDBYSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STDBYSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "fOSI selected"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> STDBYSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WKUPSEL`"] -pub type WKUPSEL_R = crate::R; +#[doc = "Field `WKUPSEL` reader - Wake-Up from Hibernate Trigger Input Selection"] +pub struct WKUPSEL_R(crate::FieldReader); impl WKUPSEL_R { + pub(crate) fn new(bits: bool) -> Self { + WKUPSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WKUPSEL_A { @@ -638,15 +729,22 @@ impl WKUPSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WKUPSEL_A::VALUE1 + **self == WKUPSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WKUPSEL_A::VALUE2 + **self == WKUPSEL_A::VALUE2 + } +} +impl core::ops::Deref for WKUPSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WKUPSEL`"] +#[doc = "Field `WKUPSEL` writer - Wake-Up from Hibernate Trigger Input Selection"] pub struct WKUPSEL_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> WKUPSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WKUPSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HIB_IO_1 pin selected"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> WKUPSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -697,25 +793,34 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GPI0SEL`"] -pub type GPI0SEL_R = crate::R; +#[doc = "Field `GPI0SEL` reader - General Purpose Input 0 Selection"] +pub struct GPI0SEL_R(crate::FieldReader); impl GPI0SEL_R { + pub(crate) fn new(bits: bool) -> Self { + GPI0SEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - true => Val(GPI0SEL_A::VALUE2), - i => Res(i), + true => Some(GPI0SEL_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GPI0SEL_A::VALUE2 + **self == GPI0SEL_A::VALUE2 + } +} +impl core::ops::Deref for GPI0SEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GPI0SEL`"] +#[doc = "Field `GPI0SEL` writer - General Purpose Input 0 Selection"] pub struct GPI0SEL_W<'a> { w: &'a mut W, } @@ -723,9 +828,7 @@ impl<'a> GPI0SEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GPI0SEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "HIB_IO_0 pin selected"] #[inline(always)] @@ -745,7 +848,7 @@ impl<'a> GPI0SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -763,9 +866,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBIO0POL`"] -pub type HIBIO0POL_R = crate::R; +#[doc = "Field `HIBIO0POL` reader - HIBIO0 Polarity Set"] +pub struct HIBIO0POL_R(crate::FieldReader); impl HIBIO0POL_R { + pub(crate) fn new(bits: bool) -> Self { + HIBIO0POL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBIO0POL_A { @@ -777,15 +883,22 @@ impl HIBIO0POL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBIO0POL_A::VALUE1 + **self == HIBIO0POL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBIO0POL_A::VALUE2 + **self == HIBIO0POL_A::VALUE2 + } +} +impl core::ops::Deref for HIBIO0POL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HIBIO0POL`"] +#[doc = "Field `HIBIO0POL` writer - HIBIO0 Polarity Set"] pub struct HIBIO0POL_W<'a> { w: &'a mut W, } @@ -793,9 +906,7 @@ impl<'a> HIBIO0POL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBIO0POL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Direct value"] #[inline(always)] @@ -820,7 +931,7 @@ impl<'a> HIBIO0POL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -838,9 +949,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ADIG0SEL`"] -pub type ADIG0SEL_R = crate::R; +#[doc = "Field `ADIG0SEL` reader - Select Analog Channel 0 or Digital Output Path"] +pub struct ADIG0SEL_R(crate::FieldReader); impl ADIG0SEL_R { + pub(crate) fn new(bits: bool) -> Self { + ADIG0SEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ADIG0SEL_A { @@ -852,15 +966,22 @@ impl ADIG0SEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ADIG0SEL_A::VALUE1 + **self == ADIG0SEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ADIG0SEL_A::VALUE2 + **self == ADIG0SEL_A::VALUE2 } } -#[doc = "Write proxy for field `ADIG0SEL`"] +impl core::ops::Deref for ADIG0SEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADIG0SEL` writer - Select Analog Channel 0 or Digital Output Path"] pub struct ADIG0SEL_W<'a> { w: &'a mut W, } @@ -868,9 +989,7 @@ impl<'a> ADIG0SEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ADIG0SEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Digital input"] #[inline(always)] @@ -895,7 +1014,7 @@ impl<'a> ADIG0SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -930,79 +1049,88 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HIBIO0SEL`"] -pub type HIBIO0SEL_R = crate::R; +#[doc = "Field `HIBIO0SEL` reader - HIB_IO_0 Pin I/O Control (default HIBOUT)"] +pub struct HIBIO0SEL_R(crate::FieldReader); impl HIBIO0SEL_R { + pub(crate) fn new(bits: u8) -> Self { + HIBIO0SEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HIBIO0SEL_A::VALUE1), - 1 => Val(HIBIO0SEL_A::VALUE2), - 2 => Val(HIBIO0SEL_A::VALUE3), - 8 => Val(HIBIO0SEL_A::VALUE4), - 9 => Val(HIBIO0SEL_A::VALUE5), - 10 => Val(HIBIO0SEL_A::VALUE6), - 12 => Val(HIBIO0SEL_A::VALUE7), - 13 => Val(HIBIO0SEL_A::VALUE8), - 14 => Val(HIBIO0SEL_A::VALUE9), - 15 => Val(HIBIO0SEL_A::VALUE10), - i => Res(i), + 0 => Some(HIBIO0SEL_A::VALUE1), + 1 => Some(HIBIO0SEL_A::VALUE2), + 2 => Some(HIBIO0SEL_A::VALUE3), + 8 => Some(HIBIO0SEL_A::VALUE4), + 9 => Some(HIBIO0SEL_A::VALUE5), + 10 => Some(HIBIO0SEL_A::VALUE6), + 12 => Some(HIBIO0SEL_A::VALUE7), + 13 => Some(HIBIO0SEL_A::VALUE8), + 14 => Some(HIBIO0SEL_A::VALUE9), + 15 => Some(HIBIO0SEL_A::VALUE10), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBIO0SEL_A::VALUE1 + **self == HIBIO0SEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBIO0SEL_A::VALUE2 + **self == HIBIO0SEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HIBIO0SEL_A::VALUE3 + **self == HIBIO0SEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HIBIO0SEL_A::VALUE4 + **self == HIBIO0SEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == HIBIO0SEL_A::VALUE5 + **self == HIBIO0SEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == HIBIO0SEL_A::VALUE6 + **self == HIBIO0SEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == HIBIO0SEL_A::VALUE7 + **self == HIBIO0SEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == HIBIO0SEL_A::VALUE8 + **self == HIBIO0SEL_A::VALUE8 } #[doc = "Checks if the value of the field is `VALUE9`"] #[inline(always)] pub fn is_value9(&self) -> bool { - *self == HIBIO0SEL_A::VALUE9 + **self == HIBIO0SEL_A::VALUE9 } #[doc = "Checks if the value of the field is `VALUE10`"] #[inline(always)] pub fn is_value10(&self) -> bool { - *self == HIBIO0SEL_A::VALUE10 + **self == HIBIO0SEL_A::VALUE10 } } -#[doc = "Write proxy for field `HIBIO0SEL`"] +impl core::ops::Deref for HIBIO0SEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HIBIO0SEL` writer - HIB_IO_0 Pin I/O Control (default HIBOUT)"] pub struct HIBIO0SEL_W<'a> { w: &'a mut W, } @@ -1065,7 +1193,7 @@ impl<'a> HIBIO0SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -1083,9 +1211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATLO`"] -pub type VBATLO_R = crate::R; +#[doc = "Field `VBATLO` reader - Wake-Up on VBAT Falling Below Threshold Enable"] +pub struct VBATLO_R(crate::FieldReader); impl VBATLO_R { + pub(crate) fn new(bits: bool) -> Self { + VBATLO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATLO_A { @@ -1097,15 +1228,22 @@ impl VBATLO_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATLO_A::VALUE1 + **self == VBATLO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATLO_A::VALUE2 + **self == VBATLO_A::VALUE2 } } -#[doc = "Write proxy for field `VBATLO`"] +impl core::ops::Deref for VBATLO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VBATLO` writer - Wake-Up on VBAT Falling Below Threshold Enable"] pub struct VBATLO_W<'a> { w: &'a mut W, } @@ -1113,9 +1251,7 @@ impl<'a> VBATLO_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATLO_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -1140,7 +1276,7 @@ impl<'a> VBATLO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1158,9 +1294,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATHI`"] -pub type VBATHI_R = crate::R; +#[doc = "Field `VBATHI` reader - Wake-Up on VBAT Rising Above Threshold Enable"] +pub struct VBATHI_R(crate::FieldReader); impl VBATHI_R { + pub(crate) fn new(bits: bool) -> Self { + VBATHI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATHI_A { @@ -1172,15 +1311,22 @@ impl VBATHI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATHI_A::VALUE1 + **self == VBATHI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATHI_A::VALUE2 + **self == VBATHI_A::VALUE2 } } -#[doc = "Write proxy for field `VBATHI`"] +impl core::ops::Deref for VBATHI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VBATHI` writer - Wake-Up on VBAT Rising Above Threshold Enable"] pub struct VBATHI_W<'a> { w: &'a mut W, } @@ -1188,9 +1334,7 @@ impl<'a> VBATHI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATHI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -1215,7 +1359,7 @@ impl<'a> VBATHI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1233,9 +1377,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0LO`"] -pub type AHIBIO0LO_R = crate::R; +#[doc = "Field `AHIBIO0LO` reader - Wake-Up on Analog HIB_IO_0 Falling Below Threshold Enable"] +pub struct AHIBIO0LO_R(crate::FieldReader); impl AHIBIO0LO_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0LO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0LO_A { @@ -1247,15 +1394,22 @@ impl AHIBIO0LO_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0LO_A::VALUE1 + **self == AHIBIO0LO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0LO_A::VALUE2 + **self == AHIBIO0LO_A::VALUE2 + } +} +impl core::ops::Deref for AHIBIO0LO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `AHIBIO0LO`"] +#[doc = "Field `AHIBIO0LO` writer - Wake-Up on Analog HIB_IO_0 Falling Below Threshold Enable"] pub struct AHIBIO0LO_W<'a> { w: &'a mut W, } @@ -1263,9 +1417,7 @@ impl<'a> AHIBIO0LO_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0LO_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -1290,7 +1442,7 @@ impl<'a> AHIBIO0LO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1308,9 +1460,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0HI`"] -pub type AHIBIO0HI_R = crate::R; +#[doc = "Field `AHIBIO0HI` reader - Wake-Up on Analog HIB_IO_0 Rising Above Threshold Enable"] +pub struct AHIBIO0HI_R(crate::FieldReader); impl AHIBIO0HI_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0HI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0HI_A { @@ -1322,15 +1477,22 @@ impl AHIBIO0HI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0HI_A::VALUE1 + **self == AHIBIO0HI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0HI_A::VALUE2 + **self == AHIBIO0HI_A::VALUE2 } } -#[doc = "Write proxy for field `AHIBIO0HI`"] +impl core::ops::Deref for AHIBIO0HI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHIBIO0HI` writer - Wake-Up on Analog HIB_IO_0 Rising Above Threshold Enable"] pub struct AHIBIO0HI_W<'a> { w: &'a mut W, } @@ -1338,9 +1500,7 @@ impl<'a> AHIBIO0HI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0HI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wake-up event disabled"] #[inline(always)] @@ -1365,7 +1525,7 @@ impl<'a> AHIBIO0HI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1542,4 +1702,30 @@ impl W { pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W { AHIBIO0HI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hibernate Domain Control Register\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 [hdcr](index.html) module"] +pub struct HDCR_SPEC; +impl crate::RegisterSpec for HDCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hdcr::R](R) reader structure"] +impl crate::Readable for HDCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hdcr::W](W) writer structure"] +impl crate::Writable for HDCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HDCR to value 0x000c_2000"] +impl crate::Resettable for HDCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x000c_2000 + } } diff --git a/src/scu_hibernate/hdset.rs b/src/scu_hibernate/hdset.rs index 14a8d956..cc09039c 100644 --- a/src/scu_hibernate/hdset.rs +++ b/src/scu_hibernate/hdset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register HDSET"] -pub type W = crate::W; -#[doc = "Register HDSET `reset()`'s with value 0"] -impl crate::ResetValue for super::HDSET { - type Type = u32; +#[doc = "Register `HDSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Wake-up Pin Event Positive Edge Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `EPEV`"] +#[doc = "Field `EPEV` writer - Wake-up Pin Event Positive Edge Set"] pub struct EPEV_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> EPEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> EPEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ENEV`"] +#[doc = "Field `ENEV` writer - Wake-up Pin Event Negative Edge Set"] pub struct ENEV_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> ENEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> ENEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTCEV`"] +#[doc = "Field `RTCEV` writer - RTC Event Set"] pub struct RTCEV_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> RTCEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTCEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> RTCEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ULPWDG`"] +#[doc = "Field `ULPWDG` writer - ULP WDG Alarm Set"] pub struct ULPWDG_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> ULPWDG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDG_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> ULPWDG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATPEV`"] +#[doc = "Field `VBATPEV` writer - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Set"] pub struct VBATPEV_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> VBATPEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATPEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> VBATPEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATNEV`"] +#[doc = "Field `VBATNEV` writer - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Set"] pub struct VBATNEV_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> VBATNEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATNEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> VBATNEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0PEV`"] +#[doc = "Field `AHIBIO0PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Set"] pub struct AHIBIO0PEV_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> AHIBIO0PEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0PEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> AHIBIO0PEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0NEV`"] +#[doc = "Field `AHIBIO0NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Set"] pub struct AHIBIO0NEV_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> AHIBIO0NEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0NEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> AHIBIO0NEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W { AHIBIO0NEV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hibernate Domain Status Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdset](index.html) module"] +pub struct HDSET_SPEC; +impl crate::RegisterSpec for HDSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hdset::W](W) writer structure"] +impl crate::Writable for HDSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HDSET to value 0"] +impl crate::Resettable for HDSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/hdstat.rs b/src/scu_hibernate/hdstat.rs index 68d29e7b..2badce31 100644 --- a/src/scu_hibernate/hdstat.rs +++ b/src/scu_hibernate/hdstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register HDSTAT"] -pub type R = crate::R; +#[doc = "Register `HDSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Wake-up Pin Event Positive Edge\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EPEV_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EPEV`"] -pub type EPEV_R = crate::R; +#[doc = "Field `EPEV` reader - Wake-up Pin Event Positive Edge"] +pub struct EPEV_R(crate::FieldReader); impl EPEV_R { + pub(crate) fn new(bits: bool) -> Self { + EPEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPEV_A { @@ -28,12 +44,19 @@ impl EPEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPEV_A::VALUE1 + **self == EPEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPEV_A::VALUE2 + **self == EPEV_A::VALUE2 + } +} +impl core::ops::Deref for EPEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wake-up Pin Event Negative Edge\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENEV`"] -pub type ENEV_R = crate::R; +#[doc = "Field `ENEV` reader - Wake-up Pin Event Negative Edge"] +pub struct ENEV_R(crate::FieldReader); impl ENEV_R { + pub(crate) fn new(bits: bool) -> Self { + ENEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENEV_A { @@ -64,12 +90,19 @@ impl ENEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENEV_A::VALUE1 + **self == ENEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENEV_A::VALUE2 + **self == ENEV_A::VALUE2 + } +} +impl core::ops::Deref for ENEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC Event\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTCEV`"] -pub type RTCEV_R = crate::R; +#[doc = "Field `RTCEV` reader - RTC Event"] +pub struct RTCEV_R(crate::FieldReader); impl RTCEV_R { + pub(crate) fn new(bits: bool) -> Self { + RTCEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTCEV_A { @@ -100,12 +136,19 @@ impl RTCEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTCEV_A::VALUE1 + **self == RTCEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTCEV_A::VALUE2 + **self == RTCEV_A::VALUE2 + } +} +impl core::ops::Deref for RTCEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "ULP WDG Alarm Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ULPWDG`"] -pub type ULPWDG_R = crate::R; +#[doc = "Field `ULPWDG` reader - ULP WDG Alarm Status"] +pub struct ULPWDG_R(crate::FieldReader); impl ULPWDG_R { + pub(crate) fn new(bits: bool) -> Self { + ULPWDG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ULPWDG_A { @@ -136,12 +182,19 @@ impl ULPWDG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ULPWDG_A::VALUE1 + **self == ULPWDG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ULPWDG_A::VALUE2 + **self == ULPWDG_A::VALUE2 + } +} +impl core::ops::Deref for ULPWDG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Hibernate Control Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBNOUT`"] -pub type HIBNOUT_R = crate::R; +#[doc = "Field `HIBNOUT` reader - Hibernate Control Status"] +pub struct HIBNOUT_R(crate::FieldReader); impl HIBNOUT_R { + pub(crate) fn new(bits: bool) -> Self { + HIBNOUT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBNOUT_A { @@ -172,12 +228,19 @@ impl HIBNOUT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBNOUT_A::VALUE1 + **self == HIBNOUT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBNOUT_A::VALUE2 + **self == HIBNOUT_A::VALUE2 + } +} +impl core::ops::Deref for HIBNOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATPEV`"] -pub type VBATPEV_R = crate::R; +#[doc = "Field `VBATPEV` reader - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing"] +pub struct VBATPEV_R(crate::FieldReader); impl VBATPEV_R { + pub(crate) fn new(bits: bool) -> Self { + VBATPEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATPEV_A { @@ -208,12 +274,19 @@ impl VBATPEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATPEV_A::VALUE1 + **self == VBATPEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATPEV_A::VALUE2 + **self == VBATPEV_A::VALUE2 + } +} +impl core::ops::Deref for VBATPEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATNEV`"] -pub type VBATNEV_R = crate::R; +#[doc = "Field `VBATNEV` reader - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing"] +pub struct VBATNEV_R(crate::FieldReader); impl VBATNEV_R { + pub(crate) fn new(bits: bool) -> Self { + VBATNEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATNEV_A { @@ -244,12 +320,19 @@ impl VBATNEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATNEV_A::VALUE1 + **self == VBATNEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATNEV_A::VALUE2 + **self == VBATNEV_A::VALUE2 + } +} +impl core::ops::Deref for VBATNEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0PEV`"] -pub type AHIBIO0PEV_R = crate::R; +#[doc = "Field `AHIBIO0PEV` reader - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing"] +pub struct AHIBIO0PEV_R(crate::FieldReader); impl AHIBIO0PEV_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0PEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0PEV_A { @@ -280,12 +366,19 @@ impl AHIBIO0PEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0PEV_A::VALUE1 + **self == AHIBIO0PEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0PEV_A::VALUE2 + **self == AHIBIO0PEV_A::VALUE2 + } +} +impl core::ops::Deref for AHIBIO0PEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0NEV`"] -pub type AHIBIO0NEV_R = crate::R; +#[doc = "Field `AHIBIO0NEV` reader - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing"] +pub struct AHIBIO0NEV_R(crate::FieldReader); impl AHIBIO0NEV_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0NEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0NEV_A { @@ -316,12 +412,19 @@ impl AHIBIO0NEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0NEV_A::VALUE1 + **self == AHIBIO0NEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0NEV_A::VALUE2 + **self == AHIBIO0NEV_A::VALUE2 + } +} +impl core::ops::Deref for AHIBIO0NEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { AHIBIO0NEV_R::new(((self.bits >> 11) & 0x01) != 0) } } +#[doc = "Hibernate Domain Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hdstat](index.html) module"] +pub struct HDSTAT_SPEC; +impl crate::RegisterSpec for HDSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hdstat::R](R) reader structure"] +impl crate::Readable for HDSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HDSTAT to value 0"] +impl crate::Resettable for HDSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_hibernate/hintclr.rs b/src/scu_hibernate/hintclr.rs index c1d2e23e..d0f2761d 100644 --- a/src/scu_hibernate/hintclr.rs +++ b/src/scu_hibernate/hintclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register HINTCLR"] -pub type W = crate::W; -#[doc = "Register HINTCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::HINTCLR { - type Type = u32; +#[doc = "Register `HINTCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Internally Controlled Hibernate Sequence Request Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBNINT`"] +#[doc = "Field `HIBNINT` writer - Internally Controlled Hibernate Sequence Request Clear"] pub struct HIBNINT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> HIBNINT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBNINT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> HIBNINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLASHOFF`"] +#[doc = "Field `FLASHOFF` writer - VDDP Supply Switch of Flash Clear"] pub struct FLASHOFF_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> FLASHOFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLASHOFF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> FLASHOFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLASHPD`"] +#[doc = "Field `FLASHPD` writer - Flash Power Down Clear"] pub struct FLASHPD_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FLASHPD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLASHPD_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FLASHPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POFFD`"] +#[doc = "Field `POFFD` writer - PORST Pull-up OFF Direct Control Clear"] pub struct POFFD_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> POFFD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POFFD_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,11 +219,11 @@ impl<'a> POFFD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PPODEL`"] +#[doc = "Field `PPODEL` writer - Delay on PORTS Pull-up Switching OFF on Hibernate Request Clear"] pub struct PPODEL_W<'a> { w: &'a mut W, } @@ -228,7 +231,7 @@ impl<'a> PPODEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -246,7 +249,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POFFH`"] +#[doc = "Field `POFFH` writer - PORST Pull-up OFF in Hibernate Mode Clear"] pub struct POFFH_W<'a> { w: &'a mut W, } @@ -254,9 +257,7 @@ impl<'a> POFFH_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POFFH_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -281,7 +282,7 @@ impl<'a> POFFH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -316,4 +317,26 @@ impl W { pub fn poffh(&mut self) -> POFFH_W { POFFH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hibernate Internal Control Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintclr](index.html) module"] +pub struct HINTCLR_SPEC; +impl crate::RegisterSpec for HINTCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hintclr::W](W) writer structure"] +impl crate::Writable for HINTCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HINTCLR to value 0"] +impl crate::Resettable for HINTCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/hintset.rs b/src/scu_hibernate/hintset.rs index 70528937..a9516c7e 100644 --- a/src/scu_hibernate/hintset.rs +++ b/src/scu_hibernate/hintset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register HINTSET"] -pub type W = crate::W; -#[doc = "Register HINTSET `reset()`'s with value 0"] -impl crate::ResetValue for super::HINTSET { - type Type = u32; +#[doc = "Register `HINTSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Internally Controlled Hibernate Sequence Request Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBNINT`"] +#[doc = "Field `HIBNINT` writer - Internally Controlled Hibernate Sequence Request Set"] pub struct HIBNINT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> HIBNINT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBNINT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> HIBNINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VCOREOFF`"] +#[doc = "Field `VCOREOFF` writer - VDDC Generation off on EVR Set"] pub struct VCOREOFF_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> VCOREOFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOREOFF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> VCOREOFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLASHOFF`"] +#[doc = "Field `FLASHOFF` writer - VDDP Supply Switch of Flash Set"] pub struct FLASHOFF_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FLASHOFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLASHOFF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FLASHOFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLASHPD`"] +#[doc = "Field `FLASHPD` writer - Flash Power Down Set"] pub struct FLASHPD_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> FLASHPD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLASHPD_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> FLASHPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POFFD`"] +#[doc = "Field `POFFD` writer - PORST Pull-up OFF Direct Control Set"] pub struct POFFD_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> POFFD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POFFD_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,11 +270,11 @@ impl<'a> POFFD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Write proxy for field `PPODEL`"] +#[doc = "Field `PPODEL` writer - Delay on PORTS Pull-up Switching OFF on Hibernate Request Set"] pub struct PPODEL_W<'a> { w: &'a mut W, } @@ -281,7 +282,7 @@ impl<'a> PPODEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); self.w } } @@ -299,7 +300,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POFFH`"] +#[doc = "Field `POFFH` writer - PORST Pull-up OFF in Hibernate Mode Set"] pub struct POFFH_W<'a> { w: &'a mut W, } @@ -307,9 +308,7 @@ impl<'a> POFFH_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POFFH_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -334,7 +333,7 @@ impl<'a> POFFH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -374,4 +373,26 @@ impl W { pub fn poffh(&mut self) -> POFFH_W { POFFH_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Hibernate Internal Control Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintset](index.html) module"] +pub struct HINTSET_SPEC; +impl crate::RegisterSpec for HINTSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [hintset::W](W) writer structure"] +impl crate::Writable for HINTSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HINTSET to value 0"] +impl crate::Resettable for HINTSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/hintst.rs b/src/scu_hibernate/hintst.rs index e3d8434d..23a752ec 100644 --- a/src/scu_hibernate/hintst.rs +++ b/src/scu_hibernate/hintst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register HINTST"] -pub type R = crate::R; +#[doc = "Register `HINTST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Internally Controlled Hibernate Sequence Request State\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HIBNINT_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBNINT`"] -pub type HIBNINT_R = crate::R; +#[doc = "Field `HIBNINT` reader - Internally Controlled Hibernate Sequence Request State"] +pub struct HIBNINT_R(crate::FieldReader); impl HIBNINT_R { + pub(crate) fn new(bits: bool) -> Self { + HIBNINT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBNINT_A { @@ -28,12 +44,19 @@ impl HIBNINT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBNINT_A::VALUE1 + **self == HIBNINT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBNINT_A::VALUE2 + **self == HIBNINT_A::VALUE2 + } +} +impl core::ops::Deref for HIBNINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "VDDP Supply Switch of Flash State\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FLASHOFF`"] -pub type FLASHOFF_R = crate::R; +#[doc = "Field `FLASHOFF` reader - VDDP Supply Switch of Flash State"] +pub struct FLASHOFF_R(crate::FieldReader); impl FLASHOFF_R { + pub(crate) fn new(bits: bool) -> Self { + FLASHOFF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FLASHOFF_A { @@ -64,12 +90,19 @@ impl FLASHOFF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FLASHOFF_A::VALUE1 + **self == FLASHOFF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FLASHOFF_A::VALUE2 + **self == FLASHOFF_A::VALUE2 + } +} +impl core::ops::Deref for FLASHOFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Flash Power Down State\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FLASHPD`"] -pub type FLASHPD_R = crate::R; +#[doc = "Field `FLASHPD` reader - Flash Power Down State"] +pub struct FLASHPD_R(crate::FieldReader); impl FLASHPD_R { + pub(crate) fn new(bits: bool) -> Self { + FLASHPD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FLASHPD_A { @@ -100,12 +136,19 @@ impl FLASHPD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FLASHPD_A::VALUE1 + **self == FLASHPD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FLASHPD_A::VALUE2 + **self == FLASHPD_A::VALUE2 + } +} +impl core::ops::Deref for FLASHPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PORST Pull-up OFF Direct Control State\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `POFFD`"] -pub type POFFD_R = crate::R; +#[doc = "Field `POFFD` reader - PORST Pull-up OFF Direct Control State"] +pub struct POFFD_R(crate::FieldReader); impl POFFD_R { + pub(crate) fn new(bits: bool) -> Self { + POFFD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POFFD_A { @@ -136,16 +182,35 @@ impl POFFD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POFFD_A::VALUE1 + **self == POFFD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POFFD_A::VALUE2 + **self == POFFD_A::VALUE2 + } +} +impl core::ops::Deref for POFFD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPODEL` reader - Delay on PORTS Pull-up Switching OFF on Hibernate Request"] +pub struct PPODEL_R(crate::FieldReader); +impl PPODEL_R { + pub(crate) fn new(bits: u8) -> Self { + PPODEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PPODEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PPODEL`"] -pub type PPODEL_R = crate::R; #[doc = "PORST Pull-up OFF in Hibernate Mode State\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum POFFH_A { @@ -160,9 +225,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `POFFH`"] -pub type POFFH_R = crate::R; +#[doc = "Field `POFFH` reader - PORST Pull-up OFF in Hibernate Mode State"] +pub struct POFFH_R(crate::FieldReader); impl POFFH_R { + pub(crate) fn new(bits: bool) -> Self { + POFFH_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POFFH_A { @@ -174,12 +242,19 @@ impl POFFH_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POFFH_A::VALUE1 + **self == POFFH_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POFFH_A::VALUE2 + **self == POFFH_A::VALUE2 + } +} +impl core::ops::Deref for POFFH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -214,3 +289,19 @@ impl R { POFFH_R::new(((self.bits >> 20) & 0x01) != 0) } } +#[doc = "Hibernate Internal Control State Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hintst](index.html) module"] +pub struct HINTST_SPEC; +impl crate::RegisterSpec for HINTST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hintst::R](R) reader structure"] +impl crate::Readable for HINTST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HINTST to value 0"] +impl crate::Resettable for HINTST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_hibernate/lpacclr.rs b/src/scu_hibernate/lpacclr.rs index b70bcb12..d74aa930 100644 --- a/src/scu_hibernate/lpacclr.rs +++ b/src/scu_hibernate/lpacclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register LPACCLR"] -pub type W = crate::W; -#[doc = "Register LPACCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::LPACCLR { - type Type = u32; +#[doc = "Register `LPACCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Trigger VBAT Single Compare Operation Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATSCMP`"] +#[doc = "Field `VBATSCMP` writer - Trigger VBAT Single Compare Operation Clear"] pub struct VBATSCMP_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VBATSCMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATSCMP_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VBATSCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0SCMP`"] +#[doc = "Field `AHIBIO0SCMP` writer - Trigger HIB_IO_0 Input Single Compare Operation Clear"] pub struct AHIBIO0SCMP_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> AHIBIO0SCMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0SCMP_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> AHIBIO0SCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATVAL`"] +#[doc = "Field `VBATVAL` writer - VBAT Compare Operation Initial Value Clear"] pub struct VBATVAL_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> VBATVAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATVAL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> VBATVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0VAL`"] +#[doc = "Field `AHIBIO0VAL` writer - HIB_IO_0 Input Compare Initial Value Clear"] pub struct AHIBIO0VAL_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> AHIBIO0VAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0VAL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> AHIBIO0VAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W { AHIBIO0VAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LPAC Control Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacclr](index.html) module"] +pub struct LPACCLR_SPEC; +impl crate::RegisterSpec for LPACCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [lpacclr::W](W) writer structure"] +impl crate::Writable for LPACCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LPACCLR to value 0"] +impl crate::Resettable for LPACCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/lpacconf.rs b/src/scu_hibernate/lpacconf.rs index 2fb9d653..ed3716ff 100644 --- a/src/scu_hibernate/lpacconf.rs +++ b/src/scu_hibernate/lpacconf.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register LPACCONF"] -pub type R = crate::R; -#[doc = "Writer for register LPACCONF"] -pub type W = crate::W; -#[doc = "Register LPACCONF `reset()`'s with value 0x7000_0000"] -impl crate::ResetValue for super::LPACCONF { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x7000_0000 +#[doc = "Register `LPACCONF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LPACCONF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Compare Enable for Input Selection\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CMPEN`"] -pub type CMPEN_R = crate::R; +#[doc = "Field `CMPEN` reader - Compare Enable for Input Selection"] +pub struct CMPEN_R(crate::FieldReader); impl CMPEN_R { + pub(crate) fn new(bits: u8) -> Self { + CMPEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CMPEN_A::VALUE1), - 1 => Val(CMPEN_A::VALUE2), - 2 => Val(CMPEN_A::VALUE3), - 4 => Val(CMPEN_A::VALUE4), - i => Res(i), + 0 => Some(CMPEN_A::VALUE1), + 1 => Some(CMPEN_A::VALUE2), + 2 => Some(CMPEN_A::VALUE3), + 4 => Some(CMPEN_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMPEN_A::VALUE1 + **self == CMPEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMPEN_A::VALUE2 + **self == CMPEN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CMPEN_A::VALUE3 + **self == CMPEN_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CMPEN_A::VALUE4 + **self == CMPEN_A::VALUE4 + } +} +impl core::ops::Deref for CMPEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CMPEN`"] +#[doc = "Field `CMPEN` writer - Compare Enable for Input Selection"] pub struct CMPEN_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> CMPEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -127,61 +160,70 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRIGSEL`"] -pub type TRIGSEL_R = crate::R; +#[doc = "Field `TRIGSEL` reader - Analog Compare Trigger Select"] +pub struct TRIGSEL_R(crate::FieldReader); impl TRIGSEL_R { + pub(crate) fn new(bits: u8) -> Self { + TRIGSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TRIGSEL_A::VALUE1), - 1 => Val(TRIGSEL_A::VALUE2), - 2 => Val(TRIGSEL_A::VALUE3), - 3 => Val(TRIGSEL_A::VALUE4), - 5 => Val(TRIGSEL_A::VALUE5), - 6 => Val(TRIGSEL_A::VALUE6), - 7 => Val(TRIGSEL_A::VALUE7), - i => Res(i), + 0 => Some(TRIGSEL_A::VALUE1), + 1 => Some(TRIGSEL_A::VALUE2), + 2 => Some(TRIGSEL_A::VALUE3), + 3 => Some(TRIGSEL_A::VALUE4), + 5 => Some(TRIGSEL_A::VALUE5), + 6 => Some(TRIGSEL_A::VALUE6), + 7 => Some(TRIGSEL_A::VALUE7), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRIGSEL_A::VALUE1 + **self == TRIGSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRIGSEL_A::VALUE2 + **self == TRIGSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRIGSEL_A::VALUE3 + **self == TRIGSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TRIGSEL_A::VALUE4 + **self == TRIGSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == TRIGSEL_A::VALUE5 + **self == TRIGSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == TRIGSEL_A::VALUE6 + **self == TRIGSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == TRIGSEL_A::VALUE7 + **self == TRIGSEL_A::VALUE7 } } -#[doc = "Write proxy for field `TRIGSEL`"] +impl core::ops::Deref for TRIGSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGSEL` writer - Analog Compare Trigger Select"] pub struct TRIGSEL_W<'a> { w: &'a mut W, } @@ -229,13 +271,25 @@ impl<'a> TRIGSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `CONVDEL`"] -pub type CONVDEL_R = crate::R; -#[doc = "Write proxy for field `CONVDEL`"] +#[doc = "Field `CONVDEL` reader - Conversion Delay"] +pub struct CONVDEL_R(crate::FieldReader); +impl CONVDEL_R { + pub(crate) fn new(bits: bool) -> Self { + CONVDEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CONVDEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONVDEL` writer - Conversion Delay"] pub struct CONVDEL_W<'a> { w: &'a mut W, } @@ -253,13 +307,25 @@ impl<'a> CONVDEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `INTERVCNT`"] -pub type INTERVCNT_R = crate::R; -#[doc = "Write proxy for field `INTERVCNT`"] +#[doc = "Field `INTERVCNT` reader - Sub-second Interval Counter"] +pub struct INTERVCNT_R(crate::FieldReader); +impl INTERVCNT_R { + pub(crate) fn new(bits: u16) -> Self { + INTERVCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INTERVCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INTERVCNT` writer - Sub-second Interval Counter"] pub struct INTERVCNT_W<'a> { w: &'a mut W, } @@ -267,13 +333,25 @@ impl<'a> INTERVCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 16)) | (((value as u32) & 0x0fff) << 16); + self.w.bits = (self.w.bits & !(0x0fff << 16)) | ((value as u32 & 0x0fff) << 16); self.w } } -#[doc = "Reader of field `SETTLECNT`"] -pub type SETTLECNT_R = crate::R; -#[doc = "Write proxy for field `SETTLECNT`"] +#[doc = "Field `SETTLECNT` reader - LPAC Settle Time Counter"] +pub struct SETTLECNT_R(crate::FieldReader); +impl SETTLECNT_R { + pub(crate) fn new(bits: u8) -> Self { + SETTLECNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SETTLECNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SETTLECNT` writer - LPAC Settle Time Counter"] pub struct SETTLECNT_W<'a> { w: &'a mut W, } @@ -281,7 +359,7 @@ impl<'a> SETTLECNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -338,4 +416,30 @@ impl W { pub fn settlecnt(&mut self) -> SETTLECNT_W { SETTLECNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Analog Wake-up Configuration Register\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 [lpacconf](index.html) module"] +pub struct LPACCONF_SPEC; +impl crate::RegisterSpec for LPACCONF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lpacconf::R](R) reader structure"] +impl crate::Readable for LPACCONF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lpacconf::W](W) writer structure"] +impl crate::Writable for LPACCONF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LPACCONF to value 0x7000_0000"] +impl crate::Resettable for LPACCONF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x7000_0000 + } } diff --git a/src/scu_hibernate/lpacset.rs b/src/scu_hibernate/lpacset.rs index 49b121d4..c633232f 100644 --- a/src/scu_hibernate/lpacset.rs +++ b/src/scu_hibernate/lpacset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register LPACSET"] -pub type W = crate::W; -#[doc = "Register LPACSET `reset()`'s with value 0"] -impl crate::ResetValue for super::LPACSET { - type Type = u32; +#[doc = "Register `LPACSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Trigger VBAT Single Compare Operation Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATSCMP`"] +#[doc = "Field `VBATSCMP` writer - Trigger VBAT Single Compare Operation Set"] pub struct VBATSCMP_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VBATSCMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATSCMP_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VBATSCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0SCMP`"] +#[doc = "Field `AHIBIO0SCMP` writer - Trigger HIB_IO_0 Input Single Compare Operation Set"] pub struct AHIBIO0SCMP_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> AHIBIO0SCMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0SCMP_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> AHIBIO0SCMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VBATVAL`"] +#[doc = "Field `VBATVAL` writer - VBAT Compare Operation Initial Value Set"] pub struct VBATVAL_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> VBATVAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VBATVAL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> VBATVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AHIBIO0VAL`"] +#[doc = "Field `AHIBIO0VAL` writer - HIB_IO_0 Input Compare Initial Value Set"] pub struct AHIBIO0VAL_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> AHIBIO0VAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHIBIO0VAL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> AHIBIO0VAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W { AHIBIO0VAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LPAC Control Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacset](index.html) module"] +pub struct LPACSET_SPEC; +impl crate::RegisterSpec for LPACSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [lpacset::W](W) writer structure"] +impl crate::Writable for LPACSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LPACSET to value 0"] +impl crate::Resettable for LPACSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/lpacst.rs b/src/scu_hibernate/lpacst.rs index 33aa3dc6..01f94086 100644 --- a/src/scu_hibernate/lpacst.rs +++ b/src/scu_hibernate/lpacst.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register LPACST"] -pub type R = crate::R; +#[doc = "Register `LPACST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Trigger VBAT Single Compare Operation Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VBATSCMP_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATSCMP`"] -pub type VBATSCMP_R = crate::R; +#[doc = "Field `VBATSCMP` reader - Trigger VBAT Single Compare Operation Status"] +pub struct VBATSCMP_R(crate::FieldReader); impl VBATSCMP_R { + pub(crate) fn new(bits: bool) -> Self { + VBATSCMP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATSCMP_A { @@ -28,12 +44,19 @@ impl VBATSCMP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATSCMP_A::VALUE1 + **self == VBATSCMP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATSCMP_A::VALUE2 + **self == VBATSCMP_A::VALUE2 + } +} +impl core::ops::Deref for VBATSCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Trigger HIB_IO_0 Input Single Compare Operation Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0SCMP`"] -pub type AHIBIO0SCMP_R = crate::R; +#[doc = "Field `AHIBIO0SCMP` reader - Trigger HIB_IO_0 Input Single Compare Operation Status"] +pub struct AHIBIO0SCMP_R(crate::FieldReader); impl AHIBIO0SCMP_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0SCMP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0SCMP_A { @@ -64,12 +90,19 @@ impl AHIBIO0SCMP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0SCMP_A::VALUE1 + **self == AHIBIO0SCMP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0SCMP_A::VALUE2 + **self == AHIBIO0SCMP_A::VALUE2 + } +} +impl core::ops::Deref for AHIBIO0SCMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "VBAT Compare Operation Result\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VBATVAL`"] -pub type VBATVAL_R = crate::R; +#[doc = "Field `VBATVAL` reader - VBAT Compare Operation Result"] +pub struct VBATVAL_R(crate::FieldReader); impl VBATVAL_R { + pub(crate) fn new(bits: bool) -> Self { + VBATVAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VBATVAL_A { @@ -100,12 +136,19 @@ impl VBATVAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VBATVAL_A::VALUE1 + **self == VBATVAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VBATVAL_A::VALUE2 + **self == VBATVAL_A::VALUE2 + } +} +impl core::ops::Deref for VBATVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HIB_IO_0 Input Compare Operation Result\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHIBIO0VAL`"] -pub type AHIBIO0VAL_R = crate::R; +#[doc = "Field `AHIBIO0VAL` reader - HIB_IO_0 Input Compare Operation Result"] +pub struct AHIBIO0VAL_R(crate::FieldReader); impl AHIBIO0VAL_R { + pub(crate) fn new(bits: bool) -> Self { + AHIBIO0VAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHIBIO0VAL_A { @@ -136,12 +182,19 @@ impl AHIBIO0VAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHIBIO0VAL_A::VALUE1 + **self == AHIBIO0VAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHIBIO0VAL_A::VALUE2 + **self == AHIBIO0VAL_A::VALUE2 + } +} +impl core::ops::Deref for AHIBIO0VAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -166,3 +219,19 @@ impl R { AHIBIO0VAL_R::new(((self.bits >> 17) & 0x01) != 0) } } +#[doc = "Hibernate Analog Control State Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lpacst](index.html) module"] +pub struct LPACST_SPEC; +impl crate::RegisterSpec for LPACST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lpacst::R](R) reader structure"] +impl crate::Readable for LPACST_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LPACST to value 0"] +impl crate::Resettable for LPACST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_hibernate/lpacth0.rs b/src/scu_hibernate/lpacth0.rs index 412081d6..0459f013 100644 --- a/src/scu_hibernate/lpacth0.rs +++ b/src/scu_hibernate/lpacth0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LPACTH0"] -pub type R = crate::R; -#[doc = "Writer for register LPACTH0"] -pub type W = crate::W; -#[doc = "Register LPACTH0 `reset()`'s with value 0"] -impl crate::ResetValue for super::LPACTH0 { - type Type = u32; +#[doc = "Register `LPACTH0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LPACTH0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `VBATLO` reader - VBAT Lower Threshold Value"] +pub struct VBATLO_R(crate::FieldReader); +impl VBATLO_R { + pub(crate) fn new(bits: u8) -> Self { + VBATLO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VBATLO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `VBATLO`"] -pub type VBATLO_R = crate::R; -#[doc = "Write proxy for field `VBATLO`"] +#[doc = "Field `VBATLO` writer - VBAT Lower Threshold Value"] pub struct VBATLO_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> VBATLO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `VBATHI`"] -pub type VBATHI_R = crate::R; -#[doc = "Write proxy for field `VBATHI`"] +#[doc = "Field `VBATHI` reader - VBAT Upper Threshold Value"] +pub struct VBATHI_R(crate::FieldReader); +impl VBATHI_R { + pub(crate) fn new(bits: u8) -> Self { + VBATHI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VBATHI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VBATHI` writer - VBAT Upper Threshold Value"] pub struct VBATHI_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> VBATHI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn vbathi(&mut self) -> VBATHI_W { VBATHI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LPAC Threshold Register 0\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 [lpacth0](index.html) module"] +pub struct LPACTH0_SPEC; +impl crate::RegisterSpec for LPACTH0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lpacth0::R](R) reader structure"] +impl crate::Readable for LPACTH0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lpacth0::W](W) writer structure"] +impl crate::Writable for LPACTH0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LPACTH0 to value 0"] +impl crate::Resettable for LPACTH0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/lpacth1.rs b/src/scu_hibernate/lpacth1.rs index 3bdec694..80f85b07 100644 --- a/src/scu_hibernate/lpacth1.rs +++ b/src/scu_hibernate/lpacth1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register LPACTH1"] -pub type R = crate::R; -#[doc = "Writer for register LPACTH1"] -pub type W = crate::W; -#[doc = "Register LPACTH1 `reset()`'s with value 0"] -impl crate::ResetValue for super::LPACTH1 { - type Type = u32; +#[doc = "Register `LPACTH1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LPACTH1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `AHIBIO0LO` reader - Analog HIB_IO_0 Lower Threshold Value"] +pub struct AHIBIO0LO_R(crate::FieldReader); +impl AHIBIO0LO_R { + pub(crate) fn new(bits: u8) -> Self { + AHIBIO0LO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHIBIO0LO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `AHIBIO0LO`"] -pub type AHIBIO0LO_R = crate::R; -#[doc = "Write proxy for field `AHIBIO0LO`"] +#[doc = "Field `AHIBIO0LO` writer - Analog HIB_IO_0 Lower Threshold Value"] pub struct AHIBIO0LO_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> AHIBIO0LO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `AHIBIO0HI`"] -pub type AHIBIO0HI_R = crate::R; -#[doc = "Write proxy for field `AHIBIO0HI`"] +#[doc = "Field `AHIBIO0HI` reader - Analog HIB_IO_0 Upper Threshold Value"] +pub struct AHIBIO0HI_R(crate::FieldReader); +impl AHIBIO0HI_R { + pub(crate) fn new(bits: u8) -> Self { + AHIBIO0HI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHIBIO0HI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHIBIO0HI` writer - Analog HIB_IO_0 Upper Threshold Value"] pub struct AHIBIO0HI_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> AHIBIO0HI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W { AHIBIO0HI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LPAC Threshold Register 1\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 [lpacth1](index.html) module"] +pub struct LPACTH1_SPEC; +impl crate::RegisterSpec for LPACTH1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lpacth1::R](R) reader structure"] +impl crate::Readable for LPACTH1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lpacth1::W](W) writer structure"] +impl crate::Writable for LPACTH1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LPACTH1 to value 0"] +impl crate::Resettable for LPACTH1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_hibernate/oscsictrl.rs b/src/scu_hibernate/oscsictrl.rs index 55353b56..e71bb041 100644 --- a/src/scu_hibernate/oscsictrl.rs +++ b/src/scu_hibernate/oscsictrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OSCSICTRL"] -pub type R = crate::R; -#[doc = "Writer for register OSCSICTRL"] -pub type W = crate::W; -#[doc = "Register OSCSICTRL `reset()`'s with value 0x01"] -impl crate::ResetValue for super::OSCSICTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `OSCSICTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OSCSICTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Turn OFF the fOSI Clock Source\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PWD`"] -pub type PWD_R = crate::R; +#[doc = "Field `PWD` reader - Turn OFF the fOSI Clock Source"] +pub struct PWD_R(crate::FieldReader); impl PWD_R { + pub(crate) fn new(bits: bool) -> Self { + PWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PWD_A { @@ -38,15 +65,22 @@ impl PWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PWD_A::VALUE1 + **self == PWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PWD_A::VALUE2 + **self == PWD_A::VALUE2 + } +} +impl core::ops::Deref for PWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PWD`"] +#[doc = "Field `PWD` writer - Turn OFF the fOSI Clock Source"] pub struct PWD_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Enabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn pwd(&mut self) -> PWD_W { PWD_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "fOSI Control Register\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 [oscsictrl](index.html) module"] +pub struct OSCSICTRL_SPEC; +impl crate::RegisterSpec for OSCSICTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [oscsictrl::R](R) reader structure"] +impl crate::Readable for OSCSICTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [oscsictrl::W](W) writer structure"] +impl crate::Writable for OSCSICTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OSCSICTRL to value 0x01"] +impl crate::Resettable for OSCSICTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/scu_hibernate/osculctrl.rs b/src/scu_hibernate/osculctrl.rs index 49bfd674..3ceceec0 100644 --- a/src/scu_hibernate/osculctrl.rs +++ b/src/scu_hibernate/osculctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OSCULCTRL"] -pub type R = crate::R; -#[doc = "Writer for register OSCULCTRL"] -pub type W = crate::W; -#[doc = "Register OSCULCTRL `reset()`'s with value 0x20"] -impl crate::ResetValue for super::OSCULCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x20 +#[doc = "Register `OSCULCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OSCULCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "XTAL1 Data General Purpose Input Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `X1DEN`"] -pub type X1DEN_R = crate::R; +#[doc = "Field `X1DEN` reader - XTAL1 Data General Purpose Input Enable"] +pub struct X1DEN_R(crate::FieldReader); impl X1DEN_R { + pub(crate) fn new(bits: bool) -> Self { + X1DEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> X1DEN_A { @@ -38,15 +65,22 @@ impl X1DEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == X1DEN_A::VALUE1 + **self == X1DEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == X1DEN_A::VALUE2 + **self == X1DEN_A::VALUE2 } } -#[doc = "Write proxy for field `X1DEN`"] +impl core::ops::Deref for X1DEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `X1DEN` writer - XTAL1 Data General Purpose Input Enable"] pub struct X1DEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> X1DEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: X1DEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Data input inactivated, power down"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> X1DEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -104,9 +136,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MODE`"] -pub type MODE_R = crate::R; +#[doc = "Field `MODE` reader - Oscillator Mode"] +pub struct MODE_R(crate::FieldReader); impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODE_A { @@ -121,25 +156,32 @@ impl MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODE_A::VALUE1 + **self == MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODE_A::VALUE2 + **self == MODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MODE_A::VALUE3 + **self == MODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MODE_A::VALUE4 + **self == MODE_A::VALUE4 + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODE`"] +#[doc = "Field `MODE` writer - Oscillator Mode"] pub struct MODE_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Oscillator is enabled, in operation"] #[inline(always)] @@ -174,7 +214,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -201,4 +241,30 @@ impl W { pub fn mode(&mut self) -> MODE_W { MODE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "OSC_ULP Control Register\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 [osculctrl](index.html) module"] +pub struct OSCULCTRL_SPEC; +impl crate::RegisterSpec for OSCULCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [osculctrl::R](R) reader structure"] +impl crate::Readable for OSCULCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [osculctrl::W](W) writer structure"] +impl crate::Writable for OSCULCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OSCULCTRL to value 0x20"] +impl crate::Resettable for OSCULCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x20 + } } diff --git a/src/scu_hibernate/osculstat.rs b/src/scu_hibernate/osculstat.rs index ccb92073..eab06cd6 100644 --- a/src/scu_hibernate/osculstat.rs +++ b/src/scu_hibernate/osculstat.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register OSCULSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `X1D`"] -pub type X1D_R = crate::R; +#[doc = "Register `OSCULSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `X1D` reader - XTAL1 Data Value"] +pub struct X1D_R(crate::FieldReader); +impl X1D_R { + pub(crate) fn new(bits: bool) -> Self { + X1D_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for X1D_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - XTAL1 Data Value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { X1D_R::new((self.bits & 0x01) != 0) } } +#[doc = "OSC_ULP Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [osculstat](index.html) module"] +pub struct OSCULSTAT_SPEC; +impl crate::RegisterSpec for OSCULSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [osculstat::R](R) reader structure"] +impl crate::Readable for OSCULSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets OSCULSTAT to value 0"] +impl crate::Resettable for OSCULSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_interrupt.rs b/src/scu_interrupt.rs index e6fb0ea9..19633875 100644 --- a/src/scu_interrupt.rs +++ b/src/scu_interrupt.rs @@ -2,73 +2,39 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - SCU Service Request Status"] - pub srstat: SRSTAT, + pub srstat: crate::Reg, #[doc = "0x04 - SCU Raw Service Request Status"] - pub srraw: SRRAW, + pub srraw: crate::Reg, #[doc = "0x08 - SCU Service Request Mask"] - pub srmsk: SRMSK, + pub srmsk: crate::Reg, #[doc = "0x0c - SCU Service Request Clear"] - pub srclr: SRCLR, + pub srclr: crate::Reg, #[doc = "0x10 - SCU Service Request Set"] - pub srset: SRSET, + pub srset: crate::Reg, #[doc = "0x14 - SCU Service Request Mask"] - pub nmireqen: NMIREQEN, + pub nmireqen: crate::Reg, } -#[doc = "SCU Service Request Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srstat](srstat) module"] -pub type SRSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRSTAT; -#[doc = "`read()` method returns [srstat::R](srstat::R) reader structure"] -impl crate::Readable for SRSTAT {} +#[doc = "SRSTAT register accessor: an alias for `Reg`"] +pub type SRSTAT = crate::Reg; #[doc = "SCU Service Request Status"] pub mod srstat; -#[doc = "SCU Raw Service Request Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srraw](srraw) module"] -pub type SRRAW = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRRAW; -#[doc = "`read()` method returns [srraw::R](srraw::R) reader structure"] -impl crate::Readable for SRRAW {} +#[doc = "SRRAW register accessor: an alias for `Reg`"] +pub type SRRAW = crate::Reg; #[doc = "SCU Raw Service Request Status"] pub mod srraw; -#[doc = "SCU Service Request Mask\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srmsk](srmsk) module"] -pub type SRMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRMSK; -#[doc = "`read()` method returns [srmsk::R](srmsk::R) reader structure"] -impl crate::Readable for SRMSK {} -#[doc = "`write(|w| ..)` method takes [srmsk::W](srmsk::W) writer structure"] -impl crate::Writable for SRMSK {} +#[doc = "SRMSK register accessor: an alias for `Reg`"] +pub type SRMSK = crate::Reg; #[doc = "SCU Service Request Mask"] pub mod srmsk; -#[doc = "SCU Service Request Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srclr](srclr) module"] -pub type SRCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRCLR; -#[doc = "`write(|w| ..)` method takes [srclr::W](srclr::W) writer structure"] -impl crate::Writable for SRCLR {} +#[doc = "SRCLR register accessor: an alias for `Reg`"] +pub type SRCLR = crate::Reg; #[doc = "SCU Service Request Clear"] pub mod srclr; -#[doc = "SCU Service Request Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srset](srset) module"] -pub type SRSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRSET; -#[doc = "`write(|w| ..)` method takes [srset::W](srset::W) writer structure"] -impl crate::Writable for SRSET {} +#[doc = "SRSET register accessor: an alias for `Reg`"] +pub type SRSET = crate::Reg; #[doc = "SCU Service Request Set"] pub mod srset; -#[doc = "SCU Service Request Mask\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nmireqen](nmireqen) module"] -pub type NMIREQEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _NMIREQEN; -#[doc = "`read()` method returns [nmireqen::R](nmireqen::R) reader structure"] -impl crate::Readable for NMIREQEN {} -#[doc = "`write(|w| ..)` method takes [nmireqen::W](nmireqen::W) writer structure"] -impl crate::Writable for NMIREQEN {} +#[doc = "NMIREQEN register accessor: an alias for `Reg`"] +pub type NMIREQEN = crate::Reg; #[doc = "SCU Service Request Mask"] pub mod nmireqen; diff --git a/src/scu_interrupt/nmireqen.rs b/src/scu_interrupt/nmireqen.rs index aa7f9fab..2cc27e9d 100644 --- a/src/scu_interrupt/nmireqen.rs +++ b/src/scu_interrupt/nmireqen.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register NMIREQEN"] -pub type R = crate::R; -#[doc = "Writer for register NMIREQEN"] -pub type W = crate::W; -#[doc = "Register NMIREQEN `reset()`'s with value 0"] -impl crate::ResetValue for super::NMIREQEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `NMIREQEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NMIREQEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Promote Pre-Warning Interrupt Request to NMI Request\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRWARN`"] -pub type PRWARN_R = crate::R; +#[doc = "Field `PRWARN` reader - Promote Pre-Warning Interrupt Request to NMI Request"] +pub struct PRWARN_R(crate::FieldReader); impl PRWARN_R { + pub(crate) fn new(bits: bool) -> Self { + PRWARN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRWARN_A { @@ -38,15 +65,22 @@ impl PRWARN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRWARN_A::VALUE1 + **self == PRWARN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRWARN_A::VALUE2 + **self == PRWARN_A::VALUE2 } } -#[doc = "Write proxy for field `PRWARN`"] +impl core::ops::Deref for PRWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRWARN` writer - Promote Pre-Warning Interrupt Request to NMI Request"] pub struct PRWARN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRWARN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PI`"] -pub type PI_R = crate::R; +#[doc = "Field `PI` reader - Promote RTC Periodic Interrupt request to NMI Request"] +pub struct PI_R(crate::FieldReader); impl PI_R { + pub(crate) fn new(bits: bool) -> Self { + PI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PI_A { @@ -113,15 +148,22 @@ impl PI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PI_A::VALUE1 + **self == PI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PI_A::VALUE2 + **self == PI_A::VALUE2 + } +} +impl core::ops::Deref for PI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PI`"] +#[doc = "Field `PI` writer - Promote RTC Periodic Interrupt request to NMI Request"] pub struct PI_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AI`"] -pub type AI_R = crate::R; +#[doc = "Field `AI` reader - Promote RTC Alarm Interrupt Request to NMI Request"] +pub struct AI_R(crate::FieldReader); impl AI_R { + pub(crate) fn new(bits: bool) -> Self { + AI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AI_A { @@ -188,15 +231,22 @@ impl AI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AI_A::VALUE1 + **self == AI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AI_A::VALUE2 + **self == AI_A::VALUE2 } } -#[doc = "Write proxy for field `AI`"] +impl core::ops::Deref for AI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AI` writer - Promote RTC Alarm Interrupt Request to NMI Request"] pub struct AI_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU00`"] -pub type ERU00_R = crate::R; +#[doc = "Field `ERU00` reader - Promote Channel 0 Interrupt of ERU0 Request to NMI Request"] +pub struct ERU00_R(crate::FieldReader); impl ERU00_R { + pub(crate) fn new(bits: bool) -> Self { + ERU00_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU00_A { @@ -263,15 +314,22 @@ impl ERU00_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU00_A::VALUE1 + **self == ERU00_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU00_A::VALUE2 + **self == ERU00_A::VALUE2 + } +} +impl core::ops::Deref for ERU00_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ERU00`"] +#[doc = "Field `ERU00` writer - Promote Channel 0 Interrupt of ERU0 Request to NMI Request"] pub struct ERU00_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> ERU00_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU00_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> ERU00_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU01`"] -pub type ERU01_R = crate::R; +#[doc = "Field `ERU01` reader - Promote Channel 1 Interrupt of ERU0 Request to NMI Request"] +pub struct ERU01_R(crate::FieldReader); impl ERU01_R { + pub(crate) fn new(bits: bool) -> Self { + ERU01_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU01_A { @@ -338,15 +397,22 @@ impl ERU01_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU01_A::VALUE1 + **self == ERU01_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU01_A::VALUE2 + **self == ERU01_A::VALUE2 } } -#[doc = "Write proxy for field `ERU01`"] +impl core::ops::Deref for ERU01_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERU01` writer - Promote Channel 1 Interrupt of ERU0 Request to NMI Request"] pub struct ERU01_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> ERU01_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU01_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> ERU01_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU02`"] -pub type ERU02_R = crate::R; +#[doc = "Field `ERU02` reader - Promote Channel 2 Interrupt of ERU0 Request to NMI Request"] +pub struct ERU02_R(crate::FieldReader); impl ERU02_R { + pub(crate) fn new(bits: bool) -> Self { + ERU02_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU02_A { @@ -413,15 +480,22 @@ impl ERU02_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU02_A::VALUE1 + **self == ERU02_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU02_A::VALUE2 + **self == ERU02_A::VALUE2 } } -#[doc = "Write proxy for field `ERU02`"] +impl core::ops::Deref for ERU02_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERU02` writer - Promote Channel 2 Interrupt of ERU0 Request to NMI Request"] pub struct ERU02_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> ERU02_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU02_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> ERU02_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU03`"] -pub type ERU03_R = crate::R; +#[doc = "Field `ERU03` reader - Promote Channel 3 Interrupt of ERU0 Request to NMI Request"] +pub struct ERU03_R(crate::FieldReader); impl ERU03_R { + pub(crate) fn new(bits: bool) -> Self { + ERU03_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU03_A { @@ -488,15 +563,22 @@ impl ERU03_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU03_A::VALUE1 + **self == ERU03_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU03_A::VALUE2 + **self == ERU03_A::VALUE2 + } +} +impl core::ops::Deref for ERU03_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ERU03`"] +#[doc = "Field `ERU03` writer - Promote Channel 3 Interrupt of ERU0 Request to NMI Request"] pub struct ERU03_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> ERU03_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU03_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> ERU03_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn eru03(&mut self) -> ERU03_W { ERU03_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SCU Service Request Mask\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 [nmireqen](index.html) module"] +pub struct NMIREQEN_SPEC; +impl crate::RegisterSpec for NMIREQEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nmireqen::R](R) reader structure"] +impl crate::Readable for NMIREQEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nmireqen::W](W) writer structure"] +impl crate::Writable for NMIREQEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NMIREQEN to value 0"] +impl crate::Resettable for NMIREQEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_interrupt/srclr.rs b/src/scu_interrupt/srclr.rs index e5531be6..00657f99 100644 --- a/src/scu_interrupt/srclr.rs +++ b/src/scu_interrupt/srclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register SRCLR"] -pub type W = crate::W; -#[doc = "Register SRCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::SRCLR { - type Type = u32; +#[doc = "Register `SRCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT pre-warning Interrupt Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PRWARN`"] +#[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Clear"] pub struct PRWARN_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRWARN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PI`"] +#[doc = "Field `PI` writer - RTC Periodic Interrupt Clear"] pub struct PI_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AI`"] +#[doc = "Field `AI` writer - RTC Alarm Interrupt Clear"] pub struct AI_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DLROVR`"] +#[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt clear"] pub struct DLROVR_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLROVR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACCR`"] +#[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Clear"] pub struct LPACCR_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACTH0`"] +#[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Clear"] pub struct LPACTH0_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACTH1`"] +#[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Clear"] pub struct LPACTH1_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACST`"] +#[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Clear"] pub struct LPACST_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACST_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACCLR`"] +#[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Clear"] pub struct LPACCLR_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACSET`"] +#[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Clear"] pub struct LPACSET_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -552,7 +543,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTST`"] +#[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Clear"] pub struct HINTST_W<'a> { w: &'a mut W, } @@ -560,9 +551,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTST_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -587,7 +576,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -605,7 +594,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTCLR`"] +#[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Clear"] pub struct HINTCLR_W<'a> { w: &'a mut W, } @@ -613,9 +602,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -640,7 +627,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -658,7 +645,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTSET`"] +#[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Clear"] pub struct HINTSET_W<'a> { w: &'a mut W, } @@ -666,9 +653,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -693,7 +678,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -711,7 +696,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDCLR`"] +#[doc = "Field `HDCLR` writer - HDCLR Mirror Register Update Clear"] pub struct HDCLR_W<'a> { w: &'a mut W, } @@ -719,9 +704,7 @@ impl<'a> HDCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -746,7 +729,7 @@ impl<'a> HDCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -764,7 +747,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDSET`"] +#[doc = "Field `HDSET` writer - HDSET Mirror Register Update Clear"] pub struct HDSET_W<'a> { w: &'a mut W, } @@ -772,9 +755,7 @@ impl<'a> HDSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -799,7 +780,7 @@ impl<'a> HDSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -817,7 +798,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDCR`"] +#[doc = "Field `HDCR` writer - HDCR Mirror Register Update Clear"] pub struct HDCR_W<'a> { w: &'a mut W, } @@ -825,9 +806,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -852,7 +831,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -870,7 +849,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `OSCSICTRL`"] +#[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Clear"] pub struct OSCSICTRL_W<'a> { w: &'a mut W, } @@ -878,9 +857,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCSICTRL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -905,7 +882,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -923,7 +900,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `OSCULCTRL`"] +#[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Clear"] pub struct OSCULCTRL_W<'a> { w: &'a mut W, } @@ -931,9 +908,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCULCTRL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -958,7 +933,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -976,7 +951,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_CTR`"] +#[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Clear"] pub struct RTC_CTR_W<'a> { w: &'a mut W, } @@ -984,9 +959,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_CTR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1011,7 +984,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1029,7 +1002,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_ATIM0`"] +#[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Clear"] pub struct RTC_ATIM0_W<'a> { w: &'a mut W, } @@ -1037,9 +1010,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1064,7 +1035,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1082,7 +1053,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_ATIM1`"] +#[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Clear"] pub struct RTC_ATIM1_W<'a> { w: &'a mut W, } @@ -1090,9 +1061,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1117,7 +1086,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1135,7 +1104,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_TIM0`"] +#[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Clear"] pub struct RTC_TIM0_W<'a> { w: &'a mut W, } @@ -1143,9 +1112,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1170,7 +1137,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1188,7 +1155,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_TIM1`"] +#[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Clear"] pub struct RTC_TIM1_W<'a> { w: &'a mut W, } @@ -1196,9 +1163,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1223,7 +1188,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -1241,7 +1206,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RMX`"] +#[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Clear"] pub struct RMX_W<'a> { w: &'a mut W, } @@ -1249,9 +1214,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RMX_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1276,7 +1239,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -1401,4 +1364,26 @@ impl W { pub fn rmx(&mut self) -> RMX_W { RMX_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SCU Service Request Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srclr](index.html) module"] +pub struct SRCLR_SPEC; +impl crate::RegisterSpec for SRCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [srclr::W](W) writer structure"] +impl crate::Writable for SRCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRCLR to value 0"] +impl crate::Resettable for SRCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_interrupt/srmsk.rs b/src/scu_interrupt/srmsk.rs index b29f1982..2284a6d0 100644 --- a/src/scu_interrupt/srmsk.rs +++ b/src/scu_interrupt/srmsk.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SRMSK"] -pub type R = crate::R; -#[doc = "Writer for register SRMSK"] -pub type W = crate::W; -#[doc = "Register SRMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::SRMSK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SRMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SRMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT pre-warning Interrupt Mask\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRWARN`"] -pub type PRWARN_R = crate::R; +#[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Mask"] +pub struct PRWARN_R(crate::FieldReader); impl PRWARN_R { + pub(crate) fn new(bits: bool) -> Self { + PRWARN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRWARN_A { @@ -38,15 +65,22 @@ impl PRWARN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRWARN_A::VALUE1 + **self == PRWARN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRWARN_A::VALUE2 + **self == PRWARN_A::VALUE2 + } +} +impl core::ops::Deref for PRWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PRWARN`"] +#[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Mask"] pub struct PRWARN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRWARN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PI`"] -pub type PI_R = crate::R; +#[doc = "Field `PI` reader - RTC Periodic Interrupt Mask"] +pub struct PI_R(crate::FieldReader); impl PI_R { + pub(crate) fn new(bits: bool) -> Self { + PI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PI_A { @@ -113,15 +148,22 @@ impl PI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PI_A::VALUE1 + **self == PI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PI_A::VALUE2 + **self == PI_A::VALUE2 + } +} +impl core::ops::Deref for PI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PI`"] +#[doc = "Field `PI` writer - RTC Periodic Interrupt Mask"] pub struct PI_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AI`"] -pub type AI_R = crate::R; +#[doc = "Field `AI` reader - RTC Alarm Interrupt Mask"] +pub struct AI_R(crate::FieldReader); impl AI_R { + pub(crate) fn new(bits: bool) -> Self { + AI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AI_A { @@ -188,15 +231,22 @@ impl AI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AI_A::VALUE1 + **self == AI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AI_A::VALUE2 + **self == AI_A::VALUE2 + } +} +impl core::ops::Deref for AI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `AI`"] +#[doc = "Field `AI` writer - RTC Alarm Interrupt Mask"] pub struct AI_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLROVR`"] -pub type DLROVR_R = crate::R; +#[doc = "Field `DLROVR` reader - DLR Request Overrun Interrupt Mask"] +pub struct DLROVR_R(crate::FieldReader); impl DLROVR_R { + pub(crate) fn new(bits: bool) -> Self { + DLROVR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLROVR_A { @@ -263,15 +314,22 @@ impl DLROVR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLROVR_A::VALUE1 + **self == DLROVR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLROVR_A::VALUE2 + **self == DLROVR_A::VALUE2 } } -#[doc = "Write proxy for field `DLROVR`"] +impl core::ops::Deref for DLROVR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt Mask"] pub struct DLROVR_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLROVR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCR`"] -pub type LPACCR_R = crate::R; +#[doc = "Field `LPACCR` reader - LPACLR Mirror Register Update Interrupt Mask"] +pub struct LPACCR_R(crate::FieldReader); impl LPACCR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCR_A { @@ -338,15 +397,22 @@ impl LPACCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCR_A::VALUE1 + **self == LPACCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCR_A::VALUE2 + **self == LPACCR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPACCR`"] +#[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Mask"] pub struct LPACCR_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH0`"] -pub type LPACTH0_R = crate::R; +#[doc = "Field `LPACTH0` reader - LPACTH0 Mirror Register Update Interrupt Mask"] +pub struct LPACTH0_R(crate::FieldReader); impl LPACTH0_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH0_A { @@ -413,15 +480,22 @@ impl LPACTH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH0_A::VALUE1 + **self == LPACTH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH0_A::VALUE2 + **self == LPACTH0_A::VALUE2 } } -#[doc = "Write proxy for field `LPACTH0`"] +impl core::ops::Deref for LPACTH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Mask"] pub struct LPACTH0_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH1`"] -pub type LPACTH1_R = crate::R; +#[doc = "Field `LPACTH1` reader - LPACTH1 Mirror Register Update Interrupt Mask"] +pub struct LPACTH1_R(crate::FieldReader); impl LPACTH1_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH1_A { @@ -488,15 +563,22 @@ impl LPACTH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH1_A::VALUE1 + **self == LPACTH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH1_A::VALUE2 + **self == LPACTH1_A::VALUE2 } } -#[doc = "Write proxy for field `LPACTH1`"] +impl core::ops::Deref for LPACTH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Mask"] pub struct LPACTH1_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACST`"] -pub type LPACST_R = crate::R; +#[doc = "Field `LPACST` reader - LPACST Mirror Register Update Interrupt Mask"] +pub struct LPACST_R(crate::FieldReader); impl LPACST_R { + pub(crate) fn new(bits: bool) -> Self { + LPACST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACST_A { @@ -563,15 +646,22 @@ impl LPACST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACST_A::VALUE1 + **self == LPACST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACST_A::VALUE2 + **self == LPACST_A::VALUE2 } } -#[doc = "Write proxy for field `LPACST`"] +impl core::ops::Deref for LPACST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Mask"] pub struct LPACST_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCLR`"] -pub type LPACCLR_R = crate::R; +#[doc = "Field `LPACCLR` reader - LPACCLR Mirror Register Update Interrupt Mask"] +pub struct LPACCLR_R(crate::FieldReader); impl LPACCLR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCLR_A { @@ -638,15 +729,22 @@ impl LPACCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCLR_A::VALUE1 + **self == LPACCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCLR_A::VALUE2 + **self == LPACCLR_A::VALUE2 } } -#[doc = "Write proxy for field `LPACCLR`"] +impl core::ops::Deref for LPACCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Mask"] pub struct LPACCLR_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCLR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACSET`"] -pub type LPACSET_R = crate::R; +#[doc = "Field `LPACSET` reader - LPACSET Mirror Register Update Interrupt Mask"] +pub struct LPACSET_R(crate::FieldReader); impl LPACSET_R { + pub(crate) fn new(bits: bool) -> Self { + LPACSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACSET_A { @@ -713,15 +812,22 @@ impl LPACSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACSET_A::VALUE1 + **self == LPACSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACSET_A::VALUE2 + **self == LPACSET_A::VALUE2 + } +} +impl core::ops::Deref for LPACSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LPACSET`"] +#[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Mask"] pub struct LPACSET_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACSET_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTST`"] -pub type HINTST_R = crate::R; +#[doc = "Field `HINTST` reader - HINTST Mirror Register Update Interrupt Mask"] +pub struct HINTST_R(crate::FieldReader); impl HINTST_R { + pub(crate) fn new(bits: bool) -> Self { + HINTST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTST_A { @@ -788,15 +895,22 @@ impl HINTST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTST_A::VALUE1 + **self == HINTST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTST_A::VALUE2 + **self == HINTST_A::VALUE2 + } +} +impl core::ops::Deref for HINTST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HINTST`"] +#[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Mask"] pub struct HINTST_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTCLR`"] -pub type HINTCLR_R = crate::R; +#[doc = "Field `HINTCLR` reader - HINTCLR Mirror Register Update Interrupt Mask"] +pub struct HINTCLR_R(crate::FieldReader); impl HINTCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HINTCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTCLR_A { @@ -863,15 +978,22 @@ impl HINTCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTCLR_A::VALUE1 + **self == HINTCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTCLR_A::VALUE2 + **self == HINTCLR_A::VALUE2 } } -#[doc = "Write proxy for field `HINTCLR`"] +impl core::ops::Deref for HINTCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Mask"] pub struct HINTCLR_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTCLR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTSET`"] -pub type HINTSET_R = crate::R; +#[doc = "Field `HINTSET` reader - HINTSET Mirror Register Update Interrupt Mask"] +pub struct HINTSET_R(crate::FieldReader); impl HINTSET_R { + pub(crate) fn new(bits: bool) -> Self { + HINTSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTSET_A { @@ -938,15 +1061,22 @@ impl HINTSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTSET_A::VALUE1 + **self == HINTSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTSET_A::VALUE2 + **self == HINTSET_A::VALUE2 } } -#[doc = "Write proxy for field `HINTSET`"] +impl core::ops::Deref for HINTSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Mask"] pub struct HINTSET_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTSET_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCLR`"] -pub type HDCLR_R = crate::R; +#[doc = "Field `HDCLR` reader - HDCLR Mirror Register Update Mask"] +pub struct HDCLR_R(crate::FieldReader); impl HDCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCLR_A { @@ -1013,15 +1144,22 @@ impl HDCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCLR_A::VALUE1 + **self == HDCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCLR_A::VALUE2 + **self == HDCLR_A::VALUE2 + } +} +impl core::ops::Deref for HDCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HDCLR`"] +#[doc = "Field `HDCLR` writer - HDCLR Mirror Register Update Mask"] pub struct HDCLR_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> HDCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCLR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> HDCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDSET`"] -pub type HDSET_R = crate::R; +#[doc = "Field `HDSET` reader - HDSET Mirror Register Update Mask"] +pub struct HDSET_R(crate::FieldReader); impl HDSET_R { + pub(crate) fn new(bits: bool) -> Self { + HDSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDSET_A { @@ -1088,15 +1227,22 @@ impl HDSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDSET_A::VALUE1 + **self == HDSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDSET_A::VALUE2 + **self == HDSET_A::VALUE2 } } -#[doc = "Write proxy for field `HDSET`"] +impl core::ops::Deref for HDSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HDSET` writer - HDSET Mirror Register Update Mask"] pub struct HDSET_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> HDSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDSET_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> HDSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCR`"] -pub type HDCR_R = crate::R; +#[doc = "Field `HDCR` reader - HDCR Mirror Register Update Mask"] +pub struct HDCR_R(crate::FieldReader); impl HDCR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCR_A { @@ -1163,15 +1310,22 @@ impl HDCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCR_A::VALUE1 + **self == HDCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCR_A::VALUE2 + **self == HDCR_A::VALUE2 } } -#[doc = "Write proxy for field `HDCR`"] +impl core::ops::Deref for HDCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HDCR` writer - HDCR Mirror Register Update Mask"] pub struct HDCR_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -1224,9 +1376,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCSICTRL`"] -pub type OSCSICTRL_R = crate::R; +#[doc = "Field `OSCSICTRL` reader - OSCSICTRL Mirror Register Update Mask"] +pub struct OSCSICTRL_R(crate::FieldReader); impl OSCSICTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCSICTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCSICTRL_A { @@ -1238,15 +1393,22 @@ impl OSCSICTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCSICTRL_A::VALUE1 + **self == OSCSICTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCSICTRL_A::VALUE2 + **self == OSCSICTRL_A::VALUE2 } } -#[doc = "Write proxy for field `OSCSICTRL`"] +impl core::ops::Deref for OSCSICTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Mask"] pub struct OSCSICTRL_W<'a> { w: &'a mut W, } @@ -1254,9 +1416,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCSICTRL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1281,7 +1441,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -1299,9 +1459,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCULCTRL`"] -pub type OSCULCTRL_R = crate::R; +#[doc = "Field `OSCULCTRL` reader - OSCULCTRL Mirror Register Update Mask"] +pub struct OSCULCTRL_R(crate::FieldReader); impl OSCULCTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCULCTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCULCTRL_A { @@ -1313,15 +1476,22 @@ impl OSCULCTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCULCTRL_A::VALUE1 + **self == OSCULCTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCULCTRL_A::VALUE2 + **self == OSCULCTRL_A::VALUE2 } } -#[doc = "Write proxy for field `OSCULCTRL`"] +impl core::ops::Deref for OSCULCTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Mask"] pub struct OSCULCTRL_W<'a> { w: &'a mut W, } @@ -1329,9 +1499,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCULCTRL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1356,7 +1524,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -1374,9 +1542,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_CTR`"] -pub type RTC_CTR_R = crate::R; +#[doc = "Field `RTC_CTR` reader - RTC CTR Mirror Register Update Mask"] +pub struct RTC_CTR_R(crate::FieldReader); impl RTC_CTR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_CTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_CTR_A { @@ -1388,15 +1559,22 @@ impl RTC_CTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_CTR_A::VALUE1 + **self == RTC_CTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_CTR_A::VALUE2 + **self == RTC_CTR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_CTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RTC_CTR`"] +#[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Mask"] pub struct RTC_CTR_W<'a> { w: &'a mut W, } @@ -1404,9 +1582,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_CTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1431,7 +1607,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1449,9 +1625,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM0`"] -pub type RTC_ATIM0_R = crate::R; +#[doc = "Field `RTC_ATIM0` reader - RTC ATIM0 Mirror Register Update Mask"] +pub struct RTC_ATIM0_R(crate::FieldReader); impl RTC_ATIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM0_A { @@ -1463,15 +1642,22 @@ impl RTC_ATIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM0_A::VALUE1 + **self == RTC_ATIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM0_A::VALUE2 + **self == RTC_ATIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RTC_ATIM0`"] +#[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Mask"] pub struct RTC_ATIM0_W<'a> { w: &'a mut W, } @@ -1479,9 +1665,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1506,7 +1690,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1524,9 +1708,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM1`"] -pub type RTC_ATIM1_R = crate::R; +#[doc = "Field `RTC_ATIM1` reader - RTC ATIM1 Mirror Register Update Mask"] +pub struct RTC_ATIM1_R(crate::FieldReader); impl RTC_ATIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM1_A { @@ -1538,15 +1725,22 @@ impl RTC_ATIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM1_A::VALUE1 + **self == RTC_ATIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM1_A::VALUE2 + **self == RTC_ATIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RTC_ATIM1`"] +#[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Mask"] pub struct RTC_ATIM1_W<'a> { w: &'a mut W, } @@ -1554,9 +1748,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1581,7 +1773,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1599,9 +1791,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM0`"] -pub type RTC_TIM0_R = crate::R; +#[doc = "Field `RTC_TIM0` reader - RTC TIM0 Mirror Register Update Mask"] +pub struct RTC_TIM0_R(crate::FieldReader); impl RTC_TIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM0_A { @@ -1613,15 +1808,22 @@ impl RTC_TIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM0_A::VALUE1 + **self == RTC_TIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM0_A::VALUE2 + **self == RTC_TIM0_A::VALUE2 } } -#[doc = "Write proxy for field `RTC_TIM0`"] +impl core::ops::Deref for RTC_TIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Mask"] pub struct RTC_TIM0_W<'a> { w: &'a mut W, } @@ -1629,9 +1831,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1656,7 +1856,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1674,9 +1874,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM1`"] -pub type RTC_TIM1_R = crate::R; +#[doc = "Field `RTC_TIM1` reader - RTC TIM1 Mirror Register Update Mask"] +pub struct RTC_TIM1_R(crate::FieldReader); impl RTC_TIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM1_A { @@ -1688,15 +1891,22 @@ impl RTC_TIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM1_A::VALUE1 + **self == RTC_TIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM1_A::VALUE2 + **self == RTC_TIM1_A::VALUE2 } } -#[doc = "Write proxy for field `RTC_TIM1`"] +impl core::ops::Deref for RTC_TIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Mask"] pub struct RTC_TIM1_W<'a> { w: &'a mut W, } @@ -1704,9 +1914,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1731,7 +1939,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -1749,9 +1957,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RMX`"] -pub type RMX_R = crate::R; +#[doc = "Field `RMX` reader - Retention Memory Mirror Register Update Mask"] +pub struct RMX_R(crate::FieldReader); impl RMX_R { + pub(crate) fn new(bits: bool) -> Self { + RMX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RMX_A { @@ -1763,15 +1974,22 @@ impl RMX_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RMX_A::VALUE1 + **self == RMX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RMX_A::VALUE2 + **self == RMX_A::VALUE2 } } -#[doc = "Write proxy for field `RMX`"] +impl core::ops::Deref for RMX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Mask"] pub struct RMX_W<'a> { w: &'a mut W, } @@ -1779,9 +1997,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RMX_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -1806,7 +2022,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -2053,4 +2269,30 @@ impl W { pub fn rmx(&mut self) -> RMX_W { RMX_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SCU Service Request Mask\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 [srmsk](index.html) module"] +pub struct SRMSK_SPEC; +impl crate::RegisterSpec for SRMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srmsk::R](R) reader structure"] +impl crate::Readable for SRMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [srmsk::W](W) writer structure"] +impl crate::Writable for SRMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRMSK to value 0"] +impl crate::Resettable for SRMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_interrupt/srraw.rs b/src/scu_interrupt/srraw.rs index 160811ea..8789c5f3 100644 --- a/src/scu_interrupt/srraw.rs +++ b/src/scu_interrupt/srraw.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register SRRAW"] -pub type R = crate::R; +#[doc = "Register `SRRAW` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "WDT pre-warning Interrupt Status Before Masking\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PRWARN_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRWARN`"] -pub type PRWARN_R = crate::R; +#[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Status Before Masking"] +pub struct PRWARN_R(crate::FieldReader); impl PRWARN_R { + pub(crate) fn new(bits: bool) -> Self { + PRWARN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRWARN_A { @@ -28,20 +44,63 @@ impl PRWARN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRWARN_A::VALUE1 + **self == PRWARN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRWARN_A::VALUE2 + **self == PRWARN_A::VALUE2 + } +} +impl core::ops::Deref for PRWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PI` reader - RTC Raw Periodic Interrupt Status Before Masking"] +pub struct PI_R(crate::FieldReader); +impl PI_R { + pub(crate) fn new(bits: bool) -> Self { + PI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AI` reader - RTC Raw Alarm Interrupt Status Before Masking"] +pub struct AI_R(crate::FieldReader); +impl AI_R { + pub(crate) fn new(bits: bool) -> Self { + AI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLROVR` reader - DLR Request Overrun Interrupt Status Before Masking"] +pub struct DLROVR_R(crate::FieldReader); +impl DLROVR_R { + pub(crate) fn new(bits: bool) -> Self { + DLROVR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DLROVR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PI`"] -pub type PI_R = crate::R; -#[doc = "Reader of field `AI`"] -pub type AI_R = crate::R; -#[doc = "Reader of field `DLROVR`"] -pub type DLROVR_R = crate::R; #[doc = "LPACLR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LPACCR_A { @@ -56,9 +115,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCR`"] -pub type LPACCR_R = crate::R; +#[doc = "Field `LPACCR` reader - LPACLR Mirror Register Update Status Before Masking"] +pub struct LPACCR_R(crate::FieldReader); impl LPACCR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCR_A { @@ -70,12 +132,19 @@ impl LPACCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCR_A::VALUE1 + **self == LPACCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCR_A::VALUE2 + **self == LPACCR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH0 Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -92,9 +161,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH0`"] -pub type LPACTH0_R = crate::R; +#[doc = "Field `LPACTH0` reader - LPACTH0 Mirror Register Update Status Before Masking"] +pub struct LPACTH0_R(crate::FieldReader); impl LPACTH0_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH0_A { @@ -106,12 +178,19 @@ impl LPACTH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH0_A::VALUE1 + **self == LPACTH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH0_A::VALUE2 + **self == LPACTH0_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH1 Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -128,9 +207,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH1`"] -pub type LPACTH1_R = crate::R; +#[doc = "Field `LPACTH1` reader - LPACTH1 Mirror Register Update Status Before Masking"] +pub struct LPACTH1_R(crate::FieldReader); impl LPACTH1_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH1_A { @@ -142,12 +224,19 @@ impl LPACTH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH1_A::VALUE1 + **self == LPACTH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH1_A::VALUE2 + **self == LPACTH1_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACST Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -164,9 +253,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACST`"] -pub type LPACST_R = crate::R; +#[doc = "Field `LPACST` reader - LPACST Mirror Register Update Status Before Masking"] +pub struct LPACST_R(crate::FieldReader); impl LPACST_R { + pub(crate) fn new(bits: bool) -> Self { + LPACST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACST_A { @@ -178,12 +270,19 @@ impl LPACST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACST_A::VALUE1 + **self == LPACST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACST_A::VALUE2 + **self == LPACST_A::VALUE2 + } +} +impl core::ops::Deref for LPACST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACCLR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -200,9 +299,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCLR`"] -pub type LPACCLR_R = crate::R; +#[doc = "Field `LPACCLR` reader - LPACCLR Mirror Register Update Status Before Masking"] +pub struct LPACCLR_R(crate::FieldReader); impl LPACCLR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCLR_A { @@ -214,12 +316,19 @@ impl LPACCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCLR_A::VALUE1 + **self == LPACCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCLR_A::VALUE2 + **self == LPACCLR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACSET Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -236,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACSET`"] -pub type LPACSET_R = crate::R; +#[doc = "Field `LPACSET` reader - LPACSET Mirror Register Update Status Before Masking"] +pub struct LPACSET_R(crate::FieldReader); impl LPACSET_R { + pub(crate) fn new(bits: bool) -> Self { + LPACSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACSET_A { @@ -250,12 +362,19 @@ impl LPACSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACSET_A::VALUE1 + **self == LPACSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACSET_A::VALUE2 + **self == LPACSET_A::VALUE2 + } +} +impl core::ops::Deref for LPACSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTST Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -272,9 +391,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTST`"] -pub type HINTST_R = crate::R; +#[doc = "Field `HINTST` reader - HINTST Mirror Register Update Status Before Masking"] +pub struct HINTST_R(crate::FieldReader); impl HINTST_R { + pub(crate) fn new(bits: bool) -> Self { + HINTST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTST_A { @@ -286,12 +408,19 @@ impl HINTST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTST_A::VALUE1 + **self == HINTST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTST_A::VALUE2 + **self == HINTST_A::VALUE2 + } +} +impl core::ops::Deref for HINTST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTCLR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -308,9 +437,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTCLR`"] -pub type HINTCLR_R = crate::R; +#[doc = "Field `HINTCLR` reader - HINTCLR Mirror Register Update Status Before Masking"] +pub struct HINTCLR_R(crate::FieldReader); impl HINTCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HINTCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTCLR_A { @@ -322,12 +454,19 @@ impl HINTCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTCLR_A::VALUE1 + **self == HINTCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTCLR_A::VALUE2 + **self == HINTCLR_A::VALUE2 + } +} +impl core::ops::Deref for HINTCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTSET Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -344,9 +483,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTSET`"] -pub type HINTSET_R = crate::R; +#[doc = "Field `HINTSET` reader - HINTSET Mirror Register Update Status Before Masking"] +pub struct HINTSET_R(crate::FieldReader); impl HINTSET_R { + pub(crate) fn new(bits: bool) -> Self { + HINTSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTSET_A { @@ -358,12 +500,19 @@ impl HINTSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTSET_A::VALUE1 + **self == HINTSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTSET_A::VALUE2 + **self == HINTSET_A::VALUE2 + } +} +impl core::ops::Deref for HINTSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDCLR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -380,9 +529,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCLR`"] -pub type HDCLR_R = crate::R; +#[doc = "Field `HDCLR` reader - HDCLR Mirror Register Update Status Before Masking"] +pub struct HDCLR_R(crate::FieldReader); impl HDCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCLR_A { @@ -394,12 +546,19 @@ impl HDCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCLR_A::VALUE1 + **self == HDCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCLR_A::VALUE2 + **self == HDCLR_A::VALUE2 + } +} +impl core::ops::Deref for HDCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDSET Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -416,9 +575,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDSET`"] -pub type HDSET_R = crate::R; +#[doc = "Field `HDSET` reader - HDSET Mirror Register Update Status Before Masking"] +pub struct HDSET_R(crate::FieldReader); impl HDSET_R { + pub(crate) fn new(bits: bool) -> Self { + HDSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDSET_A { @@ -430,12 +592,19 @@ impl HDSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDSET_A::VALUE1 + **self == HDSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDSET_A::VALUE2 + **self == HDSET_A::VALUE2 + } +} +impl core::ops::Deref for HDSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDCR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -452,9 +621,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCR`"] -pub type HDCR_R = crate::R; +#[doc = "Field `HDCR` reader - HDCR Mirror Register Update Status Before Masking"] +pub struct HDCR_R(crate::FieldReader); impl HDCR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCR_A { @@ -466,12 +638,19 @@ impl HDCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCR_A::VALUE1 + **self == HDCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCR_A::VALUE2 + **self == HDCR_A::VALUE2 + } +} +impl core::ops::Deref for HDCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCSICTRL Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -488,9 +667,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCSICTRL`"] -pub type OSCSICTRL_R = crate::R; +#[doc = "Field `OSCSICTRL` reader - OSCSICTRL Mirror Register Update Status Before Masking"] +pub struct OSCSICTRL_R(crate::FieldReader); impl OSCSICTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCSICTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCSICTRL_A { @@ -502,12 +684,19 @@ impl OSCSICTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCSICTRL_A::VALUE1 + **self == OSCSICTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCSICTRL_A::VALUE2 + **self == OSCSICTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCSICTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCULCTRL Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -524,9 +713,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCULCTRL`"] -pub type OSCULCTRL_R = crate::R; +#[doc = "Field `OSCULCTRL` reader - OSCULCTRL Mirror Register Update Status Before Masking"] +pub struct OSCULCTRL_R(crate::FieldReader); impl OSCULCTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCULCTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCULCTRL_A { @@ -538,12 +730,19 @@ impl OSCULCTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCULCTRL_A::VALUE1 + **self == OSCULCTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCULCTRL_A::VALUE2 + **self == OSCULCTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCULCTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC CTR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -560,9 +759,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_CTR`"] -pub type RTC_CTR_R = crate::R; +#[doc = "Field `RTC_CTR` reader - RTC CTR Mirror Register Update Status Before Masking"] +pub struct RTC_CTR_R(crate::FieldReader); impl RTC_CTR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_CTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_CTR_A { @@ -574,12 +776,19 @@ impl RTC_CTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_CTR_A::VALUE1 + **self == RTC_CTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_CTR_A::VALUE2 + **self == RTC_CTR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_CTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM0 Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -596,9 +805,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM0`"] -pub type RTC_ATIM0_R = crate::R; +#[doc = "Field `RTC_ATIM0` reader - RTC ATIM0 Mirror Register Update Status Before Masking"] +pub struct RTC_ATIM0_R(crate::FieldReader); impl RTC_ATIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM0_A { @@ -610,12 +822,19 @@ impl RTC_ATIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM0_A::VALUE1 + **self == RTC_ATIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM0_A::VALUE2 + **self == RTC_ATIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM1 Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -632,9 +851,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM1`"] -pub type RTC_ATIM1_R = crate::R; +#[doc = "Field `RTC_ATIM1` reader - RTC ATIM1 Mirror Register Update Status Before Masking"] +pub struct RTC_ATIM1_R(crate::FieldReader); impl RTC_ATIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM1_A { @@ -646,12 +868,19 @@ impl RTC_ATIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM1_A::VALUE1 + **self == RTC_ATIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM1_A::VALUE2 + **self == RTC_ATIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM0 Mirror Register Update Before Masking Status\n\nValue on reset: 0"] @@ -668,9 +897,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM0`"] -pub type RTC_TIM0_R = crate::R; +#[doc = "Field `RTC_TIM0` reader - RTC TIM0 Mirror Register Update Before Masking Status"] +pub struct RTC_TIM0_R(crate::FieldReader); impl RTC_TIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM0_A { @@ -682,12 +914,19 @@ impl RTC_TIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM0_A::VALUE1 + **self == RTC_TIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM0_A::VALUE2 + **self == RTC_TIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM1 Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -704,9 +943,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM1`"] -pub type RTC_TIM1_R = crate::R; +#[doc = "Field `RTC_TIM1` reader - RTC TIM1 Mirror Register Update Status Before Masking"] +pub struct RTC_TIM1_R(crate::FieldReader); impl RTC_TIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM1_A { @@ -718,12 +960,19 @@ impl RTC_TIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM1_A::VALUE1 + **self == RTC_TIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM1_A::VALUE2 + **self == RTC_TIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Retention Memory Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -740,9 +989,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RMX`"] -pub type RMX_R = crate::R; +#[doc = "Field `RMX` reader - Retention Memory Mirror Register Update Status Before Masking"] +pub struct RMX_R(crate::FieldReader); impl RMX_R { + pub(crate) fn new(bits: bool) -> Self { + RMX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RMX_A { @@ -754,12 +1006,19 @@ impl RMX_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RMX_A::VALUE1 + **self == RMX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RMX_A::VALUE2 + **self == RMX_A::VALUE2 + } +} +impl core::ops::Deref for RMX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -884,3 +1143,19 @@ impl R { RMX_R::new(((self.bits >> 29) & 0x01) != 0) } } +#[doc = "SCU Raw Service Request Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srraw](index.html) module"] +pub struct SRRAW_SPEC; +impl crate::RegisterSpec for SRRAW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srraw::R](R) reader structure"] +impl crate::Readable for SRRAW_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SRRAW to value 0"] +impl crate::Resettable for SRRAW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_interrupt/srset.rs b/src/scu_interrupt/srset.rs index 89952432..af9696ab 100644 --- a/src/scu_interrupt/srset.rs +++ b/src/scu_interrupt/srset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register SRSET"] -pub type W = crate::W; -#[doc = "Register SRSET `reset()`'s with value 0"] -impl crate::ResetValue for super::SRSET { - type Type = u32; +#[doc = "Register `SRSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT pre-warning Interrupt Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PRWARN`"] +#[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Set"] pub struct PRWARN_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PRWARN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> PRWARN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PI`"] +#[doc = "Field `PI` writer - RTC Periodic Interrupt Set"] pub struct PI_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> PI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AI`"] +#[doc = "Field `AI` writer - RTC Alarm Interrupt Set"] pub struct AI_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> AI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DLROVR`"] +#[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt Set"] pub struct DLROVR_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLROVR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> DLROVR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACCR`"] +#[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Set"] pub struct LPACCR_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> LPACCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACTH0`"] +#[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Set"] pub struct LPACTH0_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> LPACTH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACTH1`"] +#[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Set"] pub struct LPACTH1_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACTH1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> LPACTH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACST`"] +#[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Set"] pub struct LPACST_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACST_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> LPACST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACCLR`"] +#[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Set"] pub struct LPACCLR_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> LPACCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LPACSET`"] +#[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Set"] pub struct LPACSET_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LPACSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> LPACSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -552,7 +543,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTST`"] +#[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Set"] pub struct HINTST_W<'a> { w: &'a mut W, } @@ -560,9 +551,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTST_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -587,7 +576,7 @@ impl<'a> HINTST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -605,7 +594,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTCLR`"] +#[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Set"] pub struct HINTCLR_W<'a> { w: &'a mut W, } @@ -613,9 +602,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -640,7 +627,7 @@ impl<'a> HINTCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -658,7 +645,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HINTSET`"] +#[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Set"] pub struct HINTSET_W<'a> { w: &'a mut W, } @@ -666,9 +653,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HINTSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -693,7 +678,7 @@ impl<'a> HINTSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -711,7 +696,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDCRCLR`"] +#[doc = "Field `HDCRCLR` writer - HDCRCLR Mirror Register Update Set"] pub struct HDCRCLR_W<'a> { w: &'a mut W, } @@ -719,9 +704,7 @@ impl<'a> HDCRCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCRCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -746,7 +729,7 @@ impl<'a> HDCRCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -764,7 +747,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDCRSET`"] +#[doc = "Field `HDCRSET` writer - HDCRSET Mirror Register Update Set"] pub struct HDCRSET_W<'a> { w: &'a mut W, } @@ -772,9 +755,7 @@ impl<'a> HDCRSET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCRSET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -799,7 +780,7 @@ impl<'a> HDCRSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -817,7 +798,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HDCR`"] +#[doc = "Field `HDCR` writer - HDCR Mirror Register Update Set"] pub struct HDCR_W<'a> { w: &'a mut W, } @@ -825,9 +806,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HDCR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -852,7 +831,7 @@ impl<'a> HDCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -870,7 +849,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `OSCSICTRL`"] +#[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Set"] pub struct OSCSICTRL_W<'a> { w: &'a mut W, } @@ -878,9 +857,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCSICTRL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -905,7 +882,7 @@ impl<'a> OSCSICTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -923,7 +900,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `OSCULCTRL`"] +#[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Set"] pub struct OSCULCTRL_W<'a> { w: &'a mut W, } @@ -931,9 +908,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCULCTRL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -958,7 +933,7 @@ impl<'a> OSCULCTRL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -976,7 +951,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_CTR`"] +#[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Set"] pub struct RTC_CTR_W<'a> { w: &'a mut W, } @@ -984,9 +959,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_CTR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1011,7 +984,7 @@ impl<'a> RTC_CTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -1029,7 +1002,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_ATIM0`"] +#[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Set"] pub struct RTC_ATIM0_W<'a> { w: &'a mut W, } @@ -1037,9 +1010,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1064,7 +1035,7 @@ impl<'a> RTC_ATIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -1082,7 +1053,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_ATIM1`"] +#[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Set"] pub struct RTC_ATIM1_W<'a> { w: &'a mut W, } @@ -1090,9 +1061,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_ATIM1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1117,7 +1086,7 @@ impl<'a> RTC_ATIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -1135,7 +1104,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_TIM0`"] +#[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Set"] pub struct RTC_TIM0_W<'a> { w: &'a mut W, } @@ -1143,9 +1112,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1170,7 +1137,7 @@ impl<'a> RTC_TIM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -1188,7 +1155,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RTC_TIM1`"] +#[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Set"] pub struct RTC_TIM1_W<'a> { w: &'a mut W, } @@ -1196,9 +1163,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RTC_TIM1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1223,7 +1188,7 @@ impl<'a> RTC_TIM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -1241,7 +1206,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RMX`"] +#[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Set"] pub struct RMX_W<'a> { w: &'a mut W, } @@ -1249,9 +1214,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RMX_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -1276,7 +1239,7 @@ impl<'a> RMX_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -1401,4 +1364,26 @@ impl W { pub fn rmx(&mut self) -> RMX_W { RMX_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SCU Service Request Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srset](index.html) module"] +pub struct SRSET_SPEC; +impl crate::RegisterSpec for SRSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [srset::W](W) writer structure"] +impl crate::Writable for SRSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRSET to value 0"] +impl crate::Resettable for SRSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_interrupt/srstat.rs b/src/scu_interrupt/srstat.rs index b74287fd..75659db9 100644 --- a/src/scu_interrupt/srstat.rs +++ b/src/scu_interrupt/srstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register SRSTAT"] -pub type R = crate::R; +#[doc = "Register `SRSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "WDT pre-warning Interrupt Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PRWARN_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PRWARN`"] -pub type PRWARN_R = crate::R; +#[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Status"] +pub struct PRWARN_R(crate::FieldReader); impl PRWARN_R { + pub(crate) fn new(bits: bool) -> Self { + PRWARN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PRWARN_A { @@ -28,20 +44,63 @@ impl PRWARN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRWARN_A::VALUE1 + **self == PRWARN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRWARN_A::VALUE2 + **self == PRWARN_A::VALUE2 + } +} +impl core::ops::Deref for PRWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PI` reader - RTC Periodic Interrupt Status"] +pub struct PI_R(crate::FieldReader); +impl PI_R { + pub(crate) fn new(bits: bool) -> Self { + PI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AI` reader - Alarm Interrupt Status"] +pub struct AI_R(crate::FieldReader); +impl AI_R { + pub(crate) fn new(bits: bool) -> Self { + AI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLROVR` reader - DLR Request Overrun Interrupt Status"] +pub struct DLROVR_R(crate::FieldReader); +impl DLROVR_R { + pub(crate) fn new(bits: bool) -> Self { + DLROVR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DLROVR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PI`"] -pub type PI_R = crate::R; -#[doc = "Reader of field `AI`"] -pub type AI_R = crate::R; -#[doc = "Reader of field `DLROVR`"] -pub type DLROVR_R = crate::R; #[doc = "LPACLR Mirror Register Update Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LPACCR_A { @@ -56,9 +115,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCR`"] -pub type LPACCR_R = crate::R; +#[doc = "Field `LPACCR` reader - LPACLR Mirror Register Update Status"] +pub struct LPACCR_R(crate::FieldReader); impl LPACCR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCR_A { @@ -70,12 +132,19 @@ impl LPACCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCR_A::VALUE1 + **self == LPACCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCR_A::VALUE2 + **self == LPACCR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH0 Mirror Register Update Status\n\nValue on reset: 0"] @@ -92,9 +161,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH0`"] -pub type LPACTH0_R = crate::R; +#[doc = "Field `LPACTH0` reader - LPACTH0 Mirror Register Update Status"] +pub struct LPACTH0_R(crate::FieldReader); impl LPACTH0_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH0_A { @@ -106,12 +178,19 @@ impl LPACTH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH0_A::VALUE1 + **self == LPACTH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH0_A::VALUE2 + **self == LPACTH0_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACTH1 Mirror Register Update Status\n\nValue on reset: 0"] @@ -128,9 +207,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACTH1`"] -pub type LPACTH1_R = crate::R; +#[doc = "Field `LPACTH1` reader - LPACTH1 Mirror Register Update Status"] +pub struct LPACTH1_R(crate::FieldReader); impl LPACTH1_R { + pub(crate) fn new(bits: bool) -> Self { + LPACTH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACTH1_A { @@ -142,12 +224,19 @@ impl LPACTH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACTH1_A::VALUE1 + **self == LPACTH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACTH1_A::VALUE2 + **self == LPACTH1_A::VALUE2 + } +} +impl core::ops::Deref for LPACTH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACST Mirror Register Update Status\n\nValue on reset: 0"] @@ -164,9 +253,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACST`"] -pub type LPACST_R = crate::R; +#[doc = "Field `LPACST` reader - LPACST Mirror Register Update Status"] +pub struct LPACST_R(crate::FieldReader); impl LPACST_R { + pub(crate) fn new(bits: bool) -> Self { + LPACST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACST_A { @@ -178,12 +270,19 @@ impl LPACST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACST_A::VALUE1 + **self == LPACST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACST_A::VALUE2 + **self == LPACST_A::VALUE2 + } +} +impl core::ops::Deref for LPACST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACCLR Mirror Register Update Status\n\nValue on reset: 0"] @@ -200,9 +299,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACCLR`"] -pub type LPACCLR_R = crate::R; +#[doc = "Field `LPACCLR` reader - LPACCLR Mirror Register Update Status"] +pub struct LPACCLR_R(crate::FieldReader); impl LPACCLR_R { + pub(crate) fn new(bits: bool) -> Self { + LPACCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACCLR_A { @@ -214,12 +316,19 @@ impl LPACCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACCLR_A::VALUE1 + **self == LPACCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACCLR_A::VALUE2 + **self == LPACCLR_A::VALUE2 + } +} +impl core::ops::Deref for LPACCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "LPACSET Mirror Register Update Status\n\nValue on reset: 0"] @@ -236,9 +345,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LPACSET`"] -pub type LPACSET_R = crate::R; +#[doc = "Field `LPACSET` reader - LPACSET Mirror Register Update Status"] +pub struct LPACSET_R(crate::FieldReader); impl LPACSET_R { + pub(crate) fn new(bits: bool) -> Self { + LPACSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LPACSET_A { @@ -250,12 +362,19 @@ impl LPACSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LPACSET_A::VALUE1 + **self == LPACSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LPACSET_A::VALUE2 + **self == LPACSET_A::VALUE2 + } +} +impl core::ops::Deref for LPACSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTST Mirror Register Update Status\n\nValue on reset: 0"] @@ -272,9 +391,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTST`"] -pub type HINTST_R = crate::R; +#[doc = "Field `HINTST` reader - HINTST Mirror Register Update Status"] +pub struct HINTST_R(crate::FieldReader); impl HINTST_R { + pub(crate) fn new(bits: bool) -> Self { + HINTST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTST_A { @@ -286,12 +408,19 @@ impl HINTST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTST_A::VALUE1 + **self == HINTST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTST_A::VALUE2 + **self == HINTST_A::VALUE2 + } +} +impl core::ops::Deref for HINTST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTCLR Mirror Register Update Status\n\nValue on reset: 0"] @@ -308,9 +437,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTCLR`"] -pub type HINTCLR_R = crate::R; +#[doc = "Field `HINTCLR` reader - HINTCLR Mirror Register Update Status"] +pub struct HINTCLR_R(crate::FieldReader); impl HINTCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HINTCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTCLR_A { @@ -322,12 +454,19 @@ impl HINTCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTCLR_A::VALUE1 + **self == HINTCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTCLR_A::VALUE2 + **self == HINTCLR_A::VALUE2 + } +} +impl core::ops::Deref for HINTCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HINTSET Mirror Register Update Status\n\nValue on reset: 0"] @@ -344,9 +483,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HINTSET`"] -pub type HINTSET_R = crate::R; +#[doc = "Field `HINTSET` reader - HINTSET Mirror Register Update Status"] +pub struct HINTSET_R(crate::FieldReader); impl HINTSET_R { + pub(crate) fn new(bits: bool) -> Self { + HINTSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HINTSET_A { @@ -358,12 +500,19 @@ impl HINTSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HINTSET_A::VALUE1 + **self == HINTSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HINTSET_A::VALUE2 + **self == HINTSET_A::VALUE2 + } +} +impl core::ops::Deref for HINTSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDCLR Mirror Register Update Status\n\nValue on reset: 0"] @@ -380,9 +529,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCLR`"] -pub type HDCLR_R = crate::R; +#[doc = "Field `HDCLR` reader - HDCLR Mirror Register Update Status"] +pub struct HDCLR_R(crate::FieldReader); impl HDCLR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCLR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCLR_A { @@ -394,12 +546,19 @@ impl HDCLR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCLR_A::VALUE1 + **self == HDCLR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCLR_A::VALUE2 + **self == HDCLR_A::VALUE2 + } +} +impl core::ops::Deref for HDCLR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDSET Mirror Register Update Status\n\nValue on reset: 0"] @@ -416,9 +575,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDSET`"] -pub type HDSET_R = crate::R; +#[doc = "Field `HDSET` reader - HDSET Mirror Register Update Status"] +pub struct HDSET_R(crate::FieldReader); impl HDSET_R { + pub(crate) fn new(bits: bool) -> Self { + HDSET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDSET_A { @@ -430,12 +592,19 @@ impl HDSET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDSET_A::VALUE1 + **self == HDSET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDSET_A::VALUE2 + **self == HDSET_A::VALUE2 + } +} +impl core::ops::Deref for HDSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HDCR Mirror Register Update Status\n\nValue on reset: 0"] @@ -452,9 +621,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HDCR`"] -pub type HDCR_R = crate::R; +#[doc = "Field `HDCR` reader - HDCR Mirror Register Update Status"] +pub struct HDCR_R(crate::FieldReader); impl HDCR_R { + pub(crate) fn new(bits: bool) -> Self { + HDCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HDCR_A { @@ -466,12 +638,19 @@ impl HDCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HDCR_A::VALUE1 + **self == HDCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HDCR_A::VALUE2 + **self == HDCR_A::VALUE2 + } +} +impl core::ops::Deref for HDCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCSICTRL Mirror Register Update Status\n\nValue on reset: 0"] @@ -488,9 +667,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCSICTRL`"] -pub type OSCSICTRL_R = crate::R; +#[doc = "Field `OSCSICTRL` reader - OSCSICTRL Mirror Register Update Status"] +pub struct OSCSICTRL_R(crate::FieldReader); impl OSCSICTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCSICTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCSICTRL_A { @@ -502,12 +684,19 @@ impl OSCSICTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCSICTRL_A::VALUE1 + **self == OSCSICTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCSICTRL_A::VALUE2 + **self == OSCSICTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCSICTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSCULCTRL Mirror Register Update Status\n\nValue on reset: 0"] @@ -524,9 +713,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCULCTRL`"] -pub type OSCULCTRL_R = crate::R; +#[doc = "Field `OSCULCTRL` reader - OSCULCTRL Mirror Register Update Status"] +pub struct OSCULCTRL_R(crate::FieldReader); impl OSCULCTRL_R { + pub(crate) fn new(bits: bool) -> Self { + OSCULCTRL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCULCTRL_A { @@ -538,12 +730,19 @@ impl OSCULCTRL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCULCTRL_A::VALUE1 + **self == OSCULCTRL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCULCTRL_A::VALUE2 + **self == OSCULCTRL_A::VALUE2 + } +} +impl core::ops::Deref for OSCULCTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC CTR Mirror Register Update Status\n\nValue on reset: 0"] @@ -560,9 +759,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_CTR`"] -pub type RTC_CTR_R = crate::R; +#[doc = "Field `RTC_CTR` reader - RTC CTR Mirror Register Update Status"] +pub struct RTC_CTR_R(crate::FieldReader); impl RTC_CTR_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_CTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_CTR_A { @@ -574,12 +776,19 @@ impl RTC_CTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_CTR_A::VALUE1 + **self == RTC_CTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_CTR_A::VALUE2 + **self == RTC_CTR_A::VALUE2 + } +} +impl core::ops::Deref for RTC_CTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM0 Mirror Register Update Status\n\nValue on reset: 0"] @@ -596,9 +805,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM0`"] -pub type RTC_ATIM0_R = crate::R; +#[doc = "Field `RTC_ATIM0` reader - RTC ATIM0 Mirror Register Update Status"] +pub struct RTC_ATIM0_R(crate::FieldReader); impl RTC_ATIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM0_A { @@ -610,12 +822,19 @@ impl RTC_ATIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM0_A::VALUE1 + **self == RTC_ATIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM0_A::VALUE2 + **self == RTC_ATIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC ATIM1 Mirror Register Update Status\n\nValue on reset: 0"] @@ -632,9 +851,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_ATIM1`"] -pub type RTC_ATIM1_R = crate::R; +#[doc = "Field `RTC_ATIM1` reader - RTC ATIM1 Mirror Register Update Status"] +pub struct RTC_ATIM1_R(crate::FieldReader); impl RTC_ATIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_ATIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_ATIM1_A { @@ -646,12 +868,19 @@ impl RTC_ATIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_ATIM1_A::VALUE1 + **self == RTC_ATIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_ATIM1_A::VALUE2 + **self == RTC_ATIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_ATIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM0 Mirror Register Update Status\n\nValue on reset: 0"] @@ -668,9 +897,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM0`"] -pub type RTC_TIM0_R = crate::R; +#[doc = "Field `RTC_TIM0` reader - RTC TIM0 Mirror Register Update Status"] +pub struct RTC_TIM0_R(crate::FieldReader); impl RTC_TIM0_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM0_A { @@ -682,12 +914,19 @@ impl RTC_TIM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM0_A::VALUE1 + **self == RTC_TIM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM0_A::VALUE2 + **self == RTC_TIM0_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "RTC TIM1 Mirror Register Update Status\n\nValue on reset: 0"] @@ -704,9 +943,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RTC_TIM1`"] -pub type RTC_TIM1_R = crate::R; +#[doc = "Field `RTC_TIM1` reader - RTC TIM1 Mirror Register Update Status"] +pub struct RTC_TIM1_R(crate::FieldReader); impl RTC_TIM1_R { + pub(crate) fn new(bits: bool) -> Self { + RTC_TIM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RTC_TIM1_A { @@ -718,12 +960,19 @@ impl RTC_TIM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RTC_TIM1_A::VALUE1 + **self == RTC_TIM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RTC_TIM1_A::VALUE2 + **self == RTC_TIM1_A::VALUE2 + } +} +impl core::ops::Deref for RTC_TIM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Retention Memory Mirror Register Update Status\n\nValue on reset: 0"] @@ -740,9 +989,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RMX`"] -pub type RMX_R = crate::R; +#[doc = "Field `RMX` reader - Retention Memory Mirror Register Update Status"] +pub struct RMX_R(crate::FieldReader); impl RMX_R { + pub(crate) fn new(bits: bool) -> Self { + RMX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RMX_A { @@ -754,12 +1006,19 @@ impl RMX_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RMX_A::VALUE1 + **self == RMX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RMX_A::VALUE2 + **self == RMX_A::VALUE2 + } +} +impl core::ops::Deref for RMX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -884,3 +1143,19 @@ impl R { RMX_R::new(((self.bits >> 29) & 0x01) != 0) } } +#[doc = "SCU Service Request Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srstat](index.html) module"] +pub struct SRSTAT_SPEC; +impl crate::RegisterSpec for SRSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [srstat::R](R) reader structure"] +impl crate::Readable for SRSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SRSTAT to value 0"] +impl crate::Resettable for SRSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_osc.rs b/src/scu_osc.rs index c463690a..82e0619c 100644 --- a/src/scu_osc.rs +++ b/src/scu_osc.rs @@ -2,41 +2,22 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - OSC_HP Status Register"] - pub oschpstat: OSCHPSTAT, + pub oschpstat: crate::Reg, #[doc = "0x04 - OSC_HP Control Register"] - pub oschpctrl: OSCHPCTRL, - _reserved2: [u8; 4usize], + pub oschpctrl: crate::Reg, + _reserved2: [u8; 0x04], #[doc = "0x0c - Clock Calibration Constant Register"] - pub clkcalconst: CLKCALCONST, + pub clkcalconst: crate::Reg, } -#[doc = "OSC_HP Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oschpstat](oschpstat) module"] -pub type OSCHPSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OSCHPSTAT; -#[doc = "`read()` method returns [oschpstat::R](oschpstat::R) reader structure"] -impl crate::Readable for OSCHPSTAT {} +#[doc = "OSCHPSTAT register accessor: an alias for `Reg`"] +pub type OSCHPSTAT = crate::Reg; #[doc = "OSC_HP Status Register"] pub mod oschpstat; -#[doc = "OSC_HP Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oschpctrl](oschpctrl) module"] -pub type OSCHPCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OSCHPCTRL; -#[doc = "`read()` method returns [oschpctrl::R](oschpctrl::R) reader structure"] -impl crate::Readable for OSCHPCTRL {} -#[doc = "`write(|w| ..)` method takes [oschpctrl::W](oschpctrl::W) writer structure"] -impl crate::Writable for OSCHPCTRL {} +#[doc = "OSCHPCTRL register accessor: an alias for `Reg`"] +pub type OSCHPCTRL = crate::Reg; #[doc = "OSC_HP Control Register"] pub mod oschpctrl; -#[doc = "Clock Calibration Constant Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkcalconst](clkcalconst) module"] -pub type CLKCALCONST = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLKCALCONST; -#[doc = "`read()` method returns [clkcalconst::R](clkcalconst::R) reader structure"] -impl crate::Readable for CLKCALCONST {} -#[doc = "`write(|w| ..)` method takes [clkcalconst::W](clkcalconst::W) writer structure"] -impl crate::Writable for CLKCALCONST {} +#[doc = "CLKCALCONST register accessor: an alias for `Reg`"] +pub type CLKCALCONST = crate::Reg; #[doc = "Clock Calibration Constant Register"] pub mod clkcalconst; diff --git a/src/scu_osc/clkcalconst.rs b/src/scu_osc/clkcalconst.rs index 668b7369..a426d2aa 100644 --- a/src/scu_osc/clkcalconst.rs +++ b/src/scu_osc/clkcalconst.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CLKCALCONST"] -pub type R = crate::R; -#[doc = "Writer for register CLKCALCONST"] -pub type W = crate::W; -#[doc = "Register CLKCALCONST `reset()`'s with value 0"] -impl crate::ResetValue for super::CLKCALCONST { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CLKCALCONST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CLKCALCONST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CALIBCONST`"] -pub type CALIBCONST_R = crate::R; -#[doc = "Write proxy for field `CALIBCONST`"] +#[doc = "Field `CALIBCONST` reader - Clock Calibration Constant Value"] +pub struct CALIBCONST_R(crate::FieldReader); +impl CALIBCONST_R { + pub(crate) fn new(bits: u8) -> Self { + CALIBCONST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CALIBCONST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CALIBCONST` writer - Clock Calibration Constant Value"] pub struct CALIBCONST_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CALIBCONST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn calibconst(&mut self) -> CALIBCONST_W { CALIBCONST_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clock Calibration Constant Register\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 [clkcalconst](index.html) module"] +pub struct CLKCALCONST_SPEC; +impl crate::RegisterSpec for CLKCALCONST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clkcalconst::R](R) reader structure"] +impl crate::Readable for CLKCALCONST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [clkcalconst::W](W) writer structure"] +impl crate::Writable for CLKCALCONST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLKCALCONST to value 0"] +impl crate::Resettable for CLKCALCONST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_osc/oschpctrl.rs b/src/scu_osc/oschpctrl.rs index af7a16ac..4e786c90 100644 --- a/src/scu_osc/oschpctrl.rs +++ b/src/scu_osc/oschpctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OSCHPCTRL"] -pub type R = crate::R; -#[doc = "Writer for register OSCHPCTRL"] -pub type W = crate::W; -#[doc = "Register OSCHPCTRL `reset()`'s with value 0x33"] -impl crate::ResetValue for super::OSCHPCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x33 +#[doc = "Register `OSCHPCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OSCHPCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "XTAL1 Data Enable\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `X1DEN`"] -pub type X1DEN_R = crate::R; +#[doc = "Field `X1DEN` reader - XTAL1 Data Enable"] +pub struct X1DEN_R(crate::FieldReader); impl X1DEN_R { + pub(crate) fn new(bits: bool) -> Self { + X1DEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> X1DEN_A { @@ -38,15 +65,22 @@ impl X1DEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == X1DEN_A::VALUE1 + **self == X1DEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == X1DEN_A::VALUE2 + **self == X1DEN_A::VALUE2 } } -#[doc = "Write proxy for field `X1DEN`"] +impl core::ops::Deref for X1DEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `X1DEN` writer - XTAL1 Data Enable"] pub struct X1DEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> X1DEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: X1DEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Bit X1D is not updated"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> X1DEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SHBY`"] -pub type SHBY_R = crate::R; +#[doc = "Field `SHBY` reader - Shaper Bypass"] +pub struct SHBY_R(crate::FieldReader); impl SHBY_R { + pub(crate) fn new(bits: bool) -> Self { + SHBY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SHBY_A { @@ -113,15 +148,22 @@ impl SHBY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SHBY_A::VALUE1 + **self == SHBY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SHBY_A::VALUE2 + **self == SHBY_A::VALUE2 } } -#[doc = "Write proxy for field `SHBY`"] +impl core::ops::Deref for SHBY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SHBY` writer - Shaper Bypass"] pub struct SHBY_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SHBY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SHBY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The shaper is not bypassed"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SHBY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -179,9 +219,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MODE`"] -pub type MODE_R = crate::R; +#[doc = "Field `MODE` reader - Oscillator Mode"] +pub struct MODE_R(crate::FieldReader); impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODE_A { @@ -196,25 +239,32 @@ impl MODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODE_A::VALUE1 + **self == MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODE_A::VALUE2 + **self == MODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MODE_A::VALUE3 + **self == MODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MODE_A::VALUE4 + **self == MODE_A::VALUE4 + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODE`"] +#[doc = "Field `MODE` writer - Oscillator Mode"] pub struct MODE_W<'a> { w: &'a mut W, } @@ -222,9 +272,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "External Crystal Mode and External Input Clock Mode. The oscillator Power-Saving Mode is not entered."] #[inline(always)] @@ -249,13 +297,25 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } -#[doc = "Reader of field `OSCVAL`"] -pub type OSCVAL_R = crate::R; -#[doc = "Write proxy for field `OSCVAL`"] +#[doc = "Field `OSCVAL` reader - OSC Frequency Value"] +pub struct OSCVAL_R(crate::FieldReader); +impl OSCVAL_R { + pub(crate) fn new(bits: u8) -> Self { + OSCVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OSCVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OSCVAL` writer - OSC Frequency Value"] pub struct OSCVAL_W<'a> { w: &'a mut W, } @@ -263,7 +323,7 @@ impl<'a> OSCVAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -310,4 +370,30 @@ impl W { pub fn oscval(&mut self) -> OSCVAL_W { OSCVAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "OSC_HP Control Register\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 [oschpctrl](index.html) module"] +pub struct OSCHPCTRL_SPEC; +impl crate::RegisterSpec for OSCHPCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [oschpctrl::R](R) reader structure"] +impl crate::Readable for OSCHPCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [oschpctrl::W](W) writer structure"] +impl crate::Writable for OSCHPCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OSCHPCTRL to value 0x33"] +impl crate::Resettable for OSCHPCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x33 + } } diff --git a/src/scu_osc/oschpstat.rs b/src/scu_osc/oschpstat.rs index c541bf34..bebe0ede 100644 --- a/src/scu_osc/oschpstat.rs +++ b/src/scu_osc/oschpstat.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register OSCHPSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `X1D`"] -pub type X1D_R = crate::R; +#[doc = "Register `OSCHPSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `X1D` reader - XTAL1 Data Value"] +pub struct X1D_R(crate::FieldReader); +impl X1D_R { + pub(crate) fn new(bits: bool) -> Self { + X1D_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for X1D_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - XTAL1 Data Value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { X1D_R::new((self.bits & 0x01) != 0) } } +#[doc = "OSC_HP Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oschpstat](index.html) module"] +pub struct OSCHPSTAT_SPEC; +impl crate::RegisterSpec for OSCHPSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [oschpstat::R](R) reader structure"] +impl crate::Readable for OSCHPSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets OSCHPSTAT to value 0"] +impl crate::Resettable for OSCHPSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_parity.rs b/src/scu_parity.rs index 22e4a235..a7ae1113 100644 --- a/src/scu_parity.rs +++ b/src/scu_parity.rs @@ -2,95 +2,46 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Parity Error Enable Register"] - pub peen: PEEN, + pub peen: crate::Reg, #[doc = "0x04 - Memory Checking Control Register"] - pub mchkcon: MCHKCON, + pub mchkcon: crate::Reg, #[doc = "0x08 - Parity Error Trap Enable Register"] - pub pete: PETE, + pub pete: crate::Reg, #[doc = "0x0c - Parity Error Reset Enable Register"] - pub persten: PERSTEN, - _reserved4: [u8; 4usize], + pub persten: crate::Reg, + _reserved4: [u8; 0x04], #[doc = "0x14 - Parity Error Flag Register"] - pub peflag: PEFLAG, + pub peflag: crate::Reg, #[doc = "0x18 - Parity Memory Test Pattern Register"] - pub pmtpr: PMTPR, + pub pmtpr: crate::Reg, #[doc = "0x1c - Parity Memory Test Select Register"] - pub pmtsr: PMTSR, + pub pmtsr: crate::Reg, } -#[doc = "Parity Error Enable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [peen](peen) module"] -pub type PEEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PEEN; -#[doc = "`read()` method returns [peen::R](peen::R) reader structure"] -impl crate::Readable for PEEN {} -#[doc = "`write(|w| ..)` method takes [peen::W](peen::W) writer structure"] -impl crate::Writable for PEEN {} +#[doc = "PEEN register accessor: an alias for `Reg`"] +pub type PEEN = crate::Reg; #[doc = "Parity Error Enable Register"] pub mod peen; -#[doc = "Memory Checking Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mchkcon](mchkcon) module"] -pub type MCHKCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _MCHKCON; -#[doc = "`read()` method returns [mchkcon::R](mchkcon::R) reader structure"] -impl crate::Readable for MCHKCON {} -#[doc = "`write(|w| ..)` method takes [mchkcon::W](mchkcon::W) writer structure"] -impl crate::Writable for MCHKCON {} +#[doc = "MCHKCON register accessor: an alias for `Reg`"] +pub type MCHKCON = crate::Reg; #[doc = "Memory Checking Control Register"] pub mod mchkcon; -#[doc = "Parity Error Trap Enable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pete](pete) module"] -pub type PETE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PETE; -#[doc = "`read()` method returns [pete::R](pete::R) reader structure"] -impl crate::Readable for PETE {} -#[doc = "`write(|w| ..)` method takes [pete::W](pete::W) writer structure"] -impl crate::Writable for PETE {} +#[doc = "PETE register accessor: an alias for `Reg`"] +pub type PETE = crate::Reg; #[doc = "Parity Error Trap Enable Register"] pub mod pete; -#[doc = "Parity Error Reset Enable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [persten](persten) module"] -pub type PERSTEN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PERSTEN; -#[doc = "`read()` method returns [persten::R](persten::R) reader structure"] -impl crate::Readable for PERSTEN {} -#[doc = "`write(|w| ..)` method takes [persten::W](persten::W) writer structure"] -impl crate::Writable for PERSTEN {} +#[doc = "PERSTEN register accessor: an alias for `Reg`"] +pub type PERSTEN = crate::Reg; #[doc = "Parity Error Reset Enable Register"] pub mod persten; -#[doc = "Parity Error Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [peflag](peflag) module"] -pub type PEFLAG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PEFLAG; -#[doc = "`read()` method returns [peflag::R](peflag::R) reader structure"] -impl crate::Readable for PEFLAG {} -#[doc = "`write(|w| ..)` method takes [peflag::W](peflag::W) writer structure"] -impl crate::Writable for PEFLAG {} +#[doc = "PEFLAG register accessor: an alias for `Reg`"] +pub type PEFLAG = crate::Reg; #[doc = "Parity Error Flag Register"] pub mod peflag; -#[doc = "Parity Memory Test Pattern Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmtpr](pmtpr) module"] -pub type PMTPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PMTPR; -#[doc = "`read()` method returns [pmtpr::R](pmtpr::R) reader structure"] -impl crate::Readable for PMTPR {} -#[doc = "`write(|w| ..)` method takes [pmtpr::W](pmtpr::W) writer structure"] -impl crate::Writable for PMTPR {} +#[doc = "PMTPR register accessor: an alias for `Reg`"] +pub type PMTPR = crate::Reg; #[doc = "Parity Memory Test Pattern Register"] pub mod pmtpr; -#[doc = "Parity Memory Test Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmtsr](pmtsr) module"] -pub type PMTSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PMTSR; -#[doc = "`read()` method returns [pmtsr::R](pmtsr::R) reader structure"] -impl crate::Readable for PMTSR {} -#[doc = "`write(|w| ..)` method takes [pmtsr::W](pmtsr::W) writer structure"] -impl crate::Writable for PMTSR {} +#[doc = "PMTSR register accessor: an alias for `Reg`"] +pub type PMTSR = crate::Reg; #[doc = "Parity Memory Test Select Register"] pub mod pmtsr; diff --git a/src/scu_parity/mchkcon.rs b/src/scu_parity/mchkcon.rs index 6da41875..1ddd7aa9 100644 --- a/src/scu_parity/mchkcon.rs +++ b/src/scu_parity/mchkcon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register MCHKCON"] -pub type R = crate::R; -#[doc = "Writer for register MCHKCON"] -pub type W = crate::W; -#[doc = "Register MCHKCON `reset()`'s with value 0"] -impl crate::ResetValue for super::MCHKCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `MCHKCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCHKCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Select Memory Check for PSRAM\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELPS`"] -pub type SELPS_R = crate::R; +#[doc = "Field `SELPS` reader - Select Memory Check for PSRAM"] +pub struct SELPS_R(crate::FieldReader); impl SELPS_R { + pub(crate) fn new(bits: bool) -> Self { + SELPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELPS_A { @@ -38,15 +65,22 @@ impl SELPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELPS_A::VALUE1 + **self == SELPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELPS_A::VALUE2 + **self == SELPS_A::VALUE2 } } -#[doc = "Write proxy for field `SELPS`"] +impl core::ops::Deref for SELPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SELPS` writer - Select Memory Check for PSRAM"] pub struct SELPS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SELPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELPS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SELPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELDS1`"] -pub type SELDS1_R = crate::R; +#[doc = "Field `SELDS1` reader - Select Memory Check for DSRAM1"] +pub struct SELDS1_R(crate::FieldReader); impl SELDS1_R { + pub(crate) fn new(bits: bool) -> Self { + SELDS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELDS1_A { @@ -113,15 +148,22 @@ impl SELDS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELDS1_A::VALUE1 + **self == SELDS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELDS1_A::VALUE2 + **self == SELDS1_A::VALUE2 + } +} +impl core::ops::Deref for SELDS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SELDS1`"] +#[doc = "Field `SELDS1` writer - Select Memory Check for DSRAM1"] pub struct SELDS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SELDS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELDS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SELDS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC0DRA`"] -pub type USIC0DRA_R = crate::R; +#[doc = "Field `USIC0DRA` reader - Select Memory Check for USIC0"] +pub struct USIC0DRA_R(crate::FieldReader); impl USIC0DRA_R { + pub(crate) fn new(bits: bool) -> Self { + USIC0DRA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC0DRA_A { @@ -188,15 +231,22 @@ impl USIC0DRA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC0DRA_A::VALUE1 + **self == USIC0DRA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC0DRA_A::VALUE2 + **self == USIC0DRA_A::VALUE2 } } -#[doc = "Write proxy for field `USIC0DRA`"] +impl core::ops::Deref for USIC0DRA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USIC0DRA` writer - Select Memory Check for USIC0"] pub struct USIC0DRA_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> USIC0DRA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC0DRA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> USIC0DRA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC1DRA`"] -pub type USIC1DRA_R = crate::R; +#[doc = "Field `USIC1DRA` reader - Select Memory Check for USIC1"] +pub struct USIC1DRA_R(crate::FieldReader); impl USIC1DRA_R { + pub(crate) fn new(bits: bool) -> Self { + USIC1DRA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC1DRA_A { @@ -263,15 +314,22 @@ impl USIC1DRA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC1DRA_A::VALUE1 + **self == USIC1DRA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC1DRA_A::VALUE2 + **self == USIC1DRA_A::VALUE2 + } +} +impl core::ops::Deref for USIC1DRA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `USIC1DRA`"] +#[doc = "Field `USIC1DRA` writer - Select Memory Check for USIC1"] pub struct USIC1DRA_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> USIC1DRA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC1DRA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> USIC1DRA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCANDRA`"] -pub type MCANDRA_R = crate::R; +#[doc = "Field `MCANDRA` reader - Select Memory Check for MultiCAN"] +pub struct MCANDRA_R(crate::FieldReader); impl MCANDRA_R { + pub(crate) fn new(bits: bool) -> Self { + MCANDRA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCANDRA_A { @@ -338,15 +397,22 @@ impl MCANDRA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCANDRA_A::VALUE1 + **self == MCANDRA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCANDRA_A::VALUE2 + **self == MCANDRA_A::VALUE2 } } -#[doc = "Write proxy for field `MCANDRA`"] +impl core::ops::Deref for MCANDRA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCANDRA` writer - Select Memory Check for MultiCAN"] pub struct MCANDRA_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> MCANDRA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCANDRA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> MCANDRA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPRFDRA`"] -pub type PPRFDRA_R = crate::R; +#[doc = "Field `PPRFDRA` reader - Select Memory Check for PMU"] +pub struct PPRFDRA_R(crate::FieldReader); impl PPRFDRA_R { + pub(crate) fn new(bits: bool) -> Self { + PPRFDRA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPRFDRA_A { @@ -413,15 +480,22 @@ impl PPRFDRA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPRFDRA_A::VALUE1 + **self == PPRFDRA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPRFDRA_A::VALUE2 + **self == PPRFDRA_A::VALUE2 } } -#[doc = "Write proxy for field `PPRFDRA`"] +impl core::ops::Deref for PPRFDRA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PPRFDRA` writer - Select Memory Check for PMU"] pub struct PPRFDRA_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PPRFDRA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPRFDRA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PPRFDRA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELUSB`"] -pub type SELUSB_R = crate::R; +#[doc = "Field `SELUSB` reader - Select Memory Check for USB SRAM"] +pub struct SELUSB_R(crate::FieldReader); impl SELUSB_R { + pub(crate) fn new(bits: bool) -> Self { + SELUSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELUSB_A { @@ -488,15 +563,22 @@ impl SELUSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELUSB_A::VALUE1 + **self == SELUSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELUSB_A::VALUE2 + **self == SELUSB_A::VALUE2 + } +} +impl core::ops::Deref for SELUSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SELUSB`"] +#[doc = "Field `SELUSB` writer - Select Memory Check for USB SRAM"] pub struct SELUSB_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> SELUSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELUSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Not selected"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> SELUSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn selusb(&mut self) -> SELUSB_W { SELUSB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Memory Checking Control Register\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 [mchkcon](index.html) module"] +pub struct MCHKCON_SPEC; +impl crate::RegisterSpec for MCHKCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mchkcon::R](R) reader structure"] +impl crate::Readable for MCHKCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mchkcon::W](W) writer structure"] +impl crate::Writable for MCHKCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCHKCON to value 0"] +impl crate::Resettable for MCHKCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/peen.rs b/src/scu_parity/peen.rs index 3e8e32ea..be8d68f2 100644 --- a/src/scu_parity/peen.rs +++ b/src/scu_parity/peen.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PEEN"] -pub type R = crate::R; -#[doc = "Writer for register PEEN"] -pub type W = crate::W; -#[doc = "Register PEEN `reset()`'s with value 0"] -impl crate::ResetValue for super::PEEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PEEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PEEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Parity Error Enable for PSRAM\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENPS`"] -pub type PEENPS_R = crate::R; +#[doc = "Field `PEENPS` reader - Parity Error Enable for PSRAM"] +pub struct PEENPS_R(crate::FieldReader); impl PEENPS_R { + pub(crate) fn new(bits: bool) -> Self { + PEENPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENPS_A { @@ -38,15 +65,22 @@ impl PEENPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENPS_A::VALUE1 + **self == PEENPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENPS_A::VALUE2 + **self == PEENPS_A::VALUE2 } } -#[doc = "Write proxy for field `PEENPS`"] +impl core::ops::Deref for PEENPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEENPS` writer - Parity Error Enable for PSRAM"] pub struct PEENPS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PEENPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENPS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PEENPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENDS1`"] -pub type PEENDS1_R = crate::R; +#[doc = "Field `PEENDS1` reader - Parity Error Enable for DSRAM1"] +pub struct PEENDS1_R(crate::FieldReader); impl PEENDS1_R { + pub(crate) fn new(bits: bool) -> Self { + PEENDS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENDS1_A { @@ -113,15 +148,22 @@ impl PEENDS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENDS1_A::VALUE1 + **self == PEENDS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENDS1_A::VALUE2 + **self == PEENDS1_A::VALUE2 + } +} +impl core::ops::Deref for PEENDS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEENDS1`"] +#[doc = "Field `PEENDS1` writer - Parity Error Enable for DSRAM1"] pub struct PEENDS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PEENDS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENDS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PEENDS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENU0`"] -pub type PEENU0_R = crate::R; +#[doc = "Field `PEENU0` reader - Parity Error Enable for USIC0 Memory"] +pub struct PEENU0_R(crate::FieldReader); impl PEENU0_R { + pub(crate) fn new(bits: bool) -> Self { + PEENU0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENU0_A { @@ -188,15 +231,22 @@ impl PEENU0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENU0_A::VALUE1 + **self == PEENU0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENU0_A::VALUE2 + **self == PEENU0_A::VALUE2 } } -#[doc = "Write proxy for field `PEENU0`"] +impl core::ops::Deref for PEENU0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEENU0` writer - Parity Error Enable for USIC0 Memory"] pub struct PEENU0_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PEENU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENU0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PEENU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENU1`"] -pub type PEENU1_R = crate::R; +#[doc = "Field `PEENU1` reader - Parity Error Enable for USIC1 Memory"] +pub struct PEENU1_R(crate::FieldReader); impl PEENU1_R { + pub(crate) fn new(bits: bool) -> Self { + PEENU1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENU1_A { @@ -263,15 +314,22 @@ impl PEENU1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENU1_A::VALUE1 + **self == PEENU1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENU1_A::VALUE2 + **self == PEENU1_A::VALUE2 + } +} +impl core::ops::Deref for PEENU1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEENU1`"] +#[doc = "Field `PEENU1` writer - Parity Error Enable for USIC1 Memory"] pub struct PEENU1_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PEENU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENU1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PEENU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENMC`"] -pub type PEENMC_R = crate::R; +#[doc = "Field `PEENMC` reader - Parity Error Enable for MultiCAN Memory"] +pub struct PEENMC_R(crate::FieldReader); impl PEENMC_R { + pub(crate) fn new(bits: bool) -> Self { + PEENMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENMC_A { @@ -338,15 +397,22 @@ impl PEENMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENMC_A::VALUE1 + **self == PEENMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENMC_A::VALUE2 + **self == PEENMC_A::VALUE2 } } -#[doc = "Write proxy for field `PEENMC`"] +impl core::ops::Deref for PEENMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEENMC` writer - Parity Error Enable for MultiCAN Memory"] pub struct PEENMC_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PEENMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENMC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PEENMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENPPRF`"] -pub type PEENPPRF_R = crate::R; +#[doc = "Field `PEENPPRF` reader - Parity Error Enable for PMU Prefetch Memory"] +pub struct PEENPPRF_R(crate::FieldReader); impl PEENPPRF_R { + pub(crate) fn new(bits: bool) -> Self { + PEENPPRF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENPPRF_A { @@ -413,15 +480,22 @@ impl PEENPPRF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENPPRF_A::VALUE1 + **self == PEENPPRF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENPPRF_A::VALUE2 + **self == PEENPPRF_A::VALUE2 } } -#[doc = "Write proxy for field `PEENPPRF`"] +impl core::ops::Deref for PEENPPRF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEENPPRF` writer - Parity Error Enable for PMU Prefetch Memory"] pub struct PEENPPRF_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PEENPPRF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENPPRF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PEENPPRF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEENUSB`"] -pub type PEENUSB_R = crate::R; +#[doc = "Field `PEENUSB` reader - Parity Error Enable for USB Memory"] +pub struct PEENUSB_R(crate::FieldReader); impl PEENUSB_R { + pub(crate) fn new(bits: bool) -> Self { + PEENUSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEENUSB_A { @@ -488,15 +563,22 @@ impl PEENUSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEENUSB_A::VALUE1 + **self == PEENUSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEENUSB_A::VALUE2 + **self == PEENUSB_A::VALUE2 + } +} +impl core::ops::Deref for PEENUSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEENUSB`"] +#[doc = "Field `PEENUSB` writer - Parity Error Enable for USB Memory"] pub struct PEENUSB_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PEENUSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEENUSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PEENUSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn peenusb(&mut self) -> PEENUSB_W { PEENUSB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Error Enable Register\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 [peen](index.html) module"] +pub struct PEEN_SPEC; +impl crate::RegisterSpec for PEEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [peen::R](R) reader structure"] +impl crate::Readable for PEEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [peen::W](W) writer structure"] +impl crate::Writable for PEEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PEEN to value 0"] +impl crate::Resettable for PEEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/peflag.rs b/src/scu_parity/peflag.rs index 9dd850f0..8d4bdc3f 100644 --- a/src/scu_parity/peflag.rs +++ b/src/scu_parity/peflag.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PEFLAG"] -pub type R = crate::R; -#[doc = "Writer for register PEFLAG"] -pub type W = crate::W; -#[doc = "Register PEFLAG `reset()`'s with value 0"] -impl crate::ResetValue for super::PEFLAG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PEFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PEFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Parity Error Flag for PSRAM\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFPS`"] -pub type PEFPS_R = crate::R; +#[doc = "Field `PEFPS` reader - Parity Error Flag for PSRAM"] +pub struct PEFPS_R(crate::FieldReader); impl PEFPS_R { + pub(crate) fn new(bits: bool) -> Self { + PEFPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFPS_A { @@ -38,15 +65,22 @@ impl PEFPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFPS_A::VALUE1 + **self == PEFPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFPS_A::VALUE2 + **self == PEFPS_A::VALUE2 } } -#[doc = "Write proxy for field `PEFPS`"] +impl core::ops::Deref for PEFPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEFPS` writer - Parity Error Flag for PSRAM"] pub struct PEFPS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PEFPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFPS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PEFPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFDS1`"] -pub type PEFDS1_R = crate::R; +#[doc = "Field `PEFDS1` reader - Parity Error Flag for DSRAM1"] +pub struct PEFDS1_R(crate::FieldReader); impl PEFDS1_R { + pub(crate) fn new(bits: bool) -> Self { + PEFDS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFDS1_A { @@ -113,15 +148,22 @@ impl PEFDS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFDS1_A::VALUE1 + **self == PEFDS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFDS1_A::VALUE2 + **self == PEFDS1_A::VALUE2 + } +} +impl core::ops::Deref for PEFDS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEFDS1`"] +#[doc = "Field `PEFDS1` writer - Parity Error Flag for DSRAM1"] pub struct PEFDS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PEFDS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFDS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PEFDS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFU0`"] -pub type PEFU0_R = crate::R; +#[doc = "Field `PEFU0` reader - Parity Error Flag for USIC0 Memory"] +pub struct PEFU0_R(crate::FieldReader); impl PEFU0_R { + pub(crate) fn new(bits: bool) -> Self { + PEFU0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFU0_A { @@ -188,15 +231,22 @@ impl PEFU0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFU0_A::VALUE1 + **self == PEFU0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFU0_A::VALUE2 + **self == PEFU0_A::VALUE2 } } -#[doc = "Write proxy for field `PEFU0`"] +impl core::ops::Deref for PEFU0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEFU0` writer - Parity Error Flag for USIC0 Memory"] pub struct PEFU0_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PEFU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFU0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PEFU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFU1`"] -pub type PEFU1_R = crate::R; +#[doc = "Field `PEFU1` reader - Parity Error Flag for USIC1 Memory"] +pub struct PEFU1_R(crate::FieldReader); impl PEFU1_R { + pub(crate) fn new(bits: bool) -> Self { + PEFU1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFU1_A { @@ -263,15 +314,22 @@ impl PEFU1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFU1_A::VALUE1 + **self == PEFU1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFU1_A::VALUE2 + **self == PEFU1_A::VALUE2 + } +} +impl core::ops::Deref for PEFU1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEFU1`"] +#[doc = "Field `PEFU1` writer - Parity Error Flag for USIC1 Memory"] pub struct PEFU1_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PEFU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFU1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PEFU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFMC`"] -pub type PEFMC_R = crate::R; +#[doc = "Field `PEFMC` reader - Parity Error Flag for MultiCAN Memory"] +pub struct PEFMC_R(crate::FieldReader); impl PEFMC_R { + pub(crate) fn new(bits: bool) -> Self { + PEFMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFMC_A { @@ -338,15 +397,22 @@ impl PEFMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFMC_A::VALUE1 + **self == PEFMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFMC_A::VALUE2 + **self == PEFMC_A::VALUE2 } } -#[doc = "Write proxy for field `PEFMC`"] +impl core::ops::Deref for PEFMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEFMC` writer - Parity Error Flag for MultiCAN Memory"] pub struct PEFMC_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PEFMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFMC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PEFMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEFPPRF`"] -pub type PEFPPRF_R = crate::R; +#[doc = "Field `PEFPPRF` reader - Parity Error Flag for PMU Prefetch Memory"] +pub struct PEFPPRF_R(crate::FieldReader); impl PEFPPRF_R { + pub(crate) fn new(bits: bool) -> Self { + PEFPPRF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEFPPRF_A { @@ -413,15 +480,22 @@ impl PEFPPRF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEFPPRF_A::VALUE1 + **self == PEFPPRF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEFPPRF_A::VALUE2 + **self == PEFPPRF_A::VALUE2 } } -#[doc = "Write proxy for field `PEFPPRF`"] +impl core::ops::Deref for PEFPPRF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PEFPPRF` writer - Parity Error Flag for PMU Prefetch Memory"] pub struct PEFPPRF_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PEFPPRF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEFPPRF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PEFPPRF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PEUSB`"] -pub type PEUSB_R = crate::R; +#[doc = "Field `PEUSB` reader - Parity Error Flag for USB Memory"] +pub struct PEUSB_R(crate::FieldReader); impl PEUSB_R { + pub(crate) fn new(bits: bool) -> Self { + PEUSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PEUSB_A { @@ -488,15 +563,22 @@ impl PEUSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PEUSB_A::VALUE1 + **self == PEUSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PEUSB_A::VALUE2 + **self == PEUSB_A::VALUE2 + } +} +impl core::ops::Deref for PEUSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PEUSB`"] +#[doc = "Field `PEUSB` writer - Parity Error Flag for USB Memory"] pub struct PEUSB_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PEUSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PEUSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No parity error detected"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PEUSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn peusb(&mut self) -> PEUSB_W { PEUSB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Error Flag Register\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 [peflag](index.html) module"] +pub struct PEFLAG_SPEC; +impl crate::RegisterSpec for PEFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [peflag::R](R) reader structure"] +impl crate::Readable for PEFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [peflag::W](W) writer structure"] +impl crate::Writable for PEFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PEFLAG to value 0"] +impl crate::Resettable for PEFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/persten.rs b/src/scu_parity/persten.rs index e9c3dce8..1a34d282 100644 --- a/src/scu_parity/persten.rs +++ b/src/scu_parity/persten.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PERSTEN"] -pub type R = crate::R; -#[doc = "Writer for register PERSTEN"] -pub type W = crate::W; -#[doc = "Register PERSTEN `reset()`'s with value 0"] -impl crate::ResetValue for super::PERSTEN { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PERSTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PERSTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System Reset Enable upon Parity Error Trap\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSEN`"] -pub type RSEN_R = crate::R; +#[doc = "Field `RSEN` reader - System Reset Enable upon Parity Error Trap"] +pub struct RSEN_R(crate::FieldReader); impl RSEN_R { + pub(crate) fn new(bits: bool) -> Self { + RSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSEN_A { @@ -38,15 +65,22 @@ impl RSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSEN_A::VALUE1 + **self == RSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSEN_A::VALUE2 + **self == RSEN_A::VALUE2 + } +} +impl core::ops::Deref for RSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RSEN`"] +#[doc = "Field `RSEN` writer - System Reset Enable upon Parity Error Trap"] pub struct RSEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> RSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Reset request disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> RSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -98,4 +130,30 @@ impl W { pub fn rsen(&mut self) -> RSEN_W { RSEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Error Reset Enable Register\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 [persten](index.html) module"] +pub struct PERSTEN_SPEC; +impl crate::RegisterSpec for PERSTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [persten::R](R) reader structure"] +impl crate::Readable for PERSTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [persten::W](W) writer structure"] +impl crate::Writable for PERSTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PERSTEN to value 0"] +impl crate::Resettable for PERSTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/pete.rs b/src/scu_parity/pete.rs index 25c8f013..4bf78c5e 100644 --- a/src/scu_parity/pete.rs +++ b/src/scu_parity/pete.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PETE"] -pub type R = crate::R; -#[doc = "Writer for register PETE"] -pub type W = crate::W; -#[doc = "Register PETE `reset()`'s with value 0"] -impl crate::ResetValue for super::PETE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PETE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PETE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Parity Error Trap Enable for PSRAM\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEPS`"] -pub type PETEPS_R = crate::R; +#[doc = "Field `PETEPS` reader - Parity Error Trap Enable for PSRAM"] +pub struct PETEPS_R(crate::FieldReader); impl PETEPS_R { + pub(crate) fn new(bits: bool) -> Self { + PETEPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEPS_A { @@ -38,15 +65,22 @@ impl PETEPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEPS_A::VALUE1 + **self == PETEPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEPS_A::VALUE2 + **self == PETEPS_A::VALUE2 } } -#[doc = "Write proxy for field `PETEPS`"] +impl core::ops::Deref for PETEPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PETEPS` writer - Parity Error Trap Enable for PSRAM"] pub struct PETEPS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PETEPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEPS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PETEPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEDS1`"] -pub type PETEDS1_R = crate::R; +#[doc = "Field `PETEDS1` reader - Parity Error Trap Enable for DSRAM1"] +pub struct PETEDS1_R(crate::FieldReader); impl PETEDS1_R { + pub(crate) fn new(bits: bool) -> Self { + PETEDS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEDS1_A { @@ -113,15 +148,22 @@ impl PETEDS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEDS1_A::VALUE1 + **self == PETEDS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEDS1_A::VALUE2 + **self == PETEDS1_A::VALUE2 + } +} +impl core::ops::Deref for PETEDS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PETEDS1`"] +#[doc = "Field `PETEDS1` writer - Parity Error Trap Enable for DSRAM1"] pub struct PETEDS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PETEDS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEDS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PETEDS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEU0`"] -pub type PETEU0_R = crate::R; +#[doc = "Field `PETEU0` reader - Parity Error Trap Enable for USIC0 Memory"] +pub struct PETEU0_R(crate::FieldReader); impl PETEU0_R { + pub(crate) fn new(bits: bool) -> Self { + PETEU0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEU0_A { @@ -188,15 +231,22 @@ impl PETEU0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEU0_A::VALUE1 + **self == PETEU0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEU0_A::VALUE2 + **self == PETEU0_A::VALUE2 } } -#[doc = "Write proxy for field `PETEU0`"] +impl core::ops::Deref for PETEU0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PETEU0` writer - Parity Error Trap Enable for USIC0 Memory"] pub struct PETEU0_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> PETEU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEU0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> PETEU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEU1`"] -pub type PETEU1_R = crate::R; +#[doc = "Field `PETEU1` reader - Parity Error Trap Enable for USIC1 Memory"] +pub struct PETEU1_R(crate::FieldReader); impl PETEU1_R { + pub(crate) fn new(bits: bool) -> Self { + PETEU1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEU1_A { @@ -263,15 +314,22 @@ impl PETEU1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEU1_A::VALUE1 + **self == PETEU1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEU1_A::VALUE2 + **self == PETEU1_A::VALUE2 + } +} +impl core::ops::Deref for PETEU1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PETEU1`"] +#[doc = "Field `PETEU1` writer - Parity Error Trap Enable for USIC1 Memory"] pub struct PETEU1_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PETEU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEU1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PETEU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEMC`"] -pub type PETEMC_R = crate::R; +#[doc = "Field `PETEMC` reader - Parity Error Trap Enable for MultiCAN Memory"] +pub struct PETEMC_R(crate::FieldReader); impl PETEMC_R { + pub(crate) fn new(bits: bool) -> Self { + PETEMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEMC_A { @@ -338,15 +397,22 @@ impl PETEMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEMC_A::VALUE1 + **self == PETEMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEMC_A::VALUE2 + **self == PETEMC_A::VALUE2 } } -#[doc = "Write proxy for field `PETEMC`"] +impl core::ops::Deref for PETEMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PETEMC` writer - Parity Error Trap Enable for MultiCAN Memory"] pub struct PETEMC_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PETEMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEMC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PETEMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEPPRF`"] -pub type PETEPPRF_R = crate::R; +#[doc = "Field `PETEPPRF` reader - Parity Error Trap Enable for PMU Prefetch Memory"] +pub struct PETEPPRF_R(crate::FieldReader); impl PETEPPRF_R { + pub(crate) fn new(bits: bool) -> Self { + PETEPPRF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEPPRF_A { @@ -413,15 +480,22 @@ impl PETEPPRF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEPPRF_A::VALUE1 + **self == PETEPPRF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEPPRF_A::VALUE2 + **self == PETEPPRF_A::VALUE2 } } -#[doc = "Write proxy for field `PETEPPRF`"] +impl core::ops::Deref for PETEPPRF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PETEPPRF` writer - Parity Error Trap Enable for PMU Prefetch Memory"] pub struct PETEPPRF_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PETEPPRF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEPPRF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PETEPPRF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PETEUSB`"] -pub type PETEUSB_R = crate::R; +#[doc = "Field `PETEUSB` reader - Parity Error Trap Enable for USB Memory"] +pub struct PETEUSB_R(crate::FieldReader); impl PETEUSB_R { + pub(crate) fn new(bits: bool) -> Self { + PETEUSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PETEUSB_A { @@ -488,15 +563,22 @@ impl PETEUSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PETEUSB_A::VALUE1 + **self == PETEUSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PETEUSB_A::VALUE2 + **self == PETEUSB_A::VALUE2 + } +} +impl core::ops::Deref for PETEUSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PETEUSB`"] +#[doc = "Field `PETEUSB` writer - Parity Error Trap Enable for USB Memory"] pub struct PETEUSB_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> PETEUSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PETEUSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> PETEUSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn peteusb(&mut self) -> PETEUSB_W { PETEUSB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Error Trap Enable Register\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 [pete](index.html) module"] +pub struct PETE_SPEC; +impl crate::RegisterSpec for PETE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pete::R](R) reader structure"] +impl crate::Readable for PETE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pete::W](W) writer structure"] +impl crate::Writable for PETE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PETE to value 0"] +impl crate::Resettable for PETE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/pmtpr.rs b/src/scu_parity/pmtpr.rs index a819789b..15fbf258 100644 --- a/src/scu_parity/pmtpr.rs +++ b/src/scu_parity/pmtpr.rs @@ -1,20 +1,68 @@ -#[doc = "Reader of register PMTPR"] -pub type R = crate::R; -#[doc = "Writer for register PMTPR"] -pub type W = crate::W; -#[doc = "Register PMTPR `reset()`'s with value 0"] -impl crate::ResetValue for super::PMTPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PMTPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `PRD`"] -pub type PRD_R = crate::R; -#[doc = "Reader of field `PWR`"] -pub type PWR_R = crate::R; -#[doc = "Write proxy for field `PWR`"] +#[doc = "Register `PMTPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRD` reader - Parity Read Values for Memory Test"] +pub struct PRD_R(crate::FieldReader); +impl PRD_R { + pub(crate) fn new(bits: u8) -> Self { + PRD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PWR` reader - Parity Write Values for Memory Test"] +pub struct PWR_R(crate::FieldReader); +impl PWR_R { + pub(crate) fn new(bits: u8) -> Self { + PWR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PWR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PWR` writer - Parity Write Values for Memory Test"] pub struct PWR_W<'a> { w: &'a mut W, } @@ -22,7 +70,7 @@ impl<'a> PWR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } @@ -44,4 +92,30 @@ impl W { pub fn pwr(&mut self) -> PWR_W { PWR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Memory Test Pattern Register\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 [pmtpr](index.html) module"] +pub struct PMTPR_SPEC; +impl crate::RegisterSpec for PMTPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pmtpr::R](R) reader structure"] +impl crate::Readable for PMTPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pmtpr::W](W) writer structure"] +impl crate::Writable for PMTPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PMTPR to value 0"] +impl crate::Resettable for PMTPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_parity/pmtsr.rs b/src/scu_parity/pmtsr.rs index b0a1dd8d..f75b2442 100644 --- a/src/scu_parity/pmtsr.rs +++ b/src/scu_parity/pmtsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PMTSR"] -pub type R = crate::R; -#[doc = "Writer for register PMTSR"] -pub type W = crate::W; -#[doc = "Register PMTSR `reset()`'s with value 0"] -impl crate::ResetValue for super::PMTSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PMTSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PMTSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Test Enable Control for PSRAM\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTENPS`"] -pub type MTENPS_R = crate::R; +#[doc = "Field `MTENPS` reader - Test Enable Control for PSRAM"] +pub struct MTENPS_R(crate::FieldReader); impl MTENPS_R { + pub(crate) fn new(bits: bool) -> Self { + MTENPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTENPS_A { @@ -38,15 +65,22 @@ impl MTENPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTENPS_A::VALUE1 + **self == MTENPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTENPS_A::VALUE2 + **self == MTENPS_A::VALUE2 } } -#[doc = "Write proxy for field `MTENPS`"] +impl core::ops::Deref for MTENPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MTENPS` writer - Test Enable Control for PSRAM"] pub struct MTENPS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> MTENPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTENPS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> MTENPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTENDS1`"] -pub type MTENDS1_R = crate::R; +#[doc = "Field `MTENDS1` reader - Test Enable Control for DSRAM1"] +pub struct MTENDS1_R(crate::FieldReader); impl MTENDS1_R { + pub(crate) fn new(bits: bool) -> Self { + MTENDS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTENDS1_A { @@ -113,15 +148,22 @@ impl MTENDS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTENDS1_A::VALUE1 + **self == MTENDS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTENDS1_A::VALUE2 + **self == MTENDS1_A::VALUE2 + } +} +impl core::ops::Deref for MTENDS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MTENDS1`"] +#[doc = "Field `MTENDS1` writer - Test Enable Control for DSRAM1"] pub struct MTENDS1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> MTENDS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTENDS1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> MTENDS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTEU0`"] -pub type MTEU0_R = crate::R; +#[doc = "Field `MTEU0` reader - Test Enable Control for USIC0 Memory"] +pub struct MTEU0_R(crate::FieldReader); impl MTEU0_R { + pub(crate) fn new(bits: bool) -> Self { + MTEU0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTEU0_A { @@ -188,15 +231,22 @@ impl MTEU0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTEU0_A::VALUE1 + **self == MTEU0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTEU0_A::VALUE2 + **self == MTEU0_A::VALUE2 } } -#[doc = "Write proxy for field `MTEU0`"] +impl core::ops::Deref for MTEU0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MTEU0` writer - Test Enable Control for USIC0 Memory"] pub struct MTEU0_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> MTEU0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTEU0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> MTEU0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTEU1`"] -pub type MTEU1_R = crate::R; +#[doc = "Field `MTEU1` reader - Test Enable Control for USIC1 Memory"] +pub struct MTEU1_R(crate::FieldReader); impl MTEU1_R { + pub(crate) fn new(bits: bool) -> Self { + MTEU1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTEU1_A { @@ -263,15 +314,22 @@ impl MTEU1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTEU1_A::VALUE1 + **self == MTEU1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTEU1_A::VALUE2 + **self == MTEU1_A::VALUE2 + } +} +impl core::ops::Deref for MTEU1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MTEU1`"] +#[doc = "Field `MTEU1` writer - Test Enable Control for USIC1 Memory"] pub struct MTEU1_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> MTEU1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTEU1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> MTEU1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTEMC`"] -pub type MTEMC_R = crate::R; +#[doc = "Field `MTEMC` reader - Test Enable Control for MultiCAN Memory"] +pub struct MTEMC_R(crate::FieldReader); impl MTEMC_R { + pub(crate) fn new(bits: bool) -> Self { + MTEMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTEMC_A { @@ -338,15 +397,22 @@ impl MTEMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTEMC_A::VALUE1 + **self == MTEMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTEMC_A::VALUE2 + **self == MTEMC_A::VALUE2 } } -#[doc = "Write proxy for field `MTEMC`"] +impl core::ops::Deref for MTEMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MTEMC` writer - Test Enable Control for MultiCAN Memory"] pub struct MTEMC_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> MTEMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTEMC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> MTEMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTEPPRF`"] -pub type MTEPPRF_R = crate::R; +#[doc = "Field `MTEPPRF` reader - Test Enable Control for PMU Prefetch Memory"] +pub struct MTEPPRF_R(crate::FieldReader); impl MTEPPRF_R { + pub(crate) fn new(bits: bool) -> Self { + MTEPPRF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTEPPRF_A { @@ -413,15 +480,22 @@ impl MTEPPRF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTEPPRF_A::VALUE1 + **self == MTEPPRF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTEPPRF_A::VALUE2 + **self == MTEPPRF_A::VALUE2 } } -#[doc = "Write proxy for field `MTEPPRF`"] +impl core::ops::Deref for MTEPPRF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MTEPPRF` writer - Test Enable Control for PMU Prefetch Memory"] pub struct MTEPPRF_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> MTEPPRF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTEPPRF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> MTEPPRF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MTUSB`"] -pub type MTUSB_R = crate::R; +#[doc = "Field `MTUSB` reader - Test Enable Control for USB Memory"] +pub struct MTUSB_R(crate::FieldReader); impl MTUSB_R { + pub(crate) fn new(bits: bool) -> Self { + MTUSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MTUSB_A { @@ -488,15 +563,22 @@ impl MTUSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MTUSB_A::VALUE1 + **self == MTUSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MTUSB_A::VALUE2 + **self == MTUSB_A::VALUE2 + } +} +impl core::ops::Deref for MTUSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MTUSB`"] +#[doc = "Field `MTUSB` writer - Test Enable Control for USB Memory"] pub struct MTUSB_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> MTUSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MTUSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard operation"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> MTUSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -608,4 +688,30 @@ impl W { pub fn mtusb(&mut self) -> MTUSB_W { MTUSB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Parity Memory Test Select Register\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 [pmtsr](index.html) module"] +pub struct PMTSR_SPEC; +impl crate::RegisterSpec for PMTSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pmtsr::R](R) reader structure"] +impl crate::Readable for PMTSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pmtsr::W](W) writer structure"] +impl crate::Writable for PMTSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PMTSR to value 0"] +impl crate::Resettable for PMTSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_pll.rs b/src/scu_pll.rs index dbcc9d53..009ddbc4 100644 --- a/src/scu_pll.rs +++ b/src/scu_pll.rs @@ -2,89 +2,46 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - PLL Status Register"] - pub pllstat: PLLSTAT, + pub pllstat: crate::Reg, #[doc = "0x04 - PLL Configuration 0 Register"] - pub pllcon0: PLLCON0, + pub pllcon0: crate::Reg, #[doc = "0x08 - PLL Configuration 1 Register"] - pub pllcon1: PLLCON1, + pub pllcon1: crate::Reg, #[doc = "0x0c - PLL Configuration 2 Register"] - pub pllcon2: PLLCON2, + pub pllcon2: crate::Reg, #[doc = "0x10 - USB PLL Status Register"] - pub usbpllstat: USBPLLSTAT, + pub usbpllstat: crate::Reg, #[doc = "0x14 - USB PLL Configuration Register"] - pub usbpllcon: USBPLLCON, - _reserved6: [u8; 16usize], + pub usbpllcon: crate::Reg, + _reserved6: [u8; 0x10], #[doc = "0x28 - Clock Multiplexing Status Register"] - pub clkmxstat: CLKMXSTAT, + pub clkmxstat: crate::Reg, } -#[doc = "PLL Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pllstat](pllstat) module"] -pub type PLLSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PLLSTAT; -#[doc = "`read()` method returns [pllstat::R](pllstat::R) reader structure"] -impl crate::Readable for PLLSTAT {} +#[doc = "PLLSTAT register accessor: an alias for `Reg`"] +pub type PLLSTAT = crate::Reg; #[doc = "PLL Status Register"] pub mod pllstat; -#[doc = "PLL Configuration 0 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pllcon0](pllcon0) module"] -pub type PLLCON0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PLLCON0; -#[doc = "`read()` method returns [pllcon0::R](pllcon0::R) reader structure"] -impl crate::Readable for PLLCON0 {} -#[doc = "`write(|w| ..)` method takes [pllcon0::W](pllcon0::W) writer structure"] -impl crate::Writable for PLLCON0 {} +#[doc = "PLLCON0 register accessor: an alias for `Reg`"] +pub type PLLCON0 = crate::Reg; #[doc = "PLL Configuration 0 Register"] pub mod pllcon0; -#[doc = "PLL Configuration 1 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pllcon1](pllcon1) module"] -pub type PLLCON1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PLLCON1; -#[doc = "`read()` method returns [pllcon1::R](pllcon1::R) reader structure"] -impl crate::Readable for PLLCON1 {} -#[doc = "`write(|w| ..)` method takes [pllcon1::W](pllcon1::W) writer structure"] -impl crate::Writable for PLLCON1 {} +#[doc = "PLLCON1 register accessor: an alias for `Reg`"] +pub type PLLCON1 = crate::Reg; #[doc = "PLL Configuration 1 Register"] pub mod pllcon1; -#[doc = "PLL Configuration 2 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pllcon2](pllcon2) module"] -pub type PLLCON2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PLLCON2; -#[doc = "`read()` method returns [pllcon2::R](pllcon2::R) reader structure"] -impl crate::Readable for PLLCON2 {} -#[doc = "`write(|w| ..)` method takes [pllcon2::W](pllcon2::W) writer structure"] -impl crate::Writable for PLLCON2 {} +#[doc = "PLLCON2 register accessor: an alias for `Reg`"] +pub type PLLCON2 = crate::Reg; #[doc = "PLL Configuration 2 Register"] pub mod pllcon2; -#[doc = "USB PLL Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbpllstat](usbpllstat) module"] -pub type USBPLLSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _USBPLLSTAT; -#[doc = "`read()` method returns [usbpllstat::R](usbpllstat::R) reader structure"] -impl crate::Readable for USBPLLSTAT {} +#[doc = "USBPLLSTAT register accessor: an alias for `Reg`"] +pub type USBPLLSTAT = crate::Reg; #[doc = "USB PLL Status Register"] pub mod usbpllstat; -#[doc = "USB PLL Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbpllcon](usbpllcon) module"] -pub type USBPLLCON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _USBPLLCON; -#[doc = "`read()` method returns [usbpllcon::R](usbpllcon::R) reader structure"] -impl crate::Readable for USBPLLCON {} -#[doc = "`write(|w| ..)` method takes [usbpllcon::W](usbpllcon::W) writer structure"] -impl crate::Writable for USBPLLCON {} +#[doc = "USBPLLCON register accessor: an alias for `Reg`"] +pub type USBPLLCON = crate::Reg; #[doc = "USB PLL Configuration Register"] pub mod usbpllcon; -#[doc = "Clock Multiplexing Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkmxstat](clkmxstat) module"] -pub type CLKMXSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLKMXSTAT; -#[doc = "`read()` method returns [clkmxstat::R](clkmxstat::R) reader structure"] -impl crate::Readable for CLKMXSTAT {} +#[doc = "CLKMXSTAT register accessor: an alias for `Reg`"] +pub type CLKMXSTAT = crate::Reg; #[doc = "Clock Multiplexing Status Register"] pub mod clkmxstat; diff --git a/src/scu_pll/clkmxstat.rs b/src/scu_pll/clkmxstat.rs index 0ca78039..a899d608 100644 --- a/src/scu_pll/clkmxstat.rs +++ b/src/scu_pll/clkmxstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CLKMXSTAT"] -pub type R = crate::R; +#[doc = "Register `CLKMXSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Status of System clock multiplexing upon source switching\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -15,28 +28,37 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SYSCLKMUX`"] -pub type SYSCLKMUX_R = crate::R; +#[doc = "Field `SYSCLKMUX` reader - Status of System clock multiplexing upon source switching"] +pub struct SYSCLKMUX_R(crate::FieldReader); impl SYSCLKMUX_R { + pub(crate) fn new(bits: u8) -> Self { + SYSCLKMUX_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(SYSCLKMUX_A::VALUE1), - 2 => Val(SYSCLKMUX_A::VALUE2), - i => Res(i), + 1 => Some(SYSCLKMUX_A::VALUE1), + 2 => Some(SYSCLKMUX_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYSCLKMUX_A::VALUE1 + **self == SYSCLKMUX_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYSCLKMUX_A::VALUE2 + **self == SYSCLKMUX_A::VALUE2 + } +} +impl core::ops::Deref for SYSCLKMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -46,3 +68,19 @@ impl R { SYSCLKMUX_R::new((self.bits & 0x03) as u8) } } +#[doc = "Clock Multiplexing Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clkmxstat](index.html) module"] +pub struct CLKMXSTAT_SPEC; +impl crate::RegisterSpec for CLKMXSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clkmxstat::R](R) reader structure"] +impl crate::Readable for CLKMXSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CLKMXSTAT to value 0"] +impl crate::Resettable for CLKMXSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_pll/pllcon0.rs b/src/scu_pll/pllcon0.rs index 53fcc495..40bc06a1 100644 --- a/src/scu_pll/pllcon0.rs +++ b/src/scu_pll/pllcon0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PLLCON0"] -pub type R = crate::R; -#[doc = "Writer for register PLLCON0"] -pub type W = crate::W; -#[doc = "Register PLLCON0 `reset()`'s with value 0x0003_0003"] -impl crate::ResetValue for super::PLLCON0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0003_0003 +#[doc = "Register `PLLCON0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PLLCON0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VCO Bypass\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOBYP`"] -pub type VCOBYP_R = crate::R; +#[doc = "Field `VCOBYP` reader - VCO Bypass"] +pub struct VCOBYP_R(crate::FieldReader); impl VCOBYP_R { + pub(crate) fn new(bits: bool) -> Self { + VCOBYP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOBYP_A { @@ -38,15 +65,22 @@ impl VCOBYP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOBYP_A::VALUE1 + **self == VCOBYP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOBYP_A::VALUE2 + **self == VCOBYP_A::VALUE2 + } +} +impl core::ops::Deref for VCOBYP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VCOBYP`"] +#[doc = "Field `VCOBYP` writer - VCO Bypass"] pub struct VCOBYP_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> VCOBYP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOBYP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> VCOBYP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOPWD`"] -pub type VCOPWD_R = crate::R; +#[doc = "Field `VCOPWD` reader - VCO Power Saving Mode"] +pub struct VCOPWD_R(crate::FieldReader); impl VCOPWD_R { + pub(crate) fn new(bits: bool) -> Self { + VCOPWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOPWD_A { @@ -113,15 +148,22 @@ impl VCOPWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOPWD_A::VALUE1 + **self == VCOPWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOPWD_A::VALUE2 + **self == VCOPWD_A::VALUE2 } } -#[doc = "Write proxy for field `VCOPWD`"] +impl core::ops::Deref for VCOPWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VCOPWD` writer - VCO Power Saving Mode"] pub struct VCOPWD_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> VCOPWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOPWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal behavior"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> VCOPWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOTR`"] -pub type VCOTR_R = crate::R; +#[doc = "Field `VCOTR` reader - VCO Trim Control"] +pub struct VCOTR_R(crate::FieldReader); impl VCOTR_R { + pub(crate) fn new(bits: bool) -> Self { + VCOTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOTR_A { @@ -188,15 +231,22 @@ impl VCOTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOTR_A::VALUE1 + **self == VCOTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOTR_A::VALUE2 + **self == VCOTR_A::VALUE2 } } -#[doc = "Write proxy for field `VCOTR`"] +impl core::ops::Deref for VCOTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VCOTR` writer - VCO Trim Control"] pub struct VCOTR_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> VCOTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "VCO bandwidth is operation in the normal range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> VCOTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FINDIS`"] -pub type FINDIS_R = crate::R; +#[doc = "Field `FINDIS` reader - Disconnect Oscillator from VCO"] +pub struct FINDIS_R(crate::FieldReader); impl FINDIS_R { + pub(crate) fn new(bits: bool) -> Self { + FINDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FINDIS_A { @@ -263,15 +314,22 @@ impl FINDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FINDIS_A::VALUE1 + **self == FINDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FINDIS_A::VALUE2 + **self == FINDIS_A::VALUE2 } } -#[doc = "Write proxy for field `FINDIS`"] +impl core::ops::Deref for FINDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FINDIS` writer - Disconnect Oscillator from VCO"] pub struct FINDIS_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> FINDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FINDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "connect oscillator to the VCO part"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> FINDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCDISCDIS`"] -pub type OSCDISCDIS_R = crate::R; +#[doc = "Field `OSCDISCDIS` reader - Oscillator Disconnect Disable"] +pub struct OSCDISCDIS_R(crate::FieldReader); impl OSCDISCDIS_R { + pub(crate) fn new(bits: bool) -> Self { + OSCDISCDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCDISCDIS_A { @@ -338,15 +397,22 @@ impl OSCDISCDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCDISCDIS_A::VALUE1 + **self == OSCDISCDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCDISCDIS_A::VALUE2 + **self == OSCDISCDIS_A::VALUE2 } } -#[doc = "Write proxy for field `OSCDISCDIS`"] +impl core::ops::Deref for OSCDISCDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OSCDISCDIS` writer - Oscillator Disconnect Disable"] pub struct OSCDISCDIS_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> OSCDISCDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCDISCDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> OSCDISCDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLPWD`"] -pub type PLLPWD_R = crate::R; +#[doc = "Field `PLLPWD` reader - PLL Power Saving Mode"] +pub struct PLLPWD_R(crate::FieldReader); impl PLLPWD_R { + pub(crate) fn new(bits: bool) -> Self { + PLLPWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLPWD_A { @@ -413,15 +480,22 @@ impl PLLPWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLPWD_A::VALUE1 + **self == PLLPWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLPWD_A::VALUE2 + **self == PLLPWD_A::VALUE2 + } +} +impl core::ops::Deref for PLLPWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PLLPWD`"] +#[doc = "Field `PLLPWD` writer - PLL Power Saving Mode"] pub struct PLLPWD_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> PLLPWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PLLPWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal behavior"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> PLLPWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCRES`"] -pub type OSCRES_R = crate::R; +#[doc = "Field `OSCRES` reader - Oscillator Watchdog Reset"] +pub struct OSCRES_R(crate::FieldReader); impl OSCRES_R { + pub(crate) fn new(bits: bool) -> Self { + OSCRES_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCRES_A { @@ -488,15 +563,22 @@ impl OSCRES_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCRES_A::VALUE1 + **self == OSCRES_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCRES_A::VALUE2 + **self == OSCRES_A::VALUE2 + } +} +impl core::ops::Deref for OSCRES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OSCRES`"] +#[doc = "Field `OSCRES` writer - Oscillator Watchdog Reset"] pub struct OSCRES_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> OSCRES_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCRES_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The Oscillator Watchdog of the PLL is not cleared and remains active"] #[inline(always)] @@ -531,11 +611,11 @@ impl<'a> OSCRES_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Write proxy for field `RESLD`"] +#[doc = "Field `RESLD` writer - Restart VCO Lock Detection"] pub struct RESLD_W<'a> { w: &'a mut W, } @@ -553,7 +633,7 @@ impl<'a> RESLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -571,9 +651,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AOTREN`"] -pub type AOTREN_R = crate::R; +#[doc = "Field `AOTREN` reader - Automatic Oscillator Calibration Enable"] +pub struct AOTREN_R(crate::FieldReader); impl AOTREN_R { + pub(crate) fn new(bits: bool) -> Self { + AOTREN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AOTREN_A { @@ -585,15 +668,22 @@ impl AOTREN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AOTREN_A::VALUE1 + **self == AOTREN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AOTREN_A::VALUE2 + **self == AOTREN_A::VALUE2 + } +} +impl core::ops::Deref for AOTREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `AOTREN`"] +#[doc = "Field `AOTREN` writer - Automatic Oscillator Calibration Enable"] pub struct AOTREN_W<'a> { w: &'a mut W, } @@ -601,9 +691,7 @@ impl<'a> AOTREN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AOTREN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disable"] #[inline(always)] @@ -628,7 +716,7 @@ impl<'a> AOTREN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -646,9 +734,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FOTR`"] -pub type FOTR_R = crate::R; +#[doc = "Field `FOTR` reader - Factory Oscillator Calibration"] +pub struct FOTR_R(crate::FieldReader); impl FOTR_R { + pub(crate) fn new(bits: bool) -> Self { + FOTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FOTR_A { @@ -660,15 +751,22 @@ impl FOTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FOTR_A::VALUE1 + **self == FOTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FOTR_A::VALUE2 + **self == FOTR_A::VALUE2 } } -#[doc = "Write proxy for field `FOTR`"] +impl core::ops::Deref for FOTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FOTR` writer - Factory Oscillator Calibration"] pub struct FOTR_W<'a> { w: &'a mut W, } @@ -676,9 +774,7 @@ impl<'a> FOTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FOTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -703,7 +799,7 @@ impl<'a> FOTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -805,4 +901,30 @@ impl W { pub fn fotr(&mut self) -> FOTR_W { FOTR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PLL Configuration 0 Register\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 [pllcon0](index.html) module"] +pub struct PLLCON0_SPEC; +impl crate::RegisterSpec for PLLCON0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pllcon0::R](R) reader structure"] +impl crate::Readable for PLLCON0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pllcon0::W](W) writer structure"] +impl crate::Writable for PLLCON0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PLLCON0 to value 0x0003_0003"] +impl crate::Resettable for PLLCON0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0003_0003 + } } diff --git a/src/scu_pll/pllcon1.rs b/src/scu_pll/pllcon1.rs index 40facde3..86707aa1 100644 --- a/src/scu_pll/pllcon1.rs +++ b/src/scu_pll/pllcon1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PLLCON1"] -pub type R = crate::R; -#[doc = "Writer for register PLLCON1"] -pub type W = crate::W; -#[doc = "Register PLLCON1 `reset()`'s with value 0"] -impl crate::ResetValue for super::PLLCON1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PLLCON1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PLLCON1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `K1DIV`"] -pub type K1DIV_R = crate::R; -#[doc = "Write proxy for field `K1DIV`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `K1DIV` reader - K1-Divider Value"] +pub struct K1DIV_R(crate::FieldReader); +impl K1DIV_R { + pub(crate) fn new(bits: u8) -> Self { + K1DIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for K1DIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `K1DIV` writer - K1-Divider Value"] pub struct K1DIV_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> K1DIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x7f) | ((value as u32) & 0x7f); + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); self.w } } -#[doc = "Reader of field `NDIV`"] -pub type NDIV_R = crate::R; -#[doc = "Write proxy for field `NDIV`"] +#[doc = "Field `NDIV` reader - N-Divider Value"] +pub struct NDIV_R(crate::FieldReader); +impl NDIV_R { + pub(crate) fn new(bits: u8) -> Self { + NDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NDIV` writer - N-Divider Value"] pub struct NDIV_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> NDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x7f << 8)) | (((value as u32) & 0x7f) << 8); + self.w.bits = (self.w.bits & !(0x7f << 8)) | ((value as u32 & 0x7f) << 8); self.w } } -#[doc = "Reader of field `K2DIV`"] -pub type K2DIV_R = crate::R; -#[doc = "Write proxy for field `K2DIV`"] +#[doc = "Field `K2DIV` reader - K2-Divider Value"] +pub struct K2DIV_R(crate::FieldReader); +impl K2DIV_R { + pub(crate) fn new(bits: u8) -> Self { + K2DIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for K2DIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `K2DIV` writer - K2-Divider Value"] pub struct K2DIV_W<'a> { w: &'a mut W, } @@ -48,13 +108,25 @@ impl<'a> K2DIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x7f << 16)) | (((value as u32) & 0x7f) << 16); + self.w.bits = (self.w.bits & !(0x7f << 16)) | ((value as u32 & 0x7f) << 16); self.w } } -#[doc = "Reader of field `PDIV`"] -pub type PDIV_R = crate::R; -#[doc = "Write proxy for field `PDIV`"] +#[doc = "Field `PDIV` reader - P-Divider Value"] +pub struct PDIV_R(crate::FieldReader); +impl PDIV_R { + pub(crate) fn new(bits: u8) -> Self { + PDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIV` writer - P-Divider Value"] pub struct PDIV_W<'a> { w: &'a mut W, } @@ -62,7 +134,7 @@ impl<'a> PDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -109,4 +181,30 @@ impl W { pub fn pdiv(&mut self) -> PDIV_W { PDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PLL Configuration 1 Register\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 [pllcon1](index.html) module"] +pub struct PLLCON1_SPEC; +impl crate::RegisterSpec for PLLCON1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pllcon1::R](R) reader structure"] +impl crate::Readable for PLLCON1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pllcon1::W](W) writer structure"] +impl crate::Writable for PLLCON1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PLLCON1 to value 0"] +impl crate::Resettable for PLLCON1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_pll/pllcon2.rs b/src/scu_pll/pllcon2.rs index 7d4c39c9..b8907f4a 100644 --- a/src/scu_pll/pllcon2.rs +++ b/src/scu_pll/pllcon2.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PLLCON2"] -pub type R = crate::R; -#[doc = "Writer for register PLLCON2"] -pub type W = crate::W; -#[doc = "Register PLLCON2 `reset()`'s with value 0x01"] -impl crate::ResetValue for super::PLLCON2 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x01 +#[doc = "Register `PLLCON2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PLLCON2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "P-Divider Input Selection\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PINSEL`"] -pub type PINSEL_R = crate::R; +#[doc = "Field `PINSEL` reader - P-Divider Input Selection"] +pub struct PINSEL_R(crate::FieldReader); impl PINSEL_R { + pub(crate) fn new(bits: bool) -> Self { + PINSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PINSEL_A { @@ -38,15 +65,22 @@ impl PINSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PINSEL_A::VALUE1 + **self == PINSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PINSEL_A::VALUE2 + **self == PINSEL_A::VALUE2 } } -#[doc = "Write proxy for field `PINSEL`"] +impl core::ops::Deref for PINSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PINSEL` writer - P-Divider Input Selection"] pub struct PINSEL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> PINSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PINSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "PLL external oscillator selected"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> PINSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `K1INSEL`"] -pub type K1INSEL_R = crate::R; +#[doc = "Field `K1INSEL` reader - K1-Divider Input Selection"] +pub struct K1INSEL_R(crate::FieldReader); impl K1INSEL_R { + pub(crate) fn new(bits: bool) -> Self { + K1INSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> K1INSEL_A { @@ -113,15 +148,22 @@ impl K1INSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == K1INSEL_A::VALUE1 + **self == K1INSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == K1INSEL_A::VALUE2 + **self == K1INSEL_A::VALUE2 + } +} +impl core::ops::Deref for K1INSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `K1INSEL`"] +#[doc = "Field `K1INSEL` writer - K1-Divider Input Selection"] pub struct K1INSEL_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> K1INSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: K1INSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "PLL external oscillator selected"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> K1INSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -183,4 +223,30 @@ impl W { pub fn k1insel(&mut self) -> K1INSEL_W { K1INSEL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PLL Configuration 2 Register\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 [pllcon2](index.html) module"] +pub struct PLLCON2_SPEC; +impl crate::RegisterSpec for PLLCON2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pllcon2::R](R) reader structure"] +impl crate::Readable for PLLCON2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pllcon2::W](W) writer structure"] +impl crate::Writable for PLLCON2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PLLCON2 to value 0x01"] +impl crate::Resettable for PLLCON2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } } diff --git a/src/scu_pll/pllstat.rs b/src/scu_pll/pllstat.rs index d559c6ba..af5e9337 100644 --- a/src/scu_pll/pllstat.rs +++ b/src/scu_pll/pllstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PLLSTAT"] -pub type R = crate::R; +#[doc = "Register `PLLSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "VCO Bypass Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VCOBYST_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOBYST`"] -pub type VCOBYST_R = crate::R; +#[doc = "Field `VCOBYST` reader - VCO Bypass Status"] +pub struct VCOBYST_R(crate::FieldReader); impl VCOBYST_R { + pub(crate) fn new(bits: bool) -> Self { + VCOBYST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOBYST_A { @@ -28,12 +44,19 @@ impl VCOBYST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOBYST_A::VALUE1 + **self == VCOBYST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOBYST_A::VALUE2 + **self == VCOBYST_A::VALUE2 + } +} +impl core::ops::Deref for VCOBYST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PLL Power-saving Mode Status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PWDSTAT`"] -pub type PWDSTAT_R = crate::R; +#[doc = "Field `PWDSTAT` reader - PLL Power-saving Mode Status"] +pub struct PWDSTAT_R(crate::FieldReader); impl PWDSTAT_R { + pub(crate) fn new(bits: bool) -> Self { + PWDSTAT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PWDSTAT_A { @@ -64,12 +90,19 @@ impl PWDSTAT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PWDSTAT_A::VALUE1 + **self == PWDSTAT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PWDSTAT_A::VALUE2 + **self == PWDSTAT_A::VALUE2 + } +} +impl core::ops::Deref for PWDSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PLL LOCK Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOLOCK`"] -pub type VCOLOCK_R = crate::R; +#[doc = "Field `VCOLOCK` reader - PLL LOCK Status"] +pub struct VCOLOCK_R(crate::FieldReader); impl VCOLOCK_R { + pub(crate) fn new(bits: bool) -> Self { + VCOLOCK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOLOCK_A { @@ -100,12 +136,19 @@ impl VCOLOCK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOLOCK_A::VALUE1 + **self == VCOLOCK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOLOCK_A::VALUE2 + **self == VCOLOCK_A::VALUE2 + } +} +impl core::ops::Deref for VCOLOCK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "K1 Divider Ready Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `K1RDY`"] -pub type K1RDY_R = crate::R; +#[doc = "Field `K1RDY` reader - K1 Divider Ready Status"] +pub struct K1RDY_R(crate::FieldReader); impl K1RDY_R { + pub(crate) fn new(bits: bool) -> Self { + K1RDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> K1RDY_A { @@ -136,12 +182,19 @@ impl K1RDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == K1RDY_A::VALUE1 + **self == K1RDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == K1RDY_A::VALUE2 + **self == K1RDY_A::VALUE2 + } +} +impl core::ops::Deref for K1RDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "K2 Divider Ready Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `K2RDY`"] -pub type K2RDY_R = crate::R; +#[doc = "Field `K2RDY` reader - K2 Divider Ready Status"] +pub struct K2RDY_R(crate::FieldReader); impl K2RDY_R { + pub(crate) fn new(bits: bool) -> Self { + K2RDY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> K2RDY_A { @@ -172,12 +228,19 @@ impl K2RDY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == K2RDY_A::VALUE1 + **self == K2RDY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == K2RDY_A::VALUE2 + **self == K2RDY_A::VALUE2 + } +} +impl core::ops::Deref for K2RDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Bypass Mode Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BY`"] -pub type BY_R = crate::R; +#[doc = "Field `BY` reader - Bypass Mode Status"] +pub struct BY_R(crate::FieldReader); impl BY_R { + pub(crate) fn new(bits: bool) -> Self { + BY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BY_A { @@ -208,12 +274,19 @@ impl BY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BY_A::VALUE1 + **self == BY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BY_A::VALUE2 + **self == BY_A::VALUE2 + } +} +impl core::ops::Deref for BY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Oscillator for PLL Valid Low Status Bit\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLLV`"] -pub type PLLLV_R = crate::R; +#[doc = "Field `PLLLV` reader - Oscillator for PLL Valid Low Status Bit"] +pub struct PLLLV_R(crate::FieldReader); impl PLLLV_R { + pub(crate) fn new(bits: bool) -> Self { + PLLLV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLLV_A { @@ -244,12 +320,19 @@ impl PLLLV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLLV_A::VALUE1 + **self == PLLLV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLLV_A::VALUE2 + **self == PLLLV_A::VALUE2 + } +} +impl core::ops::Deref for PLLLV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Oscillator for PLL Valid High Status Bit\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLHV`"] -pub type PLLHV_R = crate::R; +#[doc = "Field `PLLHV` reader - Oscillator for PLL Valid High Status Bit"] +pub struct PLLHV_R(crate::FieldReader); impl PLLHV_R { + pub(crate) fn new(bits: bool) -> Self { + PLLHV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLHV_A { @@ -280,12 +366,19 @@ impl PLLHV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLHV_A::VALUE1 + **self == PLLHV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLHV_A::VALUE2 + **self == PLLHV_A::VALUE2 + } +} +impl core::ops::Deref for PLLHV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Oscillator for PLL Valid Spike Status Bit\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLSP`"] -pub type PLLSP_R = crate::R; +#[doc = "Field `PLLSP` reader - Oscillator for PLL Valid Spike Status Bit"] +pub struct PLLSP_R(crate::FieldReader); impl PLLSP_R { + pub(crate) fn new(bits: bool) -> Self { + PLLSP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLSP_A { @@ -316,12 +412,19 @@ impl PLLSP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLSP_A::VALUE1 + **self == PLLSP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLSP_A::VALUE2 + **self == PLLSP_A::VALUE2 + } +} +impl core::ops::Deref for PLLSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,3 +474,19 @@ impl R { PLLSP_R::new(((self.bits >> 9) & 0x01) != 0) } } +#[doc = "PLL Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pllstat](index.html) module"] +pub struct PLLSTAT_SPEC; +impl crate::RegisterSpec for PLLSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pllstat::R](R) reader structure"] +impl crate::Readable for PLLSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PLLSTAT to value 0x02"] +impl crate::Resettable for PLLSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } +} diff --git a/src/scu_pll/usbpllcon.rs b/src/scu_pll/usbpllcon.rs index 82c995c0..629ea501 100644 --- a/src/scu_pll/usbpllcon.rs +++ b/src/scu_pll/usbpllcon.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register USBPLLCON"] -pub type R = crate::R; -#[doc = "Writer for register USBPLLCON"] -pub type W = crate::W; -#[doc = "Register USBPLLCON `reset()`'s with value 0x0001_0003"] -impl crate::ResetValue for super::USBPLLCON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0001_0003 +#[doc = "Register `USBPLLCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `USBPLLCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VCO Bypass\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOBYP`"] -pub type VCOBYP_R = crate::R; +#[doc = "Field `VCOBYP` reader - VCO Bypass"] +pub struct VCOBYP_R(crate::FieldReader); impl VCOBYP_R { + pub(crate) fn new(bits: bool) -> Self { + VCOBYP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOBYP_A { @@ -38,15 +65,22 @@ impl VCOBYP_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOBYP_A::VALUE1 + **self == VCOBYP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOBYP_A::VALUE2 + **self == VCOBYP_A::VALUE2 + } +} +impl core::ops::Deref for VCOBYP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VCOBYP`"] +#[doc = "Field `VCOBYP` writer - VCO Bypass"] pub struct VCOBYP_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> VCOBYP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOBYP_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> VCOBYP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOPWD`"] -pub type VCOPWD_R = crate::R; +#[doc = "Field `VCOPWD` reader - VCO Power Saving Mode"] +pub struct VCOPWD_R(crate::FieldReader); impl VCOPWD_R { + pub(crate) fn new(bits: bool) -> Self { + VCOPWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOPWD_A { @@ -113,15 +148,22 @@ impl VCOPWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOPWD_A::VALUE1 + **self == VCOPWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOPWD_A::VALUE2 + **self == VCOPWD_A::VALUE2 } } -#[doc = "Write proxy for field `VCOPWD`"] +impl core::ops::Deref for VCOPWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VCOPWD` writer - VCO Power Saving Mode"] pub struct VCOPWD_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> VCOPWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOPWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal behavior"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> VCOPWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOTR`"] -pub type VCOTR_R = crate::R; +#[doc = "Field `VCOTR` reader - VCO Trim Control"] +pub struct VCOTR_R(crate::FieldReader); impl VCOTR_R { + pub(crate) fn new(bits: bool) -> Self { + VCOTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOTR_A { @@ -188,15 +231,22 @@ impl VCOTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOTR_A::VALUE1 + **self == VCOTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOTR_A::VALUE2 + **self == VCOTR_A::VALUE2 + } +} +impl core::ops::Deref for VCOTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VCOTR`"] +#[doc = "Field `VCOTR` writer - VCO Trim Control"] pub struct VCOTR_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> VCOTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VCOTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "VCO bandwidth is operating in the normal range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> VCOTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FINDIS`"] -pub type FINDIS_R = crate::R; +#[doc = "Field `FINDIS` reader - Disconnect Oscillator from VCO"] +pub struct FINDIS_R(crate::FieldReader); impl FINDIS_R { + pub(crate) fn new(bits: bool) -> Self { + FINDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FINDIS_A { @@ -263,15 +314,22 @@ impl FINDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FINDIS_A::VALUE1 + **self == FINDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FINDIS_A::VALUE2 + **self == FINDIS_A::VALUE2 } } -#[doc = "Write proxy for field `FINDIS`"] +impl core::ops::Deref for FINDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FINDIS` writer - Disconnect Oscillator from VCO"] pub struct FINDIS_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> FINDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FINDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Connect oscillator to the VCO part"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> FINDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OSCDISCDIS`"] -pub type OSCDISCDIS_R = crate::R; +#[doc = "Field `OSCDISCDIS` reader - Oscillator Disconnect Disable"] +pub struct OSCDISCDIS_R(crate::FieldReader); impl OSCDISCDIS_R { + pub(crate) fn new(bits: bool) -> Self { + OSCDISCDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OSCDISCDIS_A { @@ -338,15 +397,22 @@ impl OSCDISCDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OSCDISCDIS_A::VALUE1 + **self == OSCDISCDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OSCDISCDIS_A::VALUE2 + **self == OSCDISCDIS_A::VALUE2 + } +} +impl core::ops::Deref for OSCDISCDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `OSCDISCDIS`"] +#[doc = "Field `OSCDISCDIS` writer - Oscillator Disconnect Disable"] pub struct OSCDISCDIS_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> OSCDISCDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OSCDISCDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] @@ -381,13 +445,25 @@ impl<'a> OSCDISCDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `NDIV`"] -pub type NDIV_R = crate::R; -#[doc = "Write proxy for field `NDIV`"] +#[doc = "Field `NDIV` reader - N-Divider Value"] +pub struct NDIV_R(crate::FieldReader); +impl NDIV_R { + pub(crate) fn new(bits: u8) -> Self { + NDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NDIV` writer - N-Divider Value"] pub struct NDIV_W<'a> { w: &'a mut W, } @@ -395,7 +471,7 @@ impl<'a> NDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x7f << 8)) | (((value as u32) & 0x7f) << 8); + self.w.bits = (self.w.bits & !(0x7f << 8)) | ((value as u32 & 0x7f) << 8); self.w } } @@ -413,9 +489,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PLLPWD`"] -pub type PLLPWD_R = crate::R; +#[doc = "Field `PLLPWD` reader - PLL Power Saving Mode"] +pub struct PLLPWD_R(crate::FieldReader); impl PLLPWD_R { + pub(crate) fn new(bits: bool) -> Self { + PLLPWD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PLLPWD_A { @@ -427,15 +506,22 @@ impl PLLPWD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PLLPWD_A::VALUE1 + **self == PLLPWD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PLLPWD_A::VALUE2 + **self == PLLPWD_A::VALUE2 + } +} +impl core::ops::Deref for PLLPWD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PLLPWD`"] +#[doc = "Field `PLLPWD` writer - PLL Power Saving Mode"] pub struct PLLPWD_W<'a> { w: &'a mut W, } @@ -443,9 +529,7 @@ impl<'a> PLLPWD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PLLPWD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal behavior"] #[inline(always)] @@ -470,11 +554,11 @@ impl<'a> PLLPWD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Write proxy for field `RESLD`"] +#[doc = "Field `RESLD` writer - Restart VCO Lock Detection"] pub struct RESLD_W<'a> { w: &'a mut W, } @@ -492,13 +576,25 @@ impl<'a> RESLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `PDIV`"] -pub type PDIV_R = crate::R; -#[doc = "Write proxy for field `PDIV`"] +#[doc = "Field `PDIV` reader - P-Divider Value"] +pub struct PDIV_R(crate::FieldReader); +impl PDIV_R { + pub(crate) fn new(bits: u8) -> Self { + PDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIV` writer - P-Divider Value"] pub struct PDIV_W<'a> { w: &'a mut W, } @@ -506,7 +602,7 @@ impl<'a> PDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -598,4 +694,30 @@ impl W { pub fn pdiv(&mut self) -> PDIV_W { PDIV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "USB PLL Configuration Register\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 [usbpllcon](index.html) module"] +pub struct USBPLLCON_SPEC; +impl crate::RegisterSpec for USBPLLCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [usbpllcon::R](R) reader structure"] +impl crate::Readable for USBPLLCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [usbpllcon::W](W) writer structure"] +impl crate::Writable for USBPLLCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets USBPLLCON to value 0x0001_0003"] +impl crate::Resettable for USBPLLCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0001_0003 + } } diff --git a/src/scu_pll/usbpllstat.rs b/src/scu_pll/usbpllstat.rs index 29cb5f59..51f2c597 100644 --- a/src/scu_pll/usbpllstat.rs +++ b/src/scu_pll/usbpllstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register USBPLLSTAT"] -pub type R = crate::R; +#[doc = "Register `USBPLLSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "VCO Bypass Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VCOBYST_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOBYST`"] -pub type VCOBYST_R = crate::R; +#[doc = "Field `VCOBYST` reader - VCO Bypass Status"] +pub struct VCOBYST_R(crate::FieldReader); impl VCOBYST_R { + pub(crate) fn new(bits: bool) -> Self { + VCOBYST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOBYST_A { @@ -28,12 +44,19 @@ impl VCOBYST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOBYST_A::VALUE1 + **self == VCOBYST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOBYST_A::VALUE2 + **self == VCOBYST_A::VALUE2 + } +} +impl core::ops::Deref for VCOBYST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PLL Power-saving Mode Status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PWDSTAT`"] -pub type PWDSTAT_R = crate::R; +#[doc = "Field `PWDSTAT` reader - PLL Power-saving Mode Status"] +pub struct PWDSTAT_R(crate::FieldReader); impl PWDSTAT_R { + pub(crate) fn new(bits: bool) -> Self { + PWDSTAT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PWDSTAT_A { @@ -64,12 +90,19 @@ impl PWDSTAT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PWDSTAT_A::VALUE1 + **self == PWDSTAT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PWDSTAT_A::VALUE2 + **self == PWDSTAT_A::VALUE2 + } +} +impl core::ops::Deref for PWDSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PLL VCO Lock Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOLOCK`"] -pub type VCOLOCK_R = crate::R; +#[doc = "Field `VCOLOCK` reader - PLL VCO Lock Status"] +pub struct VCOLOCK_R(crate::FieldReader); impl VCOLOCK_R { + pub(crate) fn new(bits: bool) -> Self { + VCOLOCK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOLOCK_A { @@ -100,12 +136,19 @@ impl VCOLOCK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOLOCK_A::VALUE1 + **self == VCOLOCK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOLOCK_A::VALUE2 + **self == VCOLOCK_A::VALUE2 + } +} +impl core::ops::Deref for VCOLOCK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Bypass Mode Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BY`"] -pub type BY_R = crate::R; +#[doc = "Field `BY` reader - Bypass Mode Status"] +pub struct BY_R(crate::FieldReader); impl BY_R { + pub(crate) fn new(bits: bool) -> Self { + BY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BY_A { @@ -136,12 +182,19 @@ impl BY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BY_A::VALUE1 + **self == BY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BY_A::VALUE2 + **self == BY_A::VALUE2 + } +} +impl core::ops::Deref for BY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PLL LOCK Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VCOLOCKED`"] -pub type VCOLOCKED_R = crate::R; +#[doc = "Field `VCOLOCKED` reader - PLL LOCK Status"] +pub struct VCOLOCKED_R(crate::FieldReader); impl VCOLOCKED_R { + pub(crate) fn new(bits: bool) -> Self { + VCOLOCKED_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VCOLOCKED_A { @@ -172,12 +228,19 @@ impl VCOLOCKED_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VCOLOCKED_A::VALUE1 + **self == VCOLOCKED_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VCOLOCKED_A::VALUE2 + **self == VCOLOCKED_A::VALUE2 + } +} +impl core::ops::Deref for VCOLOCKED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -207,3 +270,19 @@ impl R { VCOLOCKED_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "USB PLL Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbpllstat](index.html) module"] +pub struct USBPLLSTAT_SPEC; +impl crate::RegisterSpec for USBPLLSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [usbpllstat::R](R) reader structure"] +impl crate::Readable for USBPLLSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets USBPLLSTAT to value 0x02"] +impl crate::Resettable for USBPLLSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } +} diff --git a/src/scu_power.rs b/src/scu_power.rs index 7acfac02..38a42cd8 100644 --- a/src/scu_power.rs +++ b/src/scu_power.rs @@ -2,73 +2,41 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - PCU Status Register"] - pub pwrstat: PWRSTAT, + pub pwrstat: crate::Reg, #[doc = "0x04 - PCU Set Control Register"] - pub pwrset: PWRSET, + pub pwrset: crate::Reg, #[doc = "0x08 - PCU Clear Control Register"] - pub pwrclr: PWRCLR, - _reserved3: [u8; 4usize], + pub pwrclr: crate::Reg, + _reserved3: [u8; 0x04], #[doc = "0x10 - EVR Status Register"] - pub evrstat: EVRSTAT, + pub evrstat: crate::Reg, #[doc = "0x14 - EVR VADC Status Register"] - pub evrvadcstat: EVRVADCSTAT, - _reserved5: [u8; 20usize], + pub evrvadcstat: crate::Reg, + _reserved5: [u8; 0x14], #[doc = "0x2c - Power Monitor Control"] - pub pwrmon: PWRMON, + pub pwrmon: crate::Reg, } -#[doc = "PCU Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrstat](pwrstat) module"] -pub type PWRSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PWRSTAT; -#[doc = "`read()` method returns [pwrstat::R](pwrstat::R) reader structure"] -impl crate::Readable for PWRSTAT {} +#[doc = "PWRSTAT register accessor: an alias for `Reg`"] +pub type PWRSTAT = crate::Reg; #[doc = "PCU Status Register"] pub mod pwrstat; -#[doc = "PCU Set Control Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrset](pwrset) module"] -pub type PWRSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PWRSET; -#[doc = "`write(|w| ..)` method takes [pwrset::W](pwrset::W) writer structure"] -impl crate::Writable for PWRSET {} +#[doc = "PWRSET register accessor: an alias for `Reg`"] +pub type PWRSET = crate::Reg; #[doc = "PCU Set Control Register"] pub mod pwrset; -#[doc = "PCU Clear Control Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrclr](pwrclr) module"] -pub type PWRCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PWRCLR; -#[doc = "`write(|w| ..)` method takes [pwrclr::W](pwrclr::W) writer structure"] -impl crate::Writable for PWRCLR {} +#[doc = "PWRCLR register accessor: an alias for `Reg`"] +pub type PWRCLR = crate::Reg; #[doc = "PCU Clear Control Register"] pub mod pwrclr; -#[doc = "EVR Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evrstat](evrstat) module"] -pub type EVRSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EVRSTAT; -#[doc = "`read()` method returns [evrstat::R](evrstat::R) reader structure"] -impl crate::Readable for EVRSTAT {} +#[doc = "EVRSTAT register accessor: an alias for `Reg`"] +pub type EVRSTAT = crate::Reg; #[doc = "EVR Status Register"] pub mod evrstat; -#[doc = "EVR VADC Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evrvadcstat](evrvadcstat) module"] -pub type EVRVADCSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EVRVADCSTAT; -#[doc = "`read()` method returns [evrvadcstat::R](evrvadcstat::R) reader structure"] -impl crate::Readable for EVRVADCSTAT {} +#[doc = "EVRVADCSTAT register accessor: an alias for `Reg`"] +pub type EVRVADCSTAT = crate::Reg; #[doc = "EVR VADC Status Register"] pub mod evrvadcstat; -#[doc = "Power Monitor Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrmon](pwrmon) module"] -pub type PWRMON = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PWRMON; -#[doc = "`read()` method returns [pwrmon::R](pwrmon::R) reader structure"] -impl crate::Readable for PWRMON {} -#[doc = "`write(|w| ..)` method takes [pwrmon::W](pwrmon::W) writer structure"] -impl crate::Writable for PWRMON {} +#[doc = "PWRMON register accessor: an alias for `Reg`"] +pub type PWRMON = crate::Reg; #[doc = "Power Monitor Control"] pub mod pwrmon; diff --git a/src/scu_power/evrstat.rs b/src/scu_power/evrstat.rs index 86f009de..b42d343b 100644 --- a/src/scu_power/evrstat.rs +++ b/src/scu_power/evrstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register EVRSTAT"] -pub type R = crate::R; +#[doc = "Register `EVRSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Regulator Overvoltage for 1.3 V\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OV13_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `OV13`"] -pub type OV13_R = crate::R; +#[doc = "Field `OV13` reader - Regulator Overvoltage for 1.3 V"] +pub struct OV13_R(crate::FieldReader); impl OV13_R { + pub(crate) fn new(bits: bool) -> Self { + OV13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OV13_A { @@ -28,12 +44,19 @@ impl OV13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == OV13_A::VALUE1 + **self == OV13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == OV13_A::VALUE2 + **self == OV13_A::VALUE2 + } +} +impl core::ops::Deref for OV13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -43,3 +66,19 @@ impl R { OV13_R::new(((self.bits >> 1) & 0x01) != 0) } } +#[doc = "EVR Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evrstat](index.html) module"] +pub struct EVRSTAT_SPEC; +impl crate::RegisterSpec for EVRSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evrstat::R](R) reader structure"] +impl crate::Readable for EVRSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets EVRSTAT to value 0"] +impl crate::Resettable for EVRSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_power/evrvadcstat.rs b/src/scu_power/evrvadcstat.rs index 6fc7c90b..59a208ce 100644 --- a/src/scu_power/evrvadcstat.rs +++ b/src/scu_power/evrvadcstat.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register EVRVADCSTAT"] -pub type R = crate::R; -#[doc = "Reader of field `VADC13V`"] -pub type VADC13V_R = crate::R; -#[doc = "Reader of field `VADC33V`"] -pub type VADC33V_R = crate::R; +#[doc = "Register `EVRVADCSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `VADC13V` reader - VADC 1.3 V Conversion Result"] +pub struct VADC13V_R(crate::FieldReader); +impl VADC13V_R { + pub(crate) fn new(bits: u8) -> Self { + VADC13V_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VADC13V_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VADC33V` reader - VADC 3.3 V Conversion Result"] +pub struct VADC33V_R(crate::FieldReader); +impl VADC33V_R { + pub(crate) fn new(bits: u8) -> Self { + VADC33V_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VADC33V_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - VADC 1.3 V Conversion Result"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { VADC33V_R::new(((self.bits >> 8) & 0xff) as u8) } } +#[doc = "EVR VADC Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evrvadcstat](index.html) module"] +pub struct EVRVADCSTAT_SPEC; +impl crate::RegisterSpec for EVRVADCSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evrvadcstat::R](R) reader structure"] +impl crate::Readable for EVRVADCSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets EVRVADCSTAT to value 0"] +impl crate::Resettable for EVRVADCSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_power/pwrclr.rs b/src/scu_power/pwrclr.rs index aa896ee3..7790cf6d 100644 --- a/src/scu_power/pwrclr.rs +++ b/src/scu_power/pwrclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PWRCLR"] -pub type W = crate::W; -#[doc = "Register PWRCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::PWRCLR { - type Type = u32; +#[doc = "Register `PWRCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Disable Hibernate Domain\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIB`"] +#[doc = "Field `HIB` writer - Clear Disable Hibernate Domain"] pub struct HIB_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBPHYPDQ`"] +#[doc = "Field `USBPHYPDQ` writer - Clear USB PHY Transceiver Disable"] pub struct USBPHYPDQ_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> USBPHYPDQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBPHYPDQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> USBPHYPDQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBPUWQ`"] +#[doc = "Field `USBPUWQ` writer - Clear USB Weak Pull-Up at PADN Enable"] pub struct USBPUWQ_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> USBPUWQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBPUWQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> USBPUWQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -183,4 +188,26 @@ impl W { pub fn usbpuwq(&mut self) -> USBPUWQ_W { USBPUWQ_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PCU Clear Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrclr](index.html) module"] +pub struct PWRCLR_SPEC; +impl crate::RegisterSpec for PWRCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [pwrclr::W](W) writer structure"] +impl crate::Writable for PWRCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PWRCLR to value 0"] +impl crate::Resettable for PWRCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_power/pwrmon.rs b/src/scu_power/pwrmon.rs index c8da3830..740dfafd 100644 --- a/src/scu_power/pwrmon.rs +++ b/src/scu_power/pwrmon.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PWRMON"] -pub type R = crate::R; -#[doc = "Writer for register PWRMON"] -pub type W = crate::W; -#[doc = "Register PWRMON `reset()`'s with value 0"] -impl crate::ResetValue for super::PWRMON { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PWRMON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PWRMON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `THRS` reader - Threshold"] +pub struct THRS_R(crate::FieldReader); +impl THRS_R { + pub(crate) fn new(bits: u8) -> Self { + THRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for THRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `THRS`"] -pub type THRS_R = crate::R; -#[doc = "Write proxy for field `THRS`"] +#[doc = "Field `THRS` writer - Threshold"] pub struct THRS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> THRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `INTV`"] -pub type INTV_R = crate::R; -#[doc = "Write proxy for field `INTV`"] +#[doc = "Field `INTV` reader - Interval"] +pub struct INTV_R(crate::FieldReader); +impl INTV_R { + pub(crate) fn new(bits: u8) -> Self { + INTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INTV` writer - Interval"] pub struct INTV_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> INTV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `ENB`"] -pub type ENB_R = crate::R; -#[doc = "Write proxy for field `ENB`"] +#[doc = "Field `ENB` reader - Enable"] +pub struct ENB_R(crate::FieldReader); +impl ENB_R { + pub(crate) fn new(bits: bool) -> Self { + ENB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENB` writer - Enable"] pub struct ENB_W<'a> { w: &'a mut W, } @@ -58,7 +118,7 @@ impl<'a> ENB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -95,4 +155,30 @@ impl W { pub fn enb(&mut self) -> ENB_W { ENB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Power Monitor Control\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 [pwrmon](index.html) module"] +pub struct PWRMON_SPEC; +impl crate::RegisterSpec for PWRMON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pwrmon::R](R) reader structure"] +impl crate::Readable for PWRMON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pwrmon::W](W) writer structure"] +impl crate::Writable for PWRMON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PWRMON to value 0"] +impl crate::Resettable for PWRMON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_power/pwrset.rs b/src/scu_power/pwrset.rs index 3364ac0b..e1d2ccf0 100644 --- a/src/scu_power/pwrset.rs +++ b/src/scu_power/pwrset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PWRSET"] -pub type W = crate::W; -#[doc = "Register PWRSET `reset()`'s with value 0"] -impl crate::ResetValue for super::PWRSET { - type Type = u32; +#[doc = "Register `PWRSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Set Hibernate Domain Enable\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIB`"] +#[doc = "Field `HIB` writer - Set Hibernate Domain Enable"] pub struct HIB_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> HIB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBPHYPDQ`"] +#[doc = "Field `USBPHYPDQ` writer - Set USB PHY Transceiver Disable"] pub struct USBPHYPDQ_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> USBPHYPDQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBPHYPDQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> USBPHYPDQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBPUWQ`"] +#[doc = "Field `USBPUWQ` writer - Set USB Weak Pull-Up at PADN Enable"] pub struct USBPUWQ_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> USBPUWQ_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBPUWQ_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> USBPUWQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -183,4 +188,26 @@ impl W { pub fn usbpuwq(&mut self) -> USBPUWQ_W { USBPUWQ_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PCU Set Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrset](index.html) module"] +pub struct PWRSET_SPEC; +impl crate::RegisterSpec for PWRSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [pwrset::W](W) writer structure"] +impl crate::Writable for PWRSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PWRSET to value 0"] +impl crate::Resettable for PWRSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_power/pwrstat.rs b/src/scu_power/pwrstat.rs index d750a0bb..74cac92f 100644 --- a/src/scu_power/pwrstat.rs +++ b/src/scu_power/pwrstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PWRSTAT"] -pub type R = crate::R; +#[doc = "Register `PWRSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Hibernate Domain Enable Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HIBEN_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBEN`"] -pub type HIBEN_R = crate::R; +#[doc = "Field `HIBEN` reader - Hibernate Domain Enable Status"] +pub struct HIBEN_R(crate::FieldReader); impl HIBEN_R { + pub(crate) fn new(bits: bool) -> Self { + HIBEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBEN_A { @@ -28,12 +44,19 @@ impl HIBEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBEN_A::VALUE1 + **self == HIBEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBEN_A::VALUE2 + **self == HIBEN_A::VALUE2 + } +} +impl core::ops::Deref for HIBEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB PHY Transceiver State\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBPHYPDQ`"] -pub type USBPHYPDQ_R = crate::R; +#[doc = "Field `USBPHYPDQ` reader - USB PHY Transceiver State"] +pub struct USBPHYPDQ_R(crate::FieldReader); impl USBPHYPDQ_R { + pub(crate) fn new(bits: bool) -> Self { + USBPHYPDQ_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBPHYPDQ_A { @@ -64,12 +90,19 @@ impl USBPHYPDQ_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBPHYPDQ_A::VALUE1 + **self == USBPHYPDQ_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBPHYPDQ_A::VALUE2 + **self == USBPHYPDQ_A::VALUE2 + } +} +impl core::ops::Deref for USBPHYPDQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB Weak Pull-Up at PADN State\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBPUWQ`"] -pub type USBPUWQ_R = crate::R; +#[doc = "Field `USBPUWQ` reader - USB Weak Pull-Up at PADN State"] +pub struct USBPUWQ_R(crate::FieldReader); impl USBPUWQ_R { + pub(crate) fn new(bits: bool) -> Self { + USBPUWQ_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBPUWQ_A { @@ -100,12 +136,19 @@ impl USBPUWQ_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBPUWQ_A::VALUE1 + **self == USBPUWQ_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBPUWQ_A::VALUE2 + **self == USBPUWQ_A::VALUE2 + } +} +impl core::ops::Deref for USBPUWQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -125,3 +168,19 @@ impl R { USBPUWQ_R::new(((self.bits >> 18) & 0x01) != 0) } } +#[doc = "PCU Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwrstat](index.html) module"] +pub struct PWRSTAT_SPEC; +impl crate::RegisterSpec for PWRSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pwrstat::R](R) reader structure"] +impl crate::Readable for PWRSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PWRSTAT to value 0"] +impl crate::Resettable for PWRSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_reset.rs b/src/scu_reset.rs index 7afbbfd8..bcb67a35 100644 --- a/src/scu_reset.rs +++ b/src/scu_reset.rs @@ -2,135 +2,75 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - RCU Reset Status"] - pub rststat: RSTSTAT, + pub rststat: crate::Reg, #[doc = "0x04 - RCU Reset Set Register"] - pub rstset: RSTSET, + pub rstset: crate::Reg, #[doc = "0x08 - RCU Reset Clear Register"] - pub rstclr: RSTCLR, + pub rstclr: crate::Reg, #[doc = "0x0c - RCU Peripheral 0 Reset Status"] - pub prstat0: PRSTAT0, + pub prstat0: crate::Reg, #[doc = "0x10 - RCU Peripheral 0 Reset Set"] - pub prset0: PRSET0, + pub prset0: crate::Reg, #[doc = "0x14 - RCU Peripheral 0 Reset Clear"] - pub prclr0: PRCLR0, + pub prclr0: crate::Reg, #[doc = "0x18 - RCU Peripheral 1 Reset Status"] - pub prstat1: PRSTAT1, + pub prstat1: crate::Reg, #[doc = "0x1c - RCU Peripheral 1 Reset Set"] - pub prset1: PRSET1, + pub prset1: crate::Reg, #[doc = "0x20 - RCU Peripheral 1 Reset Clear"] - pub prclr1: PRCLR1, + pub prclr1: crate::Reg, #[doc = "0x24 - RCU Peripheral 2 Reset Status"] - pub prstat2: PRSTAT2, + pub prstat2: crate::Reg, #[doc = "0x28 - RCU Peripheral 2 Reset Set"] - pub prset2: PRSET2, + pub prset2: crate::Reg, #[doc = "0x2c - RCU Peripheral 2 Reset Clear"] - pub prclr2: PRCLR2, + pub prclr2: crate::Reg, } -#[doc = "RCU Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rststat](rststat) module"] -pub type RSTSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RSTSTAT; -#[doc = "`read()` method returns [rststat::R](rststat::R) reader structure"] -impl crate::Readable for RSTSTAT {} +#[doc = "RSTSTAT register accessor: an alias for `Reg`"] +pub type RSTSTAT = crate::Reg; #[doc = "RCU Reset Status"] pub mod rststat; -#[doc = "RCU Reset Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rstset](rstset) module"] -pub type RSTSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RSTSET; -#[doc = "`write(|w| ..)` method takes [rstset::W](rstset::W) writer structure"] -impl crate::Writable for RSTSET {} +#[doc = "RSTSET register accessor: an alias for `Reg`"] +pub type RSTSET = crate::Reg; #[doc = "RCU Reset Set Register"] pub mod rstset; -#[doc = "RCU Reset Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rstclr](rstclr) module"] -pub type RSTCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RSTCLR; -#[doc = "`write(|w| ..)` method takes [rstclr::W](rstclr::W) writer structure"] -impl crate::Writable for RSTCLR {} +#[doc = "RSTCLR register accessor: an alias for `Reg`"] +pub type RSTCLR = crate::Reg; #[doc = "RCU Reset Clear Register"] pub mod rstclr; -#[doc = "RCU Peripheral 0 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat0](prstat0) module"] -pub type PRSTAT0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSTAT0; -#[doc = "`read()` method returns [prstat0::R](prstat0::R) reader structure"] -impl crate::Readable for PRSTAT0 {} +#[doc = "PRSTAT0 register accessor: an alias for `Reg`"] +pub type PRSTAT0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Status"] pub mod prstat0; -#[doc = "RCU Peripheral 0 Reset Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset0](prset0) module"] -pub type PRSET0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSET0; -#[doc = "`write(|w| ..)` method takes [prset0::W](prset0::W) writer structure"] -impl crate::Writable for PRSET0 {} +#[doc = "PRSET0 register accessor: an alias for `Reg`"] +pub type PRSET0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Set"] pub mod prset0; -#[doc = "RCU Peripheral 0 Reset Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr0](prclr0) module"] -pub type PRCLR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRCLR0; -#[doc = "`write(|w| ..)` method takes [prclr0::W](prclr0::W) writer structure"] -impl crate::Writable for PRCLR0 {} +#[doc = "PRCLR0 register accessor: an alias for `Reg`"] +pub type PRCLR0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Clear"] pub mod prclr0; -#[doc = "RCU Peripheral 1 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat1](prstat1) module"] -pub type PRSTAT1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSTAT1; -#[doc = "`read()` method returns [prstat1::R](prstat1::R) reader structure"] -impl crate::Readable for PRSTAT1 {} +#[doc = "PRSTAT1 register accessor: an alias for `Reg`"] +pub type PRSTAT1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Status"] pub mod prstat1; -#[doc = "RCU Peripheral 1 Reset Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset1](prset1) module"] -pub type PRSET1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSET1; -#[doc = "`write(|w| ..)` method takes [prset1::W](prset1::W) writer structure"] -impl crate::Writable for PRSET1 {} +#[doc = "PRSET1 register accessor: an alias for `Reg`"] +pub type PRSET1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Set"] pub mod prset1; -#[doc = "RCU Peripheral 1 Reset Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr1](prclr1) module"] -pub type PRCLR1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRCLR1; -#[doc = "`write(|w| ..)` method takes [prclr1::W](prclr1::W) writer structure"] -impl crate::Writable for PRCLR1 {} +#[doc = "PRCLR1 register accessor: an alias for `Reg`"] +pub type PRCLR1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Clear"] pub mod prclr1; -#[doc = "RCU Peripheral 2 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat2](prstat2) module"] -pub type PRSTAT2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSTAT2; -#[doc = "`read()` method returns [prstat2::R](prstat2::R) reader structure"] -impl crate::Readable for PRSTAT2 {} +#[doc = "PRSTAT2 register accessor: an alias for `Reg`"] +pub type PRSTAT2 = crate::Reg; #[doc = "RCU Peripheral 2 Reset Status"] pub mod prstat2; -#[doc = "RCU Peripheral 2 Reset Set\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset2](prset2) module"] -pub type PRSET2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRSET2; -#[doc = "`write(|w| ..)` method takes [prset2::W](prset2::W) writer structure"] -impl crate::Writable for PRSET2 {} +#[doc = "PRSET2 register accessor: an alias for `Reg`"] +pub type PRSET2 = crate::Reg; #[doc = "RCU Peripheral 2 Reset Set"] pub mod prset2; -#[doc = "RCU Peripheral 2 Reset Clear\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr2](prclr2) module"] -pub type PRCLR2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PRCLR2; -#[doc = "`write(|w| ..)` method takes [prclr2::W](prclr2::W) writer structure"] -impl crate::Writable for PRCLR2 {} +#[doc = "PRCLR2 register accessor: an alias for `Reg`"] +pub type PRCLR2 = crate::Reg; #[doc = "RCU Peripheral 2 Reset Clear"] pub mod prclr2; diff --git a/src/scu_reset/prclr0.rs b/src/scu_reset/prclr0.rs index acddfa87..bc293a6e 100644 --- a/src/scu_reset/prclr0.rs +++ b/src/scu_reset/prclr0.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRCLR0"] -pub type W = crate::W; -#[doc = "Register PRCLR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRCLR0 { - type Type = u32; +#[doc = "Register `PRCLR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VADC Reset Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VADCRS`"] +#[doc = "Field `VADCRS` writer - VADC Reset Clear"] pub struct VADCRS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VADCRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VADCRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VADCRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU40RS`"] +#[doc = "Field `CCU40RS` writer - CCU40 Reset Clear"] pub struct CCU40RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCU40RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU40RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCU40RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU41RS`"] +#[doc = "Field `CCU41RS` writer - CCU41 Reset Clear"] pub struct CCU41RS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CCU41RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU41RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CCU41RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU80RS`"] +#[doc = "Field `CCU80RS` writer - CCU80 Reset Clear"] pub struct CCU80RS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CCU80RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU80RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CCU80RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POSIF0RS`"] +#[doc = "Field `POSIF0RS` writer - POSIF0 Reset Clear"] pub struct POSIF0RS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> POSIF0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSIF0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> POSIF0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC0RS`"] +#[doc = "Field `USIC0RS` writer - USIC0 Reset Clear"] pub struct USIC0RS_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> USIC0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> USIC0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ERU1RS`"] +#[doc = "Field `ERU1RS` writer - ERU1 Reset Clear"] pub struct ERU1RS_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> ERU1RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU1RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> ERU1RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HRPWM0RS`"] +#[doc = "Field `HRPWM0RS` writer - HRPWM0 Reset Clear"] pub struct HRPWM0RS_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> HRPWM0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRPWM0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> HRPWM0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W { HRPWM0RS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 0 Reset Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr0](index.html) module"] +pub struct PRCLR0_SPEC; +impl crate::RegisterSpec for PRCLR0_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prclr0::W](W) writer structure"] +impl crate::Writable for PRCLR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRCLR0 to value 0"] +impl crate::Resettable for PRCLR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prclr1.rs b/src/scu_reset/prclr1.rs index 2c24b060..0e62308f 100644 --- a/src/scu_reset/prclr1.rs +++ b/src/scu_reset/prclr1.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRCLR1"] -pub type W = crate::W; -#[doc = "Register PRCLR1 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRCLR1 { - type Type = u32; +#[doc = "Register `PRCLR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "LEDTS Reset Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LEDTSCU0RS`"] +#[doc = "Field `LEDTSCU0RS` writer - LEDTS Reset Clear"] pub struct LEDTSCU0RS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> LEDTSCU0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LEDTSCU0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> LEDTSCU0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `MCAN0RS`"] +#[doc = "Field `MCAN0RS` writer - MultiCAN Reset Clear"] pub struct MCAN0RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> MCAN0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCAN0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> MCAN0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DACRS`"] +#[doc = "Field `DACRS` writer - DAC Reset Clear"] pub struct DACRS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> DACRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DACRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> DACRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC1RS`"] +#[doc = "Field `USIC1RS` writer - USIC1 Reset Clear"] pub struct USIC1RS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USIC1RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC1RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USIC1RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PPORTSRS`"] +#[doc = "Field `PPORTSRS` writer - PORTS Reset Clear"] pub struct PPORTSRS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> PPORTSRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPORTSRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> PPORTSRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -299,4 +300,26 @@ impl W { pub fn pportsrs(&mut self) -> PPORTSRS_W { PPORTSRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 1 Reset Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr1](index.html) module"] +pub struct PRCLR1_SPEC; +impl crate::RegisterSpec for PRCLR1_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prclr1::W](W) writer structure"] +impl crate::Writable for PRCLR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRCLR1 to value 0"] +impl crate::Resettable for PRCLR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prclr2.rs b/src/scu_reset/prclr2.rs index d904e668..94e61827 100644 --- a/src/scu_reset/prclr2.rs +++ b/src/scu_reset/prclr2.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRCLR2"] -pub type W = crate::W; -#[doc = "Register PRCLR2 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRCLR2 { - type Type = u32; +#[doc = "Register `PRCLR2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT Reset Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDTRS`"] +#[doc = "Field `WDTRS` writer - WDT Reset Clear"] pub struct WDTRS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> WDTRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> WDTRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DMA0RS`"] +#[doc = "Field `DMA0RS` writer - DMA0 Reset Clear"] pub struct DMA0RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> DMA0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMA0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> DMA0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FCERS`"] +#[doc = "Field `FCERS` writer - FCE Reset Clear"] pub struct FCERS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FCERS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCERS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FCERS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBRS`"] +#[doc = "Field `USBRS` writer - USB Reset Clear"] pub struct USBRS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USBRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USBRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn usbrs(&mut self) -> USBRS_W { USBRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 2 Reset Clear\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prclr2](index.html) module"] +pub struct PRCLR2_SPEC; +impl crate::RegisterSpec for PRCLR2_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prclr2::W](W) writer structure"] +impl crate::Writable for PRCLR2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRCLR2 to value 0"] +impl crate::Resettable for PRCLR2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prset0.rs b/src/scu_reset/prset0.rs index 244c4bd8..51302633 100644 --- a/src/scu_reset/prset0.rs +++ b/src/scu_reset/prset0.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRSET0"] -pub type W = crate::W; -#[doc = "Register PRSET0 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRSET0 { - type Type = u32; +#[doc = "Register `PRSET0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "VADC Reset Assert\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `VADCRS`"] +#[doc = "Field `VADCRS` writer - VADC Reset Assert"] pub struct VADCRS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> VADCRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VADCRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> VADCRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU40RS`"] +#[doc = "Field `CCU40RS` writer - CCU40 Reset Assert"] pub struct CCU40RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CCU40RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU40RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CCU40RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU41RS`"] +#[doc = "Field `CCU41RS` writer - CCU41 Reset Assert"] pub struct CCU41RS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CCU41RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU41RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CCU41RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CCU80RS`"] +#[doc = "Field `CCU80RS` writer - CCU80 Reset Assert"] pub struct CCU80RS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CCU80RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CCU80RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CCU80RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `POSIF0RS`"] +#[doc = "Field `POSIF0RS` writer - POSIF0 Reset Assert"] pub struct POSIF0RS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> POSIF0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: POSIF0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> POSIF0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC0RS`"] +#[doc = "Field `USIC0RS` writer - USIC0 Reset Assert"] pub struct USIC0RS_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> USIC0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> USIC0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ERU1RS`"] +#[doc = "Field `ERU1RS` writer - ERU1 Reset Assert"] pub struct ERU1RS_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> ERU1RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERU1RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> ERU1RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HRPWM0RS`"] +#[doc = "Field `HRPWM0RS` writer - HRPWM0 Reset Assert"] pub struct HRPWM0RS_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> HRPWM0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HRPWM0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> HRPWM0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W { HRPWM0RS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 0 Reset Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset0](index.html) module"] +pub struct PRSET0_SPEC; +impl crate::RegisterSpec for PRSET0_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prset0::W](W) writer structure"] +impl crate::Writable for PRSET0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRSET0 to value 0"] +impl crate::Resettable for PRSET0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prset1.rs b/src/scu_reset/prset1.rs index 5ff029a9..f86648ec 100644 --- a/src/scu_reset/prset1.rs +++ b/src/scu_reset/prset1.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRSET1"] -pub type W = crate::W; -#[doc = "Register PRSET1 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRSET1 { - type Type = u32; +#[doc = "Register `PRSET1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "LEDTS Reset Assert\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LEDTSCU0RS`"] +#[doc = "Field `LEDTSCU0RS` writer - LEDTS Reset Assert"] pub struct LEDTSCU0RS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> LEDTSCU0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LEDTSCU0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> LEDTSCU0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `MCAN0RS`"] +#[doc = "Field `MCAN0RS` writer - MultiCAN Reset Assert"] pub struct MCAN0RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> MCAN0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCAN0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> MCAN0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DACRS`"] +#[doc = "Field `DACRS` writer - DAC Reset Assert"] pub struct DACRS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> DACRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DACRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> DACRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USIC1RS`"] +#[doc = "Field `USIC1RS` writer - USIC1 Reset Assert"] pub struct USIC1RS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USIC1RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USIC1RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USIC1RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PPORTSRS`"] +#[doc = "Field `PPORTSRS` writer - PORTS Reset Assert"] pub struct PPORTSRS_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> PPORTSRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPORTSRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> PPORTSRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -299,4 +300,26 @@ impl W { pub fn pportsrs(&mut self) -> PPORTSRS_W { PPORTSRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 1 Reset Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset1](index.html) module"] +pub struct PRSET1_SPEC; +impl crate::RegisterSpec for PRSET1_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prset1::W](W) writer structure"] +impl crate::Writable for PRSET1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRSET1 to value 0"] +impl crate::Resettable for PRSET1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prset2.rs b/src/scu_reset/prset2.rs index c4969f73..8286e378 100644 --- a/src/scu_reset/prset2.rs +++ b/src/scu_reset/prset2.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PRSET2"] -pub type W = crate::W; -#[doc = "Register PRSET2 `reset()`'s with value 0"] -impl crate::ResetValue for super::PRSET2 { - type Type = u32; +#[doc = "Register `PRSET2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WDT Reset Assert\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `WDTRS`"] +#[doc = "Field `WDTRS` writer - WDT Reset Assert"] pub struct WDTRS_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> WDTRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WDTRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> WDTRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DMA0RS`"] +#[doc = "Field `DMA0RS` writer - DMA0 Reset Assert"] pub struct DMA0RS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> DMA0RS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMA0RS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> DMA0RS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FCERS`"] +#[doc = "Field `FCERS` writer - FCE Reset Assert"] pub struct FCERS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> FCERS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FCERS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> FCERS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `USBRS`"] +#[doc = "Field `USBRS` writer - USB Reset Assert"] pub struct USBRS_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> USBRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: USBRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> USBRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn usbrs(&mut self) -> USBRS_W { USBRS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Peripheral 2 Reset Set\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset2](index.html) module"] +pub struct PRSET2_SPEC; +impl crate::RegisterSpec for PRSET2_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [prset2::W](W) writer structure"] +impl crate::Writable for PRSET2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRSET2 to value 0"] +impl crate::Resettable for PRSET2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/prstat0.rs b/src/scu_reset/prstat0.rs index 9f7e111a..993dae9a 100644 --- a/src/scu_reset/prstat0.rs +++ b/src/scu_reset/prstat0.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PRSTAT0"] -pub type R = crate::R; +#[doc = "Register `PRSTAT0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "VADC Reset Status\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum VADCRS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VADCRS`"] -pub type VADCRS_R = crate::R; +#[doc = "Field `VADCRS` reader - VADC Reset Status"] +pub struct VADCRS_R(crate::FieldReader); impl VADCRS_R { + pub(crate) fn new(bits: bool) -> Self { + VADCRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VADCRS_A { @@ -28,12 +44,19 @@ impl VADCRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VADCRS_A::VALUE1 + **self == VADCRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VADCRS_A::VALUE2 + **self == VADCRS_A::VALUE2 + } +} +impl core::ops::Deref for VADCRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU40 Reset Status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU40RS`"] -pub type CCU40RS_R = crate::R; +#[doc = "Field `CCU40RS` reader - CCU40 Reset Status"] +pub struct CCU40RS_R(crate::FieldReader); impl CCU40RS_R { + pub(crate) fn new(bits: bool) -> Self { + CCU40RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU40RS_A { @@ -64,12 +90,19 @@ impl CCU40RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU40RS_A::VALUE1 + **self == CCU40RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU40RS_A::VALUE2 + **self == CCU40RS_A::VALUE2 + } +} +impl core::ops::Deref for CCU40RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU41 Reset Status\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU41RS`"] -pub type CCU41RS_R = crate::R; +#[doc = "Field `CCU41RS` reader - CCU41 Reset Status"] +pub struct CCU41RS_R(crate::FieldReader); impl CCU41RS_R { + pub(crate) fn new(bits: bool) -> Self { + CCU41RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU41RS_A { @@ -100,12 +136,19 @@ impl CCU41RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU41RS_A::VALUE1 + **self == CCU41RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU41RS_A::VALUE2 + **self == CCU41RS_A::VALUE2 + } +} +impl core::ops::Deref for CCU41RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "CCU80 Reset Status\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CCU80RS`"] -pub type CCU80RS_R = crate::R; +#[doc = "Field `CCU80RS` reader - CCU80 Reset Status"] +pub struct CCU80RS_R(crate::FieldReader); impl CCU80RS_R { + pub(crate) fn new(bits: bool) -> Self { + CCU80RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CCU80RS_A { @@ -136,12 +182,19 @@ impl CCU80RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CCU80RS_A::VALUE1 + **self == CCU80RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CCU80RS_A::VALUE2 + **self == CCU80RS_A::VALUE2 + } +} +impl core::ops::Deref for CCU80RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "POSIF0 Reset Status\n\nValue on reset: 1"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `POSIF0RS`"] -pub type POSIF0RS_R = crate::R; +#[doc = "Field `POSIF0RS` reader - POSIF0 Reset Status"] +pub struct POSIF0RS_R(crate::FieldReader); impl POSIF0RS_R { + pub(crate) fn new(bits: bool) -> Self { + POSIF0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POSIF0RS_A { @@ -172,12 +228,19 @@ impl POSIF0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == POSIF0RS_A::VALUE1 + **self == POSIF0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == POSIF0RS_A::VALUE2 + **self == POSIF0RS_A::VALUE2 + } +} +impl core::ops::Deref for POSIF0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USIC0 Reset Status\n\nValue on reset: 1"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC0RS`"] -pub type USIC0RS_R = crate::R; +#[doc = "Field `USIC0RS` reader - USIC0 Reset Status"] +pub struct USIC0RS_R(crate::FieldReader); impl USIC0RS_R { + pub(crate) fn new(bits: bool) -> Self { + USIC0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC0RS_A { @@ -208,12 +274,19 @@ impl USIC0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC0RS_A::VALUE1 + **self == USIC0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC0RS_A::VALUE2 + **self == USIC0RS_A::VALUE2 + } +} +impl core::ops::Deref for USIC0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "ERU1 Reset Status\n\nValue on reset: 1"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERU1RS`"] -pub type ERU1RS_R = crate::R; +#[doc = "Field `ERU1RS` reader - ERU1 Reset Status"] +pub struct ERU1RS_R(crate::FieldReader); impl ERU1RS_R { + pub(crate) fn new(bits: bool) -> Self { + ERU1RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERU1RS_A { @@ -244,12 +320,19 @@ impl ERU1RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERU1RS_A::VALUE1 + **self == ERU1RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERU1RS_A::VALUE2 + **self == ERU1RS_A::VALUE2 + } +} +impl core::ops::Deref for ERU1RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "HRPWM0 Reset Status\n\nValue on reset: 1"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HRPWM0RS`"] -pub type HRPWM0RS_R = crate::R; +#[doc = "Field `HRPWM0RS` reader - HRPWM0 Reset Status"] +pub struct HRPWM0RS_R(crate::FieldReader); impl HRPWM0RS_R { + pub(crate) fn new(bits: bool) -> Self { + HRPWM0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HRPWM0RS_A { @@ -280,12 +366,19 @@ impl HRPWM0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HRPWM0RS_A::VALUE1 + **self == HRPWM0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HRPWM0RS_A::VALUE2 + **self == HRPWM0RS_A::VALUE2 + } +} +impl core::ops::Deref for HRPWM0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -330,3 +423,19 @@ impl R { HRPWM0RS_R::new(((self.bits >> 23) & 0x01) != 0) } } +#[doc = "RCU Peripheral 0 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat0](index.html) module"] +pub struct PRSTAT0_SPEC; +impl crate::RegisterSpec for PRSTAT0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prstat0::R](R) reader structure"] +impl crate::Readable for PRSTAT0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PRSTAT0 to value 0x0081_0a8d"] +impl crate::Resettable for PRSTAT0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0081_0a8d + } +} diff --git a/src/scu_reset/prstat1.rs b/src/scu_reset/prstat1.rs index 711d6b22..9dda132b 100644 --- a/src/scu_reset/prstat1.rs +++ b/src/scu_reset/prstat1.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PRSTAT1"] -pub type R = crate::R; +#[doc = "Register `PRSTAT1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "LEDTS Reset Status\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LEDTSCU0RS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LEDTSCU0RS`"] -pub type LEDTSCU0RS_R = crate::R; +#[doc = "Field `LEDTSCU0RS` reader - LEDTS Reset Status"] +pub struct LEDTSCU0RS_R(crate::FieldReader); impl LEDTSCU0RS_R { + pub(crate) fn new(bits: bool) -> Self { + LEDTSCU0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LEDTSCU0RS_A { @@ -28,12 +44,19 @@ impl LEDTSCU0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LEDTSCU0RS_A::VALUE1 + **self == LEDTSCU0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LEDTSCU0RS_A::VALUE2 + **self == LEDTSCU0RS_A::VALUE2 + } +} +impl core::ops::Deref for LEDTSCU0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "MultiCAN Reset Status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCAN0RS`"] -pub type MCAN0RS_R = crate::R; +#[doc = "Field `MCAN0RS` reader - MultiCAN Reset Status"] +pub struct MCAN0RS_R(crate::FieldReader); impl MCAN0RS_R { + pub(crate) fn new(bits: bool) -> Self { + MCAN0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCAN0RS_A { @@ -64,12 +90,19 @@ impl MCAN0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCAN0RS_A::VALUE1 + **self == MCAN0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCAN0RS_A::VALUE2 + **self == MCAN0RS_A::VALUE2 + } +} +impl core::ops::Deref for MCAN0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DAC Reset Status\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DACRS`"] -pub type DACRS_R = crate::R; +#[doc = "Field `DACRS` reader - DAC Reset Status"] +pub struct DACRS_R(crate::FieldReader); impl DACRS_R { + pub(crate) fn new(bits: bool) -> Self { + DACRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DACRS_A { @@ -100,12 +136,19 @@ impl DACRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DACRS_A::VALUE1 + **self == DACRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DACRS_A::VALUE2 + **self == DACRS_A::VALUE2 + } +} +impl core::ops::Deref for DACRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USIC1 Reset Status\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USIC1RS`"] -pub type USIC1RS_R = crate::R; +#[doc = "Field `USIC1RS` reader - USIC1 Reset Status"] +pub struct USIC1RS_R(crate::FieldReader); impl USIC1RS_R { + pub(crate) fn new(bits: bool) -> Self { + USIC1RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USIC1RS_A { @@ -136,12 +182,19 @@ impl USIC1RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USIC1RS_A::VALUE1 + **self == USIC1RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USIC1RS_A::VALUE2 + **self == USIC1RS_A::VALUE2 + } +} +impl core::ops::Deref for USIC1RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "PORTS Reset Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPORTSRS`"] -pub type PPORTSRS_R = crate::R; +#[doc = "Field `PPORTSRS` reader - PORTS Reset Status"] +pub struct PPORTSRS_R(crate::FieldReader); impl PPORTSRS_R { + pub(crate) fn new(bits: bool) -> Self { + PPORTSRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPORTSRS_A { @@ -172,12 +228,19 @@ impl PPORTSRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPORTSRS_A::VALUE1 + **self == PPORTSRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPORTSRS_A::VALUE2 + **self == PPORTSRS_A::VALUE2 + } +} +impl core::ops::Deref for PPORTSRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -207,3 +270,19 @@ impl R { PPORTSRS_R::new(((self.bits >> 9) & 0x01) != 0) } } +#[doc = "RCU Peripheral 1 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat1](index.html) module"] +pub struct PRSTAT1_SPEC; +impl crate::RegisterSpec for PRSTAT1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prstat1::R](R) reader structure"] +impl crate::Readable for PRSTAT1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PRSTAT1 to value 0xb8"] +impl crate::Resettable for PRSTAT1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xb8 + } +} diff --git a/src/scu_reset/prstat2.rs b/src/scu_reset/prstat2.rs index 2f74dc2c..412bf6b6 100644 --- a/src/scu_reset/prstat2.rs +++ b/src/scu_reset/prstat2.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register PRSTAT2"] -pub type R = crate::R; +#[doc = "Register `PRSTAT2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "WDT Reset Status\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WDTRS_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WDTRS`"] -pub type WDTRS_R = crate::R; +#[doc = "Field `WDTRS` reader - WDT Reset Status"] +pub struct WDTRS_R(crate::FieldReader); impl WDTRS_R { + pub(crate) fn new(bits: bool) -> Self { + WDTRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDTRS_A { @@ -28,12 +44,19 @@ impl WDTRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WDTRS_A::VALUE1 + **self == WDTRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WDTRS_A::VALUE2 + **self == WDTRS_A::VALUE2 + } +} +impl core::ops::Deref for WDTRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "DMA0 Reset Status\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DMA0RS`"] -pub type DMA0RS_R = crate::R; +#[doc = "Field `DMA0RS` reader - DMA0 Reset Status"] +pub struct DMA0RS_R(crate::FieldReader); impl DMA0RS_R { + pub(crate) fn new(bits: bool) -> Self { + DMA0RS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DMA0RS_A { @@ -64,12 +90,19 @@ impl DMA0RS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DMA0RS_A::VALUE1 + **self == DMA0RS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DMA0RS_A::VALUE2 + **self == DMA0RS_A::VALUE2 + } +} +impl core::ops::Deref for DMA0RS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "FCE Reset Status\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCERS`"] -pub type FCERS_R = crate::R; +#[doc = "Field `FCERS` reader - FCE Reset Status"] +pub struct FCERS_R(crate::FieldReader); impl FCERS_R { + pub(crate) fn new(bits: bool) -> Self { + FCERS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCERS_A { @@ -100,12 +136,19 @@ impl FCERS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCERS_A::VALUE1 + **self == FCERS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCERS_A::VALUE2 + **self == FCERS_A::VALUE2 + } +} +impl core::ops::Deref for FCERS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB Reset Status\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `USBRS`"] -pub type USBRS_R = crate::R; +#[doc = "Field `USBRS` reader - USB Reset Status"] +pub struct USBRS_R(crate::FieldReader); impl USBRS_R { + pub(crate) fn new(bits: bool) -> Self { + USBRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> USBRS_A { @@ -136,12 +182,19 @@ impl USBRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == USBRS_A::VALUE1 + **self == USBRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == USBRS_A::VALUE2 + **self == USBRS_A::VALUE2 + } +} +impl core::ops::Deref for USBRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -166,3 +219,19 @@ impl R { USBRS_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "RCU Peripheral 2 Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstat2](index.html) module"] +pub struct PRSTAT2_SPEC; +impl crate::RegisterSpec for PRSTAT2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prstat2::R](R) reader structure"] +impl crate::Readable for PRSTAT2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PRSTAT2 to value 0xd2"] +impl crate::Resettable for PRSTAT2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xd2 + } +} diff --git a/src/scu_reset/rstclr.rs b/src/scu_reset/rstclr.rs index b8eba8a7..0473a66d 100644 --- a/src/scu_reset/rstclr.rs +++ b/src/scu_reset/rstclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register RSTCLR"] -pub type W = crate::W; -#[doc = "Register RSTCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::RSTCLR { - type Type = u32; +#[doc = "Register `RSTCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Reset Status\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RSCLR`"] +#[doc = "Field `RSCLR` writer - Clear Reset Status"] pub struct RSCLR_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> RSCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> RSCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBWK`"] +#[doc = "Field `HIBWK` writer - Clear Hibernate Wake-up Reset Status"] pub struct HIBWK_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> HIBWK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBWK_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> HIBWK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBRS`"] +#[doc = "Field `HIBRS` writer - Clear Hibernate Reset"] pub struct HIBRS_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> HIBRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> HIBRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LCKEN`"] +#[doc = "Field `LCKEN` writer - Enable Lockup Reset"] pub struct LCKEN_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> LCKEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LCKEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> LCKEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -241,4 +244,26 @@ impl W { pub fn lcken(&mut self) -> LCKEN_W { LCKEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Reset Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rstclr](index.html) module"] +pub struct RSTCLR_SPEC; +impl crate::RegisterSpec for RSTCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [rstclr::W](W) writer structure"] +impl crate::Writable for RSTCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RSTCLR to value 0"] +impl crate::Resettable for RSTCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/rstset.rs b/src/scu_reset/rstset.rs index 984ae508..42888873 100644 --- a/src/scu_reset/rstset.rs +++ b/src/scu_reset/rstset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register RSTSET"] -pub type W = crate::W; -#[doc = "Register RSTSET `reset()`'s with value 0"] -impl crate::ResetValue for super::RSTSET { - type Type = u32; +#[doc = "Register `RSTSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Set Hibernate Wake-up Reset Status\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBWK`"] +#[doc = "Field `HIBWK` writer - Set Hibernate Wake-up Reset Status"] pub struct HIBWK_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> HIBWK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBWK_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> HIBWK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `HIBRS`"] +#[doc = "Field `HIBRS` writer - Set Hibernate Reset"] pub struct HIBRS_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> HIBRS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIBRS_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> HIBRS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LCKEN`"] +#[doc = "Field `LCKEN` writer - Enable Lockup Reset"] pub struct LCKEN_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> LCKEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LCKEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> LCKEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -183,4 +188,26 @@ impl W { pub fn lcken(&mut self) -> LCKEN_W { LCKEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RCU Reset Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rstset](index.html) module"] +pub struct RSTSET_SPEC; +impl crate::RegisterSpec for RSTSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [rstset::W](W) writer structure"] +impl crate::Writable for RSTSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RSTSET to value 0"] +impl crate::Resettable for RSTSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_reset/rststat.rs b/src/scu_reset/rststat.rs index 52548378..b7dbcd28 100644 --- a/src/scu_reset/rststat.rs +++ b/src/scu_reset/rststat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register RSTSTAT"] -pub type R = crate::R; +#[doc = "Register `RSTSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Reset Status Information\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -25,58 +38,67 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `RSTSTAT`"] -pub type RSTSTAT_R = crate::R; +#[doc = "Field `RSTSTAT` reader - Reset Status Information"] +pub struct RSTSTAT_R(crate::FieldReader); impl RSTSTAT_R { + pub(crate) fn new(bits: u8) -> Self { + RSTSTAT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(RSTSTAT_A::VALUE1), - 2 => Val(RSTSTAT_A::VALUE2), - 4 => Val(RSTSTAT_A::VALUE3), - 8 => Val(RSTSTAT_A::VALUE4), - 16 => Val(RSTSTAT_A::VALUE5), - 32 => Val(RSTSTAT_A::VALUE6), - 128 => Val(RSTSTAT_A::VALUE8), - i => Res(i), + 1 => Some(RSTSTAT_A::VALUE1), + 2 => Some(RSTSTAT_A::VALUE2), + 4 => Some(RSTSTAT_A::VALUE3), + 8 => Some(RSTSTAT_A::VALUE4), + 16 => Some(RSTSTAT_A::VALUE5), + 32 => Some(RSTSTAT_A::VALUE6), + 128 => Some(RSTSTAT_A::VALUE8), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSTSTAT_A::VALUE1 + **self == RSTSTAT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSTSTAT_A::VALUE2 + **self == RSTSTAT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == RSTSTAT_A::VALUE3 + **self == RSTSTAT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == RSTSTAT_A::VALUE4 + **self == RSTSTAT_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == RSTSTAT_A::VALUE5 + **self == RSTSTAT_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == RSTSTAT_A::VALUE6 + **self == RSTSTAT_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == RSTSTAT_A::VALUE8 + **self == RSTSTAT_A::VALUE8 + } +} +impl core::ops::Deref for RSTSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Hibernate Wake-up Status\n\nValue on reset: 0"] @@ -93,9 +115,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBWK`"] -pub type HIBWK_R = crate::R; +#[doc = "Field `HIBWK` reader - Hibernate Wake-up Status"] +pub struct HIBWK_R(crate::FieldReader); impl HIBWK_R { + pub(crate) fn new(bits: bool) -> Self { + HIBWK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBWK_A { @@ -107,12 +132,19 @@ impl HIBWK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBWK_A::VALUE1 + **self == HIBWK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBWK_A::VALUE2 + **self == HIBWK_A::VALUE2 + } +} +impl core::ops::Deref for HIBWK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Hibernate Reset Status\n\nValue on reset: 0"] @@ -129,9 +161,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HIBRS`"] -pub type HIBRS_R = crate::R; +#[doc = "Field `HIBRS` reader - Hibernate Reset Status"] +pub struct HIBRS_R(crate::FieldReader); impl HIBRS_R { + pub(crate) fn new(bits: bool) -> Self { + HIBRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HIBRS_A { @@ -143,12 +178,19 @@ impl HIBRS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HIBRS_A::VALUE1 + **self == HIBRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HIBRS_A::VALUE2 + **self == HIBRS_A::VALUE2 + } +} +impl core::ops::Deref for HIBRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Enable Lockup Status\n\nValue on reset: 0"] @@ -165,9 +207,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LCKEN`"] -pub type LCKEN_R = crate::R; +#[doc = "Field `LCKEN` reader - Enable Lockup Status"] +pub struct LCKEN_R(crate::FieldReader); impl LCKEN_R { + pub(crate) fn new(bits: bool) -> Self { + LCKEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LCKEN_A { @@ -179,12 +224,19 @@ impl LCKEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LCKEN_A::VALUE1 + **self == LCKEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LCKEN_A::VALUE2 + **self == LCKEN_A::VALUE2 + } +} +impl core::ops::Deref for LCKEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -209,3 +261,19 @@ impl R { LCKEN_R::new(((self.bits >> 10) & 0x01) != 0) } } +#[doc = "RCU Reset Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rststat](index.html) module"] +pub struct RSTSTAT_SPEC; +impl crate::RegisterSpec for RSTSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rststat::R](R) reader structure"] +impl crate::Readable for RSTSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RSTSTAT to value 0"] +impl crate::Resettable for RSTSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_trap.rs b/src/scu_trap.rs index 4bb08fab..891b59dd 100644 --- a/src/scu_trap.rs +++ b/src/scu_trap.rs @@ -2,60 +2,33 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Trap Status Register"] - pub trapstat: TRAPSTAT, + pub trapstat: crate::Reg, #[doc = "0x04 - Trap Raw Status Register"] - pub trapraw: TRAPRAW, + pub trapraw: crate::Reg, #[doc = "0x08 - Trap Disable Register"] - pub trapdis: TRAPDIS, + pub trapdis: crate::Reg, #[doc = "0x0c - Trap Clear Register"] - pub trapclr: TRAPCLR, + pub trapclr: crate::Reg, #[doc = "0x10 - Trap Set Register"] - pub trapset: TRAPSET, + pub trapset: crate::Reg, } -#[doc = "Trap Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapstat](trapstat) module"] -pub type TRAPSTAT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRAPSTAT; -#[doc = "`read()` method returns [trapstat::R](trapstat::R) reader structure"] -impl crate::Readable for TRAPSTAT {} +#[doc = "TRAPSTAT register accessor: an alias for `Reg`"] +pub type TRAPSTAT = crate::Reg; #[doc = "Trap Status Register"] pub mod trapstat; -#[doc = "Trap Raw Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapraw](trapraw) module"] -pub type TRAPRAW = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRAPRAW; -#[doc = "`read()` method returns [trapraw::R](trapraw::R) reader structure"] -impl crate::Readable for TRAPRAW {} +#[doc = "TRAPRAW register accessor: an alias for `Reg`"] +pub type TRAPRAW = crate::Reg; #[doc = "Trap Raw Status Register"] pub mod trapraw; -#[doc = "Trap Disable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapdis](trapdis) module"] -pub type TRAPDIS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRAPDIS; -#[doc = "`read()` method returns [trapdis::R](trapdis::R) reader structure"] -impl crate::Readable for TRAPDIS {} -#[doc = "`write(|w| ..)` method takes [trapdis::W](trapdis::W) writer structure"] -impl crate::Writable for TRAPDIS {} +#[doc = "TRAPDIS register accessor: an alias for `Reg`"] +pub type TRAPDIS = crate::Reg; #[doc = "Trap Disable Register"] pub mod trapdis; -#[doc = "Trap Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapclr](trapclr) module"] -pub type TRAPCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRAPCLR; -#[doc = "`write(|w| ..)` method takes [trapclr::W](trapclr::W) writer structure"] -impl crate::Writable for TRAPCLR {} +#[doc = "TRAPCLR register accessor: an alias for `Reg`"] +pub type TRAPCLR = crate::Reg; #[doc = "Trap Clear Register"] pub mod trapclr; -#[doc = "Trap Set Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapset](trapset) module"] -pub type TRAPSET = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRAPSET; -#[doc = "`write(|w| ..)` method takes [trapset::W](trapset::W) writer structure"] -impl crate::Writable for TRAPSET {} +#[doc = "TRAPSET register accessor: an alias for `Reg`"] +pub type TRAPSET = crate::Reg; #[doc = "Trap Set Register"] pub mod trapset; diff --git a/src/scu_trap/trapclr.rs b/src/scu_trap/trapclr.rs index 0bbf4df9..fc0be440 100644 --- a/src/scu_trap/trapclr.rs +++ b/src/scu_trap/trapclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register TRAPCLR"] -pub type W = crate::W; -#[doc = "Register TRAPCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::TRAPCLR { - type Type = u32; +#[doc = "Register `TRAPCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System OSC WDT Trap Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SOSCWDGT`"] +#[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Clear"] pub struct SOSCWDGT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SOSCWDGT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SVCOLCKT`"] +#[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Clear"] pub struct SVCOLCKT_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SVCOLCKT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `UVCOLCKT`"] +#[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Clear"] pub struct UVCOLCKT_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UVCOLCKT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PET`"] +#[doc = "Field `PET` writer - Parity Error Trap Clear"] pub struct PET_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BRWNT`"] +#[doc = "Field `BRWNT` writer - Brown Out Trap Clear"] pub struct BRWNT_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRWNT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ULPWDGT`"] +#[doc = "Field `ULPWDGT` writer - OSC_ULP WDG Trap Clear"] pub struct ULPWDGT_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> ULPWDGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDGT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> ULPWDGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BWERR0T`"] +#[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Clear"] pub struct BWERR0T_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR0T_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BWERR1T`"] +#[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Clear"] pub struct BWERR1T_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR1T_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TEMPHIT`"] +#[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Clear"] pub struct TEMPHIT_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPHIT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TEMPLOT`"] +#[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Clear"] pub struct TEMPLOT_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPLOT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -589,4 +580,26 @@ impl W { pub fn templot(&mut self) -> TEMPLOT_W { TEMPLOT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Trap Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapclr](index.html) module"] +pub struct TRAPCLR_SPEC; +impl crate::RegisterSpec for TRAPCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [trapclr::W](W) writer structure"] +impl crate::Writable for TRAPCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRAPCLR to value 0"] +impl crate::Resettable for TRAPCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_trap/trapdis.rs b/src/scu_trap/trapdis.rs index e909017e..45fdaf0f 100644 --- a/src/scu_trap/trapdis.rs +++ b/src/scu_trap/trapdis.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TRAPDIS"] -pub type R = crate::R; -#[doc = "Writer for register TRAPDIS"] -pub type W = crate::W; -#[doc = "Register TRAPDIS `reset()`'s with value 0x31ff"] -impl crate::ResetValue for super::TRAPDIS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x31ff +#[doc = "Register `TRAPDIS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TRAPDIS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System OSC WDT Trap Disable\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOSCWDGT`"] -pub type SOSCWDGT_R = crate::R; +#[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Disable"] +pub struct SOSCWDGT_R(crate::FieldReader); impl SOSCWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + SOSCWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOSCWDGT_A { @@ -38,15 +65,22 @@ impl SOSCWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOSCWDGT_A::VALUE1 + **self == SOSCWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOSCWDGT_A::VALUE2 + **self == SOSCWDGT_A::VALUE2 } } -#[doc = "Write proxy for field `SOSCWDGT`"] +impl core::ops::Deref for SOSCWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Disable"] pub struct SOSCWDGT_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SOSCWDGT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SVCOLCKT`"] -pub type SVCOLCKT_R = crate::R; +#[doc = "Field `SVCOLCKT` reader - System VCO Lock Trap Disable"] +pub struct SVCOLCKT_R(crate::FieldReader); impl SVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + SVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SVCOLCKT_A { @@ -113,15 +148,22 @@ impl SVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVCOLCKT_A::VALUE1 + **self == SVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVCOLCKT_A::VALUE2 + **self == SVCOLCKT_A::VALUE2 } } -#[doc = "Write proxy for field `SVCOLCKT`"] +impl core::ops::Deref for SVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Disable"] pub struct SVCOLCKT_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SVCOLCKT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UVCOLCKT`"] -pub type UVCOLCKT_R = crate::R; +#[doc = "Field `UVCOLCKT` reader - USB VCO Lock Trap Disable"] +pub struct UVCOLCKT_R(crate::FieldReader); impl UVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + UVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UVCOLCKT_A { @@ -188,15 +231,22 @@ impl UVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UVCOLCKT_A::VALUE1 + **self == UVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UVCOLCKT_A::VALUE2 + **self == UVCOLCKT_A::VALUE2 + } +} +impl core::ops::Deref for UVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `UVCOLCKT`"] +#[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Disable"] pub struct UVCOLCKT_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UVCOLCKT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PET`"] -pub type PET_R = crate::R; +#[doc = "Field `PET` reader - Parity Error Trap Disable"] +pub struct PET_R(crate::FieldReader); impl PET_R { + pub(crate) fn new(bits: bool) -> Self { + PET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PET_A { @@ -263,15 +314,22 @@ impl PET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PET_A::VALUE1 + **self == PET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PET_A::VALUE2 + **self == PET_A::VALUE2 + } +} +impl core::ops::Deref for PET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PET`"] +#[doc = "Field `PET` writer - Parity Error Trap Disable"] pub struct PET_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PET_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRWNT`"] -pub type BRWNT_R = crate::R; +#[doc = "Field `BRWNT` reader - Brown Out Trap Disable"] +pub struct BRWNT_R(crate::FieldReader); impl BRWNT_R { + pub(crate) fn new(bits: bool) -> Self { + BRWNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRWNT_A { @@ -338,15 +397,22 @@ impl BRWNT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRWNT_A::VALUE1 + **self == BRWNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRWNT_A::VALUE2 + **self == BRWNT_A::VALUE2 } } -#[doc = "Write proxy for field `BRWNT`"] +impl core::ops::Deref for BRWNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BRWNT` writer - Brown Out Trap Disable"] pub struct BRWNT_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRWNT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ULPWDGT`"] -pub type ULPWDGT_R = crate::R; +#[doc = "Field `ULPWDGT` reader - Wake-up Trap Disable"] +pub struct ULPWDGT_R(crate::FieldReader); impl ULPWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + ULPWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ULPWDGT_A { @@ -413,15 +480,22 @@ impl ULPWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ULPWDGT_A::VALUE1 + **self == ULPWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ULPWDGT_A::VALUE2 + **self == ULPWDGT_A::VALUE2 } } -#[doc = "Write proxy for field `ULPWDGT`"] +impl core::ops::Deref for ULPWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ULPWDGT` writer - Wake-up Trap Disable"] pub struct ULPWDGT_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> ULPWDGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDGT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> ULPWDGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR0T`"] -pub type BWERR0T_R = crate::R; +#[doc = "Field `BWERR0T` reader - Peripheral Bridge 0 Trap Disable"] +pub struct BWERR0T_R(crate::FieldReader); impl BWERR0T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR0T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR0T_A { @@ -488,15 +563,22 @@ impl BWERR0T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR0T_A::VALUE1 + **self == BWERR0T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR0T_A::VALUE2 + **self == BWERR0T_A::VALUE2 + } +} +impl core::ops::Deref for BWERR0T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BWERR0T`"] +#[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Disable"] pub struct BWERR0T_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR0T_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR1T`"] -pub type BWERR1T_R = crate::R; +#[doc = "Field `BWERR1T` reader - Peripheral Bridge 1 Trap Disable"] +pub struct BWERR1T_R(crate::FieldReader); impl BWERR1T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR1T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR1T_A { @@ -563,15 +646,22 @@ impl BWERR1T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR1T_A::VALUE1 + **self == BWERR1T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR1T_A::VALUE2 + **self == BWERR1T_A::VALUE2 } } -#[doc = "Write proxy for field `BWERR1T`"] +impl core::ops::Deref for BWERR1T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Disable"] pub struct BWERR1T_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR1T_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPHIT`"] -pub type TEMPHIT_R = crate::R; +#[doc = "Field `TEMPHIT` reader - Die Temperature Too High Trap Disable"] +pub struct TEMPHIT_R(crate::FieldReader); impl TEMPHIT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPHIT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPHIT_A { @@ -638,15 +729,22 @@ impl TEMPHIT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPHIT_A::VALUE1 + **self == TEMPHIT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPHIT_A::VALUE2 + **self == TEMPHIT_A::VALUE2 } } -#[doc = "Write proxy for field `TEMPHIT`"] +impl core::ops::Deref for TEMPHIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Disable"] pub struct TEMPHIT_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPHIT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPLOT`"] -pub type TEMPLOT_R = crate::R; +#[doc = "Field `TEMPLOT` reader - Die Temperature Too Low Trap Disable"] +pub struct TEMPLOT_R(crate::FieldReader); impl TEMPLOT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPLOT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPLOT_A { @@ -713,15 +812,22 @@ impl TEMPLOT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPLOT_A::VALUE1 + **self == TEMPLOT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPLOT_A::VALUE2 + **self == TEMPLOT_A::VALUE2 } } -#[doc = "Write proxy for field `TEMPLOT`"] +impl core::ops::Deref for TEMPLOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Disable"] pub struct TEMPLOT_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPLOT_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trap request enabled"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -863,4 +967,30 @@ impl W { pub fn templot(&mut self) -> TEMPLOT_W { TEMPLOT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Trap Disable Register\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 [trapdis](index.html) module"] +pub struct TRAPDIS_SPEC; +impl crate::RegisterSpec for TRAPDIS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [trapdis::R](R) reader structure"] +impl crate::Readable for TRAPDIS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [trapdis::W](W) writer structure"] +impl crate::Writable for TRAPDIS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRAPDIS to value 0x31ff"] +impl crate::Resettable for TRAPDIS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x31ff + } } diff --git a/src/scu_trap/trapraw.rs b/src/scu_trap/trapraw.rs index 87bd368b..82dc35fb 100644 --- a/src/scu_trap/trapraw.rs +++ b/src/scu_trap/trapraw.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register TRAPRAW"] -pub type R = crate::R; +#[doc = "Register `TRAPRAW` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "System OSC WDT Trap Raw Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SOSCWDGT_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOSCWDGT`"] -pub type SOSCWDGT_R = crate::R; +#[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Raw Status"] +pub struct SOSCWDGT_R(crate::FieldReader); impl SOSCWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + SOSCWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOSCWDGT_A { @@ -28,12 +44,19 @@ impl SOSCWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOSCWDGT_A::VALUE1 + **self == SOSCWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOSCWDGT_A::VALUE2 + **self == SOSCWDGT_A::VALUE2 + } +} +impl core::ops::Deref for SOSCWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "System VCO Lock Trap Raw Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SVCOLCKT`"] -pub type SVCOLCKT_R = crate::R; +#[doc = "Field `SVCOLCKT` reader - System VCO Lock Trap Raw Status"] +pub struct SVCOLCKT_R(crate::FieldReader); impl SVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + SVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SVCOLCKT_A { @@ -64,12 +90,19 @@ impl SVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVCOLCKT_A::VALUE1 + **self == SVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVCOLCKT_A::VALUE2 + **self == SVCOLCKT_A::VALUE2 + } +} +impl core::ops::Deref for SVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB VCO Lock Trap Raw Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UVCOLCKT`"] -pub type UVCOLCKT_R = crate::R; +#[doc = "Field `UVCOLCKT` reader - USB VCO Lock Trap Raw Status"] +pub struct UVCOLCKT_R(crate::FieldReader); impl UVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + UVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UVCOLCKT_A { @@ -100,12 +136,19 @@ impl UVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UVCOLCKT_A::VALUE1 + **self == UVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UVCOLCKT_A::VALUE2 + **self == UVCOLCKT_A::VALUE2 + } +} +impl core::ops::Deref for UVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Parity Error Trap Raw Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PET`"] -pub type PET_R = crate::R; +#[doc = "Field `PET` reader - Parity Error Trap Raw Status"] +pub struct PET_R(crate::FieldReader); impl PET_R { + pub(crate) fn new(bits: bool) -> Self { + PET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PET_A { @@ -136,12 +182,19 @@ impl PET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PET_A::VALUE1 + **self == PET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PET_A::VALUE2 + **self == PET_A::VALUE2 + } +} +impl core::ops::Deref for PET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Brown Out Trap Raw Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRWNT`"] -pub type BRWNT_R = crate::R; +#[doc = "Field `BRWNT` reader - Brown Out Trap Raw Status"] +pub struct BRWNT_R(crate::FieldReader); impl BRWNT_R { + pub(crate) fn new(bits: bool) -> Self { + BRWNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRWNT_A { @@ -172,12 +228,19 @@ impl BRWNT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRWNT_A::VALUE1 + **self == BRWNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRWNT_A::VALUE2 + **self == BRWNT_A::VALUE2 + } +} +impl core::ops::Deref for BRWNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSC_ULP WDG Trap RAW Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ULPWDGT`"] -pub type ULPWDGT_R = crate::R; +#[doc = "Field `ULPWDGT` reader - OSC_ULP WDG Trap RAW Status"] +pub struct ULPWDGT_R(crate::FieldReader); impl ULPWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + ULPWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ULPWDGT_A { @@ -208,12 +274,19 @@ impl ULPWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ULPWDGT_A::VALUE1 + **self == ULPWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ULPWDGT_A::VALUE2 + **self == ULPWDGT_A::VALUE2 + } +} +impl core::ops::Deref for ULPWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Peripheral Bridge 0 Trap Raw Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR0T`"] -pub type BWERR0T_R = crate::R; +#[doc = "Field `BWERR0T` reader - Peripheral Bridge 0 Trap Raw Status"] +pub struct BWERR0T_R(crate::FieldReader); impl BWERR0T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR0T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR0T_A { @@ -244,12 +320,19 @@ impl BWERR0T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR0T_A::VALUE1 + **self == BWERR0T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR0T_A::VALUE2 + **self == BWERR0T_A::VALUE2 + } +} +impl core::ops::Deref for BWERR0T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Peripheral Bridge 1 Trap Raw Status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR1T`"] -pub type BWERR1T_R = crate::R; +#[doc = "Field `BWERR1T` reader - Peripheral Bridge 1 Trap Raw Status"] +pub struct BWERR1T_R(crate::FieldReader); impl BWERR1T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR1T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR1T_A { @@ -280,12 +366,19 @@ impl BWERR1T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR1T_A::VALUE1 + **self == BWERR1T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR1T_A::VALUE2 + **self == BWERR1T_A::VALUE2 + } +} +impl core::ops::Deref for BWERR1T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Die Temperature Too High Trap Raw Status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPHIT`"] -pub type TEMPHIT_R = crate::R; +#[doc = "Field `TEMPHIT` reader - Die Temperature Too High Trap Raw Status"] +pub struct TEMPHIT_R(crate::FieldReader); impl TEMPHIT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPHIT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPHIT_A { @@ -316,12 +412,19 @@ impl TEMPHIT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPHIT_A::VALUE1 + **self == TEMPHIT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPHIT_A::VALUE2 + **self == TEMPHIT_A::VALUE2 + } +} +impl core::ops::Deref for TEMPHIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Die Temperature Too Low Trap Raw Status\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPLOT`"] -pub type TEMPLOT_R = crate::R; +#[doc = "Field `TEMPLOT` reader - Die Temperature Too Low Trap Raw Status"] +pub struct TEMPLOT_R(crate::FieldReader); impl TEMPLOT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPLOT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPLOT_A { @@ -352,12 +458,19 @@ impl TEMPLOT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPLOT_A::VALUE1 + **self == TEMPLOT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPLOT_A::VALUE2 + **self == TEMPLOT_A::VALUE2 + } +} +impl core::ops::Deref for TEMPLOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -412,3 +525,19 @@ impl R { TEMPLOT_R::new(((self.bits >> 13) & 0x01) != 0) } } +#[doc = "Trap Raw Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapraw](index.html) module"] +pub struct TRAPRAW_SPEC; +impl crate::RegisterSpec for TRAPRAW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [trapraw::R](R) reader structure"] +impl crate::Readable for TRAPRAW_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TRAPRAW to value 0"] +impl crate::Resettable for TRAPRAW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/scu_trap/trapset.rs b/src/scu_trap/trapset.rs index ef4f43be..533f79e4 100644 --- a/src/scu_trap/trapset.rs +++ b/src/scu_trap/trapset.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register TRAPSET"] -pub type W = crate::W; -#[doc = "Register TRAPSET `reset()`'s with value 0"] -impl crate::ResetValue for super::TRAPSET { - type Type = u32; +#[doc = "Register `TRAPSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "System OSC WDT Trap Set\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SOSCWDGT`"] +#[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Set"] pub struct SOSCWDGT_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SOSCWDGT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> SOSCWDGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SVCOLCKT`"] +#[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Set"] pub struct SVCOLCKT_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SVCOLCKT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> SVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `UVCOLCKT`"] +#[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Set"] pub struct UVCOLCKT_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UVCOLCKT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> UVCOLCKT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `PET`"] +#[doc = "Field `PET` writer - Parity Error Trap Set"] pub struct PET_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PET_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> PET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BRWNT`"] +#[doc = "Field `BRWNT` writer - Brown Out Trap Set"] pub struct BRWNT_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRWNT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> BRWNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ULPWDT`"] +#[doc = "Field `ULPWDT` writer - OSC_ULP WDG Trap Set"] pub struct ULPWDT_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> ULPWDT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ULPWDT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> ULPWDT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BWERR0T`"] +#[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Set"] pub struct BWERR0T_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR0T_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> BWERR0T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BWERR1T`"] +#[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Set"] pub struct BWERR1T_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWERR1T_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> BWERR1T_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TEMPHIT`"] +#[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Set"] pub struct TEMPHIT_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPHIT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> TEMPHIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TEMPLOT`"] +#[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Set"] pub struct TEMPLOT_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TEMPLOT_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> TEMPLOT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -589,4 +580,26 @@ impl W { pub fn templot(&mut self) -> TEMPLOT_W { TEMPLOT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Trap Set Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapset](index.html) module"] +pub struct TRAPSET_SPEC; +impl crate::RegisterSpec for TRAPSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [trapset::W](W) writer structure"] +impl crate::Writable for TRAPSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRAPSET to value 0"] +impl crate::Resettable for TRAPSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/scu_trap/trapstat.rs b/src/scu_trap/trapstat.rs index 2cf68ef8..56d636fd 100644 --- a/src/scu_trap/trapstat.rs +++ b/src/scu_trap/trapstat.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register TRAPSTAT"] -pub type R = crate::R; +#[doc = "Register `TRAPSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "System OSC WDT Trap Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SOSCWDGT_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOSCWDGT`"] -pub type SOSCWDGT_R = crate::R; +#[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Status"] +pub struct SOSCWDGT_R(crate::FieldReader); impl SOSCWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + SOSCWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOSCWDGT_A { @@ -28,12 +44,19 @@ impl SOSCWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOSCWDGT_A::VALUE1 + **self == SOSCWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOSCWDGT_A::VALUE2 + **self == SOSCWDGT_A::VALUE2 + } +} +impl core::ops::Deref for SOSCWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "System VCO Lock Trap Status\n\nValue on reset: 0"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SVCOLCKT`"] -pub type SVCOLCKT_R = crate::R; +#[doc = "Field `SVCOLCKT` reader - System VCO Lock Trap Status"] +pub struct SVCOLCKT_R(crate::FieldReader); impl SVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + SVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SVCOLCKT_A { @@ -64,12 +90,19 @@ impl SVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SVCOLCKT_A::VALUE1 + **self == SVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SVCOLCKT_A::VALUE2 + **self == SVCOLCKT_A::VALUE2 + } +} +impl core::ops::Deref for SVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "USB VCO Lock Trap Status\n\nValue on reset: 0"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `UVCOLCKT`"] -pub type UVCOLCKT_R = crate::R; +#[doc = "Field `UVCOLCKT` reader - USB VCO Lock Trap Status"] +pub struct UVCOLCKT_R(crate::FieldReader); impl UVCOLCKT_R { + pub(crate) fn new(bits: bool) -> Self { + UVCOLCKT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> UVCOLCKT_A { @@ -100,12 +136,19 @@ impl UVCOLCKT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == UVCOLCKT_A::VALUE1 + **self == UVCOLCKT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == UVCOLCKT_A::VALUE2 + **self == UVCOLCKT_A::VALUE2 + } +} +impl core::ops::Deref for UVCOLCKT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Parity Error Trap Status\n\nValue on reset: 0"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PET`"] -pub type PET_R = crate::R; +#[doc = "Field `PET` reader - Parity Error Trap Status"] +pub struct PET_R(crate::FieldReader); impl PET_R { + pub(crate) fn new(bits: bool) -> Self { + PET_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PET_A { @@ -136,12 +182,19 @@ impl PET_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PET_A::VALUE1 + **self == PET_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PET_A::VALUE2 + **self == PET_A::VALUE2 + } +} +impl core::ops::Deref for PET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Brown Out Trap Status\n\nValue on reset: 0"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRWNT`"] -pub type BRWNT_R = crate::R; +#[doc = "Field `BRWNT` reader - Brown Out Trap Status"] +pub struct BRWNT_R(crate::FieldReader); impl BRWNT_R { + pub(crate) fn new(bits: bool) -> Self { + BRWNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRWNT_A { @@ -172,12 +228,19 @@ impl BRWNT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRWNT_A::VALUE1 + **self == BRWNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRWNT_A::VALUE2 + **self == BRWNT_A::VALUE2 + } +} +impl core::ops::Deref for BRWNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "OSC_ULP WDG Trap Status\n\nValue on reset: 0"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ULPWDGT`"] -pub type ULPWDGT_R = crate::R; +#[doc = "Field `ULPWDGT` reader - OSC_ULP WDG Trap Status"] +pub struct ULPWDGT_R(crate::FieldReader); impl ULPWDGT_R { + pub(crate) fn new(bits: bool) -> Self { + ULPWDGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ULPWDGT_A { @@ -208,12 +274,19 @@ impl ULPWDGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ULPWDGT_A::VALUE1 + **self == ULPWDGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ULPWDGT_A::VALUE2 + **self == ULPWDGT_A::VALUE2 + } +} +impl core::ops::Deref for ULPWDGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Peripheral Bridge 0 Trap Status\n\nValue on reset: 0"] @@ -230,9 +303,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR0T`"] -pub type BWERR0T_R = crate::R; +#[doc = "Field `BWERR0T` reader - Peripheral Bridge 0 Trap Status"] +pub struct BWERR0T_R(crate::FieldReader); impl BWERR0T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR0T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR0T_A { @@ -244,12 +320,19 @@ impl BWERR0T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR0T_A::VALUE1 + **self == BWERR0T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR0T_A::VALUE2 + **self == BWERR0T_A::VALUE2 + } +} +impl core::ops::Deref for BWERR0T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Peripheral Bridge 1 Trap Status\n\nValue on reset: 0"] @@ -266,9 +349,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWERR1T`"] -pub type BWERR1T_R = crate::R; +#[doc = "Field `BWERR1T` reader - Peripheral Bridge 1 Trap Status"] +pub struct BWERR1T_R(crate::FieldReader); impl BWERR1T_R { + pub(crate) fn new(bits: bool) -> Self { + BWERR1T_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWERR1T_A { @@ -280,12 +366,19 @@ impl BWERR1T_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWERR1T_A::VALUE1 + **self == BWERR1T_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWERR1T_A::VALUE2 + **self == BWERR1T_A::VALUE2 + } +} +impl core::ops::Deref for BWERR1T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Die Temperature Too High Trap Status\n\nValue on reset: 0"] @@ -302,9 +395,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPHIT`"] -pub type TEMPHIT_R = crate::R; +#[doc = "Field `TEMPHIT` reader - Die Temperature Too High Trap Status"] +pub struct TEMPHIT_R(crate::FieldReader); impl TEMPHIT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPHIT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPHIT_A { @@ -316,12 +412,19 @@ impl TEMPHIT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPHIT_A::VALUE1 + **self == TEMPHIT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPHIT_A::VALUE2 + **self == TEMPHIT_A::VALUE2 + } +} +impl core::ops::Deref for TEMPHIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Die Temperature Too Low Trap Status\n\nValue on reset: 0"] @@ -338,9 +441,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPLOT`"] -pub type TEMPLOT_R = crate::R; +#[doc = "Field `TEMPLOT` reader - Die Temperature Too Low Trap Status"] +pub struct TEMPLOT_R(crate::FieldReader); impl TEMPLOT_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPLOT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPLOT_A { @@ -352,12 +458,19 @@ impl TEMPLOT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPLOT_A::VALUE1 + **self == TEMPLOT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPLOT_A::VALUE2 + **self == TEMPLOT_A::VALUE2 + } +} +impl core::ops::Deref for TEMPLOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -412,3 +525,19 @@ impl R { TEMPLOT_R::new(((self.bits >> 13) & 0x01) != 0) } } +#[doc = "Trap Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trapstat](index.html) module"] +pub struct TRAPSTAT_SPEC; +impl crate::RegisterSpec for TRAPSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [trapstat::R](R) reader structure"] +impl crate::Readable for TRAPSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TRAPSTAT to value 0"] +impl crate::Resettable for TRAPSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0.rs b/src/usb0.rs index 45c20e97..b51deb26 100644 --- a/src/usb0.rs +++ b/src/usb0.rs @@ -1,369 +1,181 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved0: [u8; 8usize], + _reserved0: [u8; 0x08], #[doc = "0x08 - AHB Configuration Register"] - pub gahbcfg: GAHBCFG, + pub gahbcfg: crate::Reg, #[doc = "0x0c - USB Configuration Register"] - pub gusbcfg: GUSBCFG, + pub gusbcfg: crate::Reg, #[doc = "0x10 - Reset Register"] - pub grstctl: GRSTCTL, + pub grstctl: crate::Reg, #[doc = "0x14 - Interrupt Register"] - pub gintsts: GINTSTS, + pub gintsts: crate::Reg, #[doc = "0x18 - Interrupt Mask Register"] - pub gintmsk: GINTMSK, + pub gintmsk: crate::Reg, #[doc = "0x1c - Receive Status Debug Read Register"] - pub grxstsr: GRXSTSR, + pub grxstsr: crate::Reg, #[doc = "0x20 - Receive Status Read and Pop Register"] - pub grxstsp: GRXSTSP, + pub grxstsp: crate::Reg, #[doc = "0x24 - Receive FIFO Size Register"] - pub grxfsiz: GRXFSIZ, + pub grxfsiz: crate::Reg, #[doc = "0x28 - Non-Periodic Transmit FIFO Size Register"] - pub gnptxfsiz: GNPTXFSIZ, - _reserved9: [u8; 16usize], + pub gnptxfsiz: crate::Reg, + _reserved9: [u8; 0x10], #[doc = "0x3c - USB Module Identification Register"] - pub guid: GUID, - _reserved10: [u8; 28usize], + pub guid: crate::Reg, + _reserved10: [u8; 0x1c], #[doc = "0x5c - Global DFIFO Software Config Register"] - pub gdfifocfg: GDFIFOCFG, - _reserved11: [u8; 164usize], + pub gdfifocfg: crate::Reg, + _reserved11: [u8; 0xa4], #[doc = "0x104 - Device IN Endpoint 1 Transmit FIFO Size Register"] - pub dieptxf1: DIEPTXF1, + pub dieptxf1: crate::Reg, #[doc = "0x108 - Device IN Endpoint 2 Transmit FIFO Size Register"] - pub dieptxf2: DIEPTXF2, + pub dieptxf2: crate::Reg, #[doc = "0x10c - Device IN Endpoint 3 Transmit FIFO Size Register"] - pub dieptxf3: DIEPTXF3, + pub dieptxf3: crate::Reg, #[doc = "0x110 - Device IN Endpoint 4 Transmit FIFO Size Register"] - pub dieptxf4: DIEPTXF4, + pub dieptxf4: crate::Reg, #[doc = "0x114 - Device IN Endpoint 5 Transmit FIFO Size Register"] - pub dieptxf5: DIEPTXF5, + pub dieptxf5: crate::Reg, #[doc = "0x118 - Device IN Endpoint 6 Transmit FIFO Size Register"] - pub dieptxf6: DIEPTXF6, - _reserved17: [u8; 1764usize], + pub dieptxf6: crate::Reg, + _reserved17: [u8; 0x06e4], #[doc = "0x800 - Device Configuration Register"] - pub dcfg: DCFG, + pub dcfg: crate::Reg, #[doc = "0x804 - Device Control Register"] - pub dctl: DCTL, + pub dctl: crate::Reg, #[doc = "0x808 - Device Status Register"] - pub dsts: DSTS, - _reserved20: [u8; 4usize], + pub dsts: crate::Reg, + _reserved20: [u8; 0x04], #[doc = "0x810 - Device IN Endpoint Common Interrupt Mask Register"] - pub diepmsk: DIEPMSK, + pub diepmsk: crate::Reg, #[doc = "0x814 - Device OUT Endpoint Common Interrupt Mask Register"] - pub doepmsk: DOEPMSK, + pub doepmsk: crate::Reg, #[doc = "0x818 - Device All Endpoints Interrupt Register"] - pub daint: DAINT, + pub daint: crate::Reg, #[doc = "0x81c - Device All Endpoints Interrupt Mask Register"] - pub daintmsk: DAINTMSK, - _reserved24: [u8; 8usize], + pub daintmsk: crate::Reg, + _reserved24: [u8; 0x08], #[doc = "0x828 - Device VBUS Discharge Time Register"] - pub dvbusdis: DVBUSDIS, + pub dvbusdis: crate::Reg, #[doc = "0x82c - Device VBUS Pulsing Time Register"] - pub dvbuspulse: DVBUSPULSE, - _reserved26: [u8; 4usize], + pub dvbuspulse: crate::Reg, + _reserved26: [u8; 0x04], #[doc = "0x834 - Device IN Endpoint FIFO Empty Interrupt Mask Register"] - pub diepempmsk: DIEPEMPMSK, - _reserved27: [u8; 1480usize], + pub diepempmsk: crate::Reg, + _reserved27: [u8; 0x05c8], #[doc = "0xe00 - Power and Clock Gating Control Register"] - pub pcgcctl: PCGCCTL, + pub pcgcctl: crate::Reg, } -#[doc = "AHB Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gahbcfg](gahbcfg) module"] -pub type GAHBCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GAHBCFG; -#[doc = "`read()` method returns [gahbcfg::R](gahbcfg::R) reader structure"] -impl crate::Readable for GAHBCFG {} -#[doc = "`write(|w| ..)` method takes [gahbcfg::W](gahbcfg::W) writer structure"] -impl crate::Writable for GAHBCFG {} +#[doc = "GAHBCFG register accessor: an alias for `Reg`"] +pub type GAHBCFG = crate::Reg; #[doc = "AHB Configuration Register"] pub mod gahbcfg; -#[doc = "USB Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gusbcfg](gusbcfg) module"] -pub type GUSBCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GUSBCFG; -#[doc = "`read()` method returns [gusbcfg::R](gusbcfg::R) reader structure"] -impl crate::Readable for GUSBCFG {} -#[doc = "`write(|w| ..)` method takes [gusbcfg::W](gusbcfg::W) writer structure"] -impl crate::Writable for GUSBCFG {} +#[doc = "GUSBCFG register accessor: an alias for `Reg`"] +pub type GUSBCFG = crate::Reg; #[doc = "USB Configuration Register"] pub mod gusbcfg; -#[doc = "Reset Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grstctl](grstctl) module"] -pub type GRSTCTL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GRSTCTL; -#[doc = "`read()` method returns [grstctl::R](grstctl::R) reader structure"] -impl crate::Readable for GRSTCTL {} -#[doc = "`write(|w| ..)` method takes [grstctl::W](grstctl::W) writer structure"] -impl crate::Writable for GRSTCTL {} +#[doc = "GRSTCTL register accessor: an alias for `Reg`"] +pub type GRSTCTL = crate::Reg; #[doc = "Reset Register"] pub mod grstctl; -#[doc = "Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gintsts](gintsts) module"] -pub type GINTSTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GINTSTS; -#[doc = "`read()` method returns [gintsts::R](gintsts::R) reader structure"] -impl crate::Readable for GINTSTS {} -#[doc = "`write(|w| ..)` method takes [gintsts::W](gintsts::W) writer structure"] -impl crate::Writable for GINTSTS {} +#[doc = "GINTSTS register accessor: an alias for `Reg`"] +pub type GINTSTS = crate::Reg; #[doc = "Interrupt Register"] pub mod gintsts; -#[doc = "Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gintmsk](gintmsk) module"] -pub type GINTMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GINTMSK; -#[doc = "`read()` method returns [gintmsk::R](gintmsk::R) reader structure"] -impl crate::Readable for GINTMSK {} -#[doc = "`write(|w| ..)` method takes [gintmsk::W](gintmsk::W) writer structure"] -impl crate::Writable for GINTMSK {} +#[doc = "GINTMSK register accessor: an alias for `Reg`"] +pub type GINTMSK = crate::Reg; #[doc = "Interrupt Mask Register"] pub mod gintmsk; -#[doc = "Receive Status Debug Read Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grxstsr](grxstsr) module"] -pub type GRXSTSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GRXSTSR; -#[doc = "`read()` method returns [grxstsr::R](grxstsr::R) reader structure"] -impl crate::Readable for GRXSTSR {} +#[doc = "GRXSTSR register accessor: an alias for `Reg`"] +pub type GRXSTSR = crate::Reg; #[doc = "Receive Status Debug Read Register"] pub mod grxstsr; -#[doc = "Receive Status Read and Pop Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grxstsp](grxstsp) module"] -pub type GRXSTSP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GRXSTSP; -#[doc = "`read()` method returns [grxstsp::R](grxstsp::R) reader structure"] -impl crate::Readable for GRXSTSP {} +#[doc = "GRXSTSP register accessor: an alias for `Reg`"] +pub type GRXSTSP = crate::Reg; #[doc = "Receive Status Read and Pop Register"] pub mod grxstsp; -#[doc = "Receive FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grxfsiz](grxfsiz) module"] -pub type GRXFSIZ = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GRXFSIZ; -#[doc = "`read()` method returns [grxfsiz::R](grxfsiz::R) reader structure"] -impl crate::Readable for GRXFSIZ {} -#[doc = "`write(|w| ..)` method takes [grxfsiz::W](grxfsiz::W) writer structure"] -impl crate::Writable for GRXFSIZ {} +#[doc = "GRXFSIZ register accessor: an alias for `Reg`"] +pub type GRXFSIZ = crate::Reg; #[doc = "Receive FIFO Size Register"] pub mod grxfsiz; -#[doc = "Non-Periodic Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gnptxfsiz](gnptxfsiz) module"] -pub type GNPTXFSIZ = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GNPTXFSIZ; -#[doc = "`read()` method returns [gnptxfsiz::R](gnptxfsiz::R) reader structure"] -impl crate::Readable for GNPTXFSIZ {} -#[doc = "`write(|w| ..)` method takes [gnptxfsiz::W](gnptxfsiz::W) writer structure"] -impl crate::Writable for GNPTXFSIZ {} +#[doc = "GNPTXFSIZ register accessor: an alias for `Reg`"] +pub type GNPTXFSIZ = crate::Reg; #[doc = "Non-Periodic Transmit FIFO Size Register"] pub mod gnptxfsiz; -#[doc = "USB Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [guid](guid) module"] -pub type GUID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GUID; -#[doc = "`read()` method returns [guid::R](guid::R) reader structure"] -impl crate::Readable for GUID {} -#[doc = "`write(|w| ..)` method takes [guid::W](guid::W) writer structure"] -impl crate::Writable for GUID {} +#[doc = "GUID register accessor: an alias for `Reg`"] +pub type GUID = crate::Reg; #[doc = "USB Module Identification Register"] pub mod guid; -#[doc = "Global DFIFO Software Config Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gdfifocfg](gdfifocfg) module"] -pub type GDFIFOCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GDFIFOCFG; -#[doc = "`read()` method returns [gdfifocfg::R](gdfifocfg::R) reader structure"] -impl crate::Readable for GDFIFOCFG {} -#[doc = "`write(|w| ..)` method takes [gdfifocfg::W](gdfifocfg::W) writer structure"] -impl crate::Writable for GDFIFOCFG {} +#[doc = "GDFIFOCFG register accessor: an alias for `Reg`"] +pub type GDFIFOCFG = crate::Reg; #[doc = "Global DFIFO Software Config Register"] pub mod gdfifocfg; -#[doc = "Device IN Endpoint 1 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf1](dieptxf1) module"] -pub type DIEPTXF1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF1; -#[doc = "`read()` method returns [dieptxf1::R](dieptxf1::R) reader structure"] -impl crate::Readable for DIEPTXF1 {} -#[doc = "`write(|w| ..)` method takes [dieptxf1::W](dieptxf1::W) writer structure"] -impl crate::Writable for DIEPTXF1 {} +#[doc = "DIEPTXF1 register accessor: an alias for `Reg`"] +pub type DIEPTXF1 = crate::Reg; #[doc = "Device IN Endpoint 1 Transmit FIFO Size Register"] pub mod dieptxf1; -#[doc = "Device IN Endpoint 2 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf2](dieptxf2) module"] -pub type DIEPTXF2 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF2; -#[doc = "`read()` method returns [dieptxf2::R](dieptxf2::R) reader structure"] -impl crate::Readable for DIEPTXF2 {} -#[doc = "`write(|w| ..)` method takes [dieptxf2::W](dieptxf2::W) writer structure"] -impl crate::Writable for DIEPTXF2 {} +#[doc = "DIEPTXF2 register accessor: an alias for `Reg`"] +pub type DIEPTXF2 = crate::Reg; #[doc = "Device IN Endpoint 2 Transmit FIFO Size Register"] pub mod dieptxf2; -#[doc = "Device IN Endpoint 3 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf3](dieptxf3) module"] -pub type DIEPTXF3 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF3; -#[doc = "`read()` method returns [dieptxf3::R](dieptxf3::R) reader structure"] -impl crate::Readable for DIEPTXF3 {} -#[doc = "`write(|w| ..)` method takes [dieptxf3::W](dieptxf3::W) writer structure"] -impl crate::Writable for DIEPTXF3 {} +#[doc = "DIEPTXF3 register accessor: an alias for `Reg`"] +pub type DIEPTXF3 = crate::Reg; #[doc = "Device IN Endpoint 3 Transmit FIFO Size Register"] pub mod dieptxf3; -#[doc = "Device IN Endpoint 4 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf4](dieptxf4) module"] -pub type DIEPTXF4 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF4; -#[doc = "`read()` method returns [dieptxf4::R](dieptxf4::R) reader structure"] -impl crate::Readable for DIEPTXF4 {} -#[doc = "`write(|w| ..)` method takes [dieptxf4::W](dieptxf4::W) writer structure"] -impl crate::Writable for DIEPTXF4 {} +#[doc = "DIEPTXF4 register accessor: an alias for `Reg`"] +pub type DIEPTXF4 = crate::Reg; #[doc = "Device IN Endpoint 4 Transmit FIFO Size Register"] pub mod dieptxf4; -#[doc = "Device IN Endpoint 5 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf5](dieptxf5) module"] -pub type DIEPTXF5 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF5; -#[doc = "`read()` method returns [dieptxf5::R](dieptxf5::R) reader structure"] -impl crate::Readable for DIEPTXF5 {} -#[doc = "`write(|w| ..)` method takes [dieptxf5::W](dieptxf5::W) writer structure"] -impl crate::Writable for DIEPTXF5 {} +#[doc = "DIEPTXF5 register accessor: an alias for `Reg`"] +pub type DIEPTXF5 = crate::Reg; #[doc = "Device IN Endpoint 5 Transmit FIFO Size Register"] pub mod dieptxf5; -#[doc = "Device IN Endpoint 6 Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptxf6](dieptxf6) module"] -pub type DIEPTXF6 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTXF6; -#[doc = "`read()` method returns [dieptxf6::R](dieptxf6::R) reader structure"] -impl crate::Readable for DIEPTXF6 {} -#[doc = "`write(|w| ..)` method takes [dieptxf6::W](dieptxf6::W) writer structure"] -impl crate::Writable for DIEPTXF6 {} +#[doc = "DIEPTXF6 register accessor: an alias for `Reg`"] +pub type DIEPTXF6 = crate::Reg; #[doc = "Device IN Endpoint 6 Transmit FIFO Size Register"] pub mod dieptxf6; -#[doc = "Device Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcfg](dcfg) module"] -pub type DCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DCFG; -#[doc = "`read()` method returns [dcfg::R](dcfg::R) reader structure"] -impl crate::Readable for DCFG {} -#[doc = "`write(|w| ..)` method takes [dcfg::W](dcfg::W) writer structure"] -impl crate::Writable for DCFG {} +#[doc = "DCFG register accessor: an alias for `Reg`"] +pub type DCFG = crate::Reg; #[doc = "Device Configuration Register"] pub mod dcfg; -#[doc = "Device Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dctl](dctl) module"] -pub type DCTL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DCTL; -#[doc = "`read()` method returns [dctl::R](dctl::R) reader structure"] -impl crate::Readable for DCTL {} -#[doc = "`write(|w| ..)` method takes [dctl::W](dctl::W) writer structure"] -impl crate::Writable for DCTL {} +#[doc = "DCTL register accessor: an alias for `Reg`"] +pub type DCTL = crate::Reg; #[doc = "Device Control Register"] pub mod dctl; -#[doc = "Device Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsts](dsts) module"] -pub type DSTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DSTS; -#[doc = "`read()` method returns [dsts::R](dsts::R) reader structure"] -impl crate::Readable for DSTS {} +#[doc = "DSTS register accessor: an alias for `Reg`"] +pub type DSTS = crate::Reg; #[doc = "Device Status Register"] pub mod dsts; -#[doc = "Device IN Endpoint Common Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepmsk](diepmsk) module"] -pub type DIEPMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPMSK; -#[doc = "`read()` method returns [diepmsk::R](diepmsk::R) reader structure"] -impl crate::Readable for DIEPMSK {} -#[doc = "`write(|w| ..)` method takes [diepmsk::W](diepmsk::W) writer structure"] -impl crate::Writable for DIEPMSK {} +#[doc = "DIEPMSK register accessor: an alias for `Reg`"] +pub type DIEPMSK = crate::Reg; #[doc = "Device IN Endpoint Common Interrupt Mask Register"] pub mod diepmsk; -#[doc = "Device OUT Endpoint Common Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepmsk](doepmsk) module"] -pub type DOEPMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPMSK; -#[doc = "`read()` method returns [doepmsk::R](doepmsk::R) reader structure"] -impl crate::Readable for DOEPMSK {} -#[doc = "`write(|w| ..)` method takes [doepmsk::W](doepmsk::W) writer structure"] -impl crate::Writable for DOEPMSK {} +#[doc = "DOEPMSK register accessor: an alias for `Reg`"] +pub type DOEPMSK = crate::Reg; #[doc = "Device OUT Endpoint Common Interrupt Mask Register"] pub mod doepmsk; -#[doc = "Device All Endpoints Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [daint](daint) module"] -pub type DAINT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAINT; -#[doc = "`read()` method returns [daint::R](daint::R) reader structure"] -impl crate::Readable for DAINT {} +#[doc = "DAINT register accessor: an alias for `Reg`"] +pub type DAINT = crate::Reg; #[doc = "Device All Endpoints Interrupt Register"] pub mod daint; -#[doc = "Device All Endpoints Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [daintmsk](daintmsk) module"] -pub type DAINTMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DAINTMSK; -#[doc = "`read()` method returns [daintmsk::R](daintmsk::R) reader structure"] -impl crate::Readable for DAINTMSK {} -#[doc = "`write(|w| ..)` method takes [daintmsk::W](daintmsk::W) writer structure"] -impl crate::Writable for DAINTMSK {} +#[doc = "DAINTMSK register accessor: an alias for `Reg`"] +pub type DAINTMSK = crate::Reg; #[doc = "Device All Endpoints Interrupt Mask Register"] pub mod daintmsk; -#[doc = "Device VBUS Discharge Time Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dvbusdis](dvbusdis) module"] -pub type DVBUSDIS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DVBUSDIS; -#[doc = "`read()` method returns [dvbusdis::R](dvbusdis::R) reader structure"] -impl crate::Readable for DVBUSDIS {} -#[doc = "`write(|w| ..)` method takes [dvbusdis::W](dvbusdis::W) writer structure"] -impl crate::Writable for DVBUSDIS {} +#[doc = "DVBUSDIS register accessor: an alias for `Reg`"] +pub type DVBUSDIS = crate::Reg; #[doc = "Device VBUS Discharge Time Register"] pub mod dvbusdis; -#[doc = "Device VBUS Pulsing Time Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dvbuspulse](dvbuspulse) module"] -pub type DVBUSPULSE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DVBUSPULSE; -#[doc = "`read()` method returns [dvbuspulse::R](dvbuspulse::R) reader structure"] -impl crate::Readable for DVBUSPULSE {} -#[doc = "`write(|w| ..)` method takes [dvbuspulse::W](dvbuspulse::W) writer structure"] -impl crate::Writable for DVBUSPULSE {} +#[doc = "DVBUSPULSE register accessor: an alias for `Reg`"] +pub type DVBUSPULSE = crate::Reg; #[doc = "Device VBUS Pulsing Time Register"] pub mod dvbuspulse; -#[doc = "Device IN Endpoint FIFO Empty Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepempmsk](diepempmsk) module"] -pub type DIEPEMPMSK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPEMPMSK; -#[doc = "`read()` method returns [diepempmsk::R](diepempmsk::R) reader structure"] -impl crate::Readable for DIEPEMPMSK {} -#[doc = "`write(|w| ..)` method takes [diepempmsk::W](diepempmsk::W) writer structure"] -impl crate::Writable for DIEPEMPMSK {} +#[doc = "DIEPEMPMSK register accessor: an alias for `Reg`"] +pub type DIEPEMPMSK = crate::Reg; #[doc = "Device IN Endpoint FIFO Empty Interrupt Mask Register"] pub mod diepempmsk; -#[doc = "Power and Clock Gating Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcgcctl](pcgcctl) module"] -pub type PCGCCTL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCGCCTL; -#[doc = "`read()` method returns [pcgcctl::R](pcgcctl::R) reader structure"] -impl crate::Readable for PCGCCTL {} -#[doc = "`write(|w| ..)` method takes [pcgcctl::W](pcgcctl::W) writer structure"] -impl crate::Writable for PCGCCTL {} +#[doc = "PCGCCTL register accessor: an alias for `Reg`"] +pub type PCGCCTL = crate::Reg; #[doc = "Power and Clock Gating Control Register"] pub mod pcgcctl; diff --git a/src/usb0/daint.rs b/src/usb0/daint.rs index 6c0e8687..3bed907b 100644 --- a/src/usb0/daint.rs +++ b/src/usb0/daint.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register DAINT"] -pub type R = crate::R; -#[doc = "Reader of field `InEpInt`"] -pub type INEPINT_R = crate::R; -#[doc = "Reader of field `OutEPInt`"] -pub type OUTEPINT_R = crate::R; +#[doc = "Register `DAINT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `InEpInt` reader - IN Endpoint Interrupt Bits"] +pub struct INEPINT_R(crate::FieldReader); +impl INEPINT_R { + pub(crate) fn new(bits: u16) -> Self { + INEPINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OutEPInt` reader - OUT Endpoint Interrupt Bits"] +pub struct OUTEPINT_R(crate::FieldReader); +impl OUTEPINT_R { + pub(crate) fn new(bits: u16) -> Self { + OUTEPINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTEPINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - IN Endpoint Interrupt Bits"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { OUTEPINT_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Device All Endpoints Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [daint](index.html) module"] +pub struct DAINT_SPEC; +impl crate::RegisterSpec for DAINT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [daint::R](R) reader structure"] +impl crate::Readable for DAINT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DAINT to value 0"] +impl crate::Resettable for DAINT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0/daintmsk.rs b/src/usb0/daintmsk.rs index 474bd3ed..97e46a22 100644 --- a/src/usb0/daintmsk.rs +++ b/src/usb0/daintmsk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DAINTMSK"] -pub type R = crate::R; -#[doc = "Writer for register DAINTMSK"] -pub type W = crate::W; -#[doc = "Register DAINTMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::DAINTMSK { - type Type = u32; +#[doc = "Register `DAINTMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAINTMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `InEpMsk` reader - IN EP Interrupt Mask Bits"] +pub struct INEPMSK_R(crate::FieldReader); +impl INEPMSK_R { + pub(crate) fn new(bits: u16) -> Self { + INEPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `InEpMsk`"] -pub type INEPMSK_R = crate::R; -#[doc = "Write proxy for field `InEpMsk`"] +#[doc = "Field `InEpMsk` writer - IN EP Interrupt Mask Bits"] pub struct INEPMSK_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `OutEpMsk`"] -pub type OUTEPMSK_R = crate::R; -#[doc = "Write proxy for field `OutEpMsk`"] +#[doc = "Field `OutEpMsk` reader - OUT EP Interrupt Mask Bits"] +pub struct OUTEPMSK_R(crate::FieldReader); +impl OUTEPMSK_R { + pub(crate) fn new(bits: u16) -> Self { + OUTEPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTEPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OutEpMsk` writer - OUT EP Interrupt Mask Bits"] pub struct OUTEPMSK_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> OUTEPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn out_ep_msk(&mut self) -> OUTEPMSK_W { OUTEPMSK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device All Endpoints Interrupt Mask Register\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 [daintmsk](index.html) module"] +pub struct DAINTMSK_SPEC; +impl crate::RegisterSpec for DAINTMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [daintmsk::R](R) reader structure"] +impl crate::Readable for DAINTMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [daintmsk::W](W) writer structure"] +impl crate::Writable for DAINTMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAINTMSK to value 0"] +impl crate::Resettable for DAINTMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/dcfg.rs b/src/usb0/dcfg.rs index be229569..c4a55fc2 100644 --- a/src/usb0/dcfg.rs +++ b/src/usb0/dcfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DCFG"] -pub type R = crate::R; -#[doc = "Writer for register DCFG"] -pub type W = crate::W; -#[doc = "Register DCFG `reset()`'s with value 0x0820_0000"] -impl crate::ResetValue for super::DCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0820_0000 +#[doc = "Register `DCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Device Speed\n\nValue on reset: 0"] @@ -23,25 +47,34 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DevSpd`"] -pub type DEVSPD_R = crate::R; +#[doc = "Field `DevSpd` reader - Device Speed"] +pub struct DEVSPD_R(crate::FieldReader); impl DEVSPD_R { + pub(crate) fn new(bits: u8) -> Self { + DEVSPD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 3 => Val(DEVSPD_A::VALUE4), - i => Res(i), + 3 => Some(DEVSPD_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DEVSPD_A::VALUE4 + **self == DEVSPD_A::VALUE4 } } -#[doc = "Write proxy for field `DevSpd`"] +impl core::ops::Deref for DEVSPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DevSpd` writer - Device Speed"] pub struct DEVSPD_W<'a> { w: &'a mut W, } @@ -59,7 +92,7 @@ impl<'a> DEVSPD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -77,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NZStsOUTHShk`"] -pub type NZSTSOUTHSHK_R = crate::R; +#[doc = "Field `NZStsOUTHShk` reader - Non-Zero-Length Status OUT Handshake"] +pub struct NZSTSOUTHSHK_R(crate::FieldReader); impl NZSTSOUTHSHK_R { + pub(crate) fn new(bits: bool) -> Self { + NZSTSOUTHSHK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NZSTSOUTHSHK_A { @@ -91,15 +127,22 @@ impl NZSTSOUTHSHK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NZSTSOUTHSHK_A::VALUE1 + **self == NZSTSOUTHSHK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NZSTSOUTHSHK_A::VALUE2 + **self == NZSTSOUTHSHK_A::VALUE2 } } -#[doc = "Write proxy for field `NZStsOUTHShk`"] +impl core::ops::Deref for NZSTSOUTHSHK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NZStsOUTHShk` writer - Non-Zero-Length Status OUT Handshake"] pub struct NZSTSOUTHSHK_W<'a> { w: &'a mut W, } @@ -107,9 +150,7 @@ impl<'a> NZSTSOUTHSHK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NZSTSOUTHSHK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Send a STALL handshake on a nonzero-length status OUT transaction and do not send the received OUT packet to the application."] #[inline(always)] @@ -134,13 +175,25 @@ impl<'a> NZSTSOUTHSHK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `DevAddr`"] -pub type DEVADDR_R = crate::R; -#[doc = "Write proxy for field `DevAddr`"] +#[doc = "Field `DevAddr` reader - Device Address"] +pub struct DEVADDR_R(crate::FieldReader); +impl DEVADDR_R { + pub(crate) fn new(bits: u8) -> Self { + DEVADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEVADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DevAddr` writer - Device Address"] pub struct DEVADDR_W<'a> { w: &'a mut W, } @@ -148,7 +201,7 @@ impl<'a> DEVADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x7f << 4)) | (((value as u32) & 0x7f) << 4); + self.w.bits = (self.w.bits & !(0x7f << 4)) | ((value as u32 & 0x7f) << 4); self.w } } @@ -171,9 +224,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PerFrInt`"] -pub type PERFRINT_R = crate::R; +#[doc = "Field `PerFrInt` reader - Periodic Frame Interval"] +pub struct PERFRINT_R(crate::FieldReader); impl PERFRINT_R { + pub(crate) fn new(bits: u8) -> Self { + PERFRINT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PERFRINT_A { @@ -188,25 +244,32 @@ impl PERFRINT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PERFRINT_A::VALUE1 + **self == PERFRINT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PERFRINT_A::VALUE2 + **self == PERFRINT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PERFRINT_A::VALUE3 + **self == PERFRINT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PERFRINT_A::VALUE4 + **self == PERFRINT_A::VALUE4 } } -#[doc = "Write proxy for field `PerFrInt`"] +impl core::ops::Deref for PERFRINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PerFrInt` writer - Periodic Frame Interval"] pub struct PERFRINT_W<'a> { w: &'a mut W, } @@ -214,9 +277,7 @@ impl<'a> PERFRINT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PERFRINT_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "80% of the frame interval"] #[inline(always)] @@ -241,13 +302,25 @@ impl<'a> PERFRINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 11)) | (((value as u32) & 0x03) << 11); + self.w.bits = (self.w.bits & !(0x03 << 11)) | ((value as u32 & 0x03) << 11); self.w } } -#[doc = "Reader of field `DescDMA`"] -pub type DESCDMA_R = crate::R; -#[doc = "Write proxy for field `DescDMA`"] +#[doc = "Field `DescDMA` reader - Enable Scatter/Gather DMA in Device mode."] +pub struct DESCDMA_R(crate::FieldReader); +impl DESCDMA_R { + pub(crate) fn new(bits: bool) -> Self { + DESCDMA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DESCDMA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DescDMA` writer - Enable Scatter/Gather DMA in Device mode."] pub struct DESCDMA_W<'a> { w: &'a mut W, } @@ -265,7 +338,7 @@ impl<'a> DESCDMA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -286,37 +359,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PerSchIntvl`"] -pub type PERSCHINTVL_R = crate::R; +#[doc = "Field `PerSchIntvl` reader - Periodic Scheduling Interval"] +pub struct PERSCHINTVL_R(crate::FieldReader); impl PERSCHINTVL_R { + pub(crate) fn new(bits: u8) -> Self { + PERSCHINTVL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PERSCHINTVL_A::VALUE1), - 1 => Val(PERSCHINTVL_A::VALUE2), - 2 => Val(PERSCHINTVL_A::VALUE3), - i => Res(i), + 0 => Some(PERSCHINTVL_A::VALUE1), + 1 => Some(PERSCHINTVL_A::VALUE2), + 2 => Some(PERSCHINTVL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PERSCHINTVL_A::VALUE1 + **self == PERSCHINTVL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PERSCHINTVL_A::VALUE2 + **self == PERSCHINTVL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PERSCHINTVL_A::VALUE3 + **self == PERSCHINTVL_A::VALUE3 } } -#[doc = "Write proxy for field `PerSchIntvl`"] +impl core::ops::Deref for PERSCHINTVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PerSchIntvl` writer - Periodic Scheduling Interval"] pub struct PERSCHINTVL_W<'a> { w: &'a mut W, } @@ -344,7 +426,7 @@ impl<'a> PERSCHINTVL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24); + self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24); self.w } } @@ -411,4 +493,30 @@ impl W { pub fn per_sch_intvl(&mut self) -> PERSCHINTVL_W { PERSCHINTVL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Configuration Register\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 [dcfg](index.html) module"] +pub struct DCFG_SPEC; +impl crate::RegisterSpec for DCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dcfg::R](R) reader structure"] +impl crate::Readable for DCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dcfg::W](W) writer structure"] +impl crate::Writable for DCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DCFG to value 0x0820_0000"] +impl crate::Resettable for DCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0820_0000 + } } diff --git a/src/usb0/dctl.rs b/src/usb0/dctl.rs index 57b3dfa8..81a09c97 100644 --- a/src/usb0/dctl.rs +++ b/src/usb0/dctl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DCTL"] -pub type R = crate::R; -#[doc = "Writer for register DCTL"] -pub type W = crate::W; -#[doc = "Register DCTL `reset()`'s with value 0x02"] -impl crate::ResetValue for super::DCTL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x02 +#[doc = "Register `DCTL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DCTL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RmtWkUpSig` reader - Remote Wakeup Signaling"] +pub struct RMTWKUPSIG_R(crate::FieldReader); +impl RMTWKUPSIG_R { + pub(crate) fn new(bits: bool) -> Self { + RMTWKUPSIG_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `RmtWkUpSig`"] -pub type RMTWKUPSIG_R = crate::R; -#[doc = "Write proxy for field `RmtWkUpSig`"] +impl core::ops::Deref for RMTWKUPSIG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RmtWkUpSig` writer - Remote Wakeup Signaling"] pub struct RMTWKUPSIG_W<'a> { w: &'a mut W, } @@ -30,7 +66,7 @@ impl<'a> RMTWKUPSIG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -48,9 +84,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SftDiscon`"] -pub type SFTDISCON_R = crate::R; +#[doc = "Field `SftDiscon` reader - Soft Disconnect"] +pub struct SFTDISCON_R(crate::FieldReader); impl SFTDISCON_R { + pub(crate) fn new(bits: bool) -> Self { + SFTDISCON_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFTDISCON_A { @@ -62,15 +101,22 @@ impl SFTDISCON_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFTDISCON_A::VALUE1 + **self == SFTDISCON_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFTDISCON_A::VALUE2 + **self == SFTDISCON_A::VALUE2 } } -#[doc = "Write proxy for field `SftDiscon`"] +impl core::ops::Deref for SFTDISCON_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SftDiscon` writer - Soft Disconnect"] pub struct SFTDISCON_W<'a> { w: &'a mut W, } @@ -78,9 +124,7 @@ impl<'a> SFTDISCON_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFTDISCON_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal operation. When this bit is cleared after a soft disconnect, the core drives a device connect event to the USB host. When the device is reconnected, the USB host restarts device enumeration."] #[inline(always)] @@ -105,7 +149,7 @@ impl<'a> SFTDISCON_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -123,9 +167,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GNPINNakSts`"] -pub type GNPINNAKSTS_R = crate::R; +#[doc = "Field `GNPINNakSts` reader - Global Non-periodic IN NAK Status"] +pub struct GNPINNAKSTS_R(crate::FieldReader); impl GNPINNAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + GNPINNAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GNPINNAKSTS_A { @@ -137,12 +184,19 @@ impl GNPINNAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GNPINNAKSTS_A::VALUE1 + **self == GNPINNAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GNPINNAKSTS_A::VALUE2 + **self == GNPINNAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for GNPINNAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Global OUT NAK Status\n\nValue on reset: 0"] @@ -159,9 +213,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GOUTNakSts`"] -pub type GOUTNAKSTS_R = crate::R; +#[doc = "Field `GOUTNakSts` reader - Global OUT NAK Status"] +pub struct GOUTNAKSTS_R(crate::FieldReader); impl GOUTNAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + GOUTNAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GOUTNAKSTS_A { @@ -173,15 +230,22 @@ impl GOUTNAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GOUTNAKSTS_A::VALUE1 + **self == GOUTNAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GOUTNAKSTS_A::VALUE2 + **self == GOUTNAKSTS_A::VALUE2 } } -#[doc = "Write proxy for field `SGNPInNak`"] +impl core::ops::Deref for GOUTNAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SGNPInNak` writer - Set Global Non-periodic IN NAK"] pub struct SGNPINNAK_W<'a> { w: &'a mut W, } @@ -199,11 +263,11 @@ impl<'a> SGNPINNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Write proxy for field `CGNPInNak`"] +#[doc = "Field `CGNPInNak` writer - Clear Global Non-periodic IN NAK"] pub struct CGNPINNAK_W<'a> { w: &'a mut W, } @@ -221,11 +285,11 @@ impl<'a> CGNPINNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Write proxy for field `SGOUTNak`"] +#[doc = "Field `SGOUTNak` writer - Set Global OUT NAK"] pub struct SGOUTNAK_W<'a> { w: &'a mut W, } @@ -243,11 +307,11 @@ impl<'a> SGOUTNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Write proxy for field `CGOUTNak`"] +#[doc = "Field `CGOUTNak` writer - Clear Global OUT NAK"] pub struct CGOUTNAK_W<'a> { w: &'a mut W, } @@ -265,7 +329,7 @@ impl<'a> CGOUTNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -288,9 +352,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `GMC`"] -pub type GMC_R = crate::R; +#[doc = "Field `GMC` reader - Global Multi Count"] +pub struct GMC_R(crate::FieldReader); impl GMC_R { + pub(crate) fn new(bits: u8) -> Self { + GMC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GMC_A { @@ -305,25 +372,32 @@ impl GMC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GMC_A::VALUE1 + **self == GMC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GMC_A::VALUE2 + **self == GMC_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == GMC_A::VALUE3 + **self == GMC_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == GMC_A::VALUE4 + **self == GMC_A::VALUE4 + } +} +impl core::ops::Deref for GMC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GMC`"] +#[doc = "Field `GMC` writer - Global Multi Count"] pub struct GMC_W<'a> { w: &'a mut W, } @@ -331,9 +405,7 @@ impl<'a> GMC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GMC_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Invalid."] #[inline(always)] @@ -358,7 +430,7 @@ impl<'a> GMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -376,9 +448,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IgnrFrmNum`"] -pub type IGNRFRMNUM_R = crate::R; +#[doc = "Field `IgnrFrmNum` reader - Ignore frame number for isochronous endpoints in case of Scatter/Gather DMA"] +pub struct IGNRFRMNUM_R(crate::FieldReader); impl IGNRFRMNUM_R { + pub(crate) fn new(bits: bool) -> Self { + IGNRFRMNUM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IGNRFRMNUM_A { @@ -390,15 +465,22 @@ impl IGNRFRMNUM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IGNRFRMNUM_A::VALUE1 + **self == IGNRFRMNUM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IGNRFRMNUM_A::VALUE2 + **self == IGNRFRMNUM_A::VALUE2 } } -#[doc = "Write proxy for field `IgnrFrmNum`"] +impl core::ops::Deref for IGNRFRMNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IgnrFrmNum` writer - Ignore frame number for isochronous endpoints in case of Scatter/Gather DMA"] pub struct IGNRFRMNUM_W<'a> { w: &'a mut W, } @@ -406,9 +488,7 @@ impl<'a> IGNRFRMNUM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IGNRFRMNUM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Scatter/Gather enabled: The core transmits the packets only in the frame number in which they are intended to be transmitted. Scatter/Gather disabled: Periodic transfer interrupt feature is disabled; the application must program transfers for periodic endpoints every frame"] #[inline(always)] @@ -433,13 +513,25 @@ impl<'a> IGNRFRMNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `NakOnBble`"] -pub type NAKONBBLE_R = crate::R; -#[doc = "Write proxy for field `NakOnBble`"] +#[doc = "Field `NakOnBble` reader - Set NAK automatically on babble"] +pub struct NAKONBBLE_R(crate::FieldReader); +impl NAKONBBLE_R { + pub(crate) fn new(bits: bool) -> Self { + NAKONBBLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NAKONBBLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NakOnBble` writer - Set NAK automatically on babble"] pub struct NAKONBBLE_W<'a> { w: &'a mut W, } @@ -457,7 +549,7 @@ impl<'a> NAKONBBLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -475,9 +567,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EnContOnBNA`"] -pub type ENCONTONBNA_R = crate::R; +#[doc = "Field `EnContOnBNA` reader - Enable continue on BNA"] +pub struct ENCONTONBNA_R(crate::FieldReader); impl ENCONTONBNA_R { + pub(crate) fn new(bits: bool) -> Self { + ENCONTONBNA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENCONTONBNA_A { @@ -489,15 +584,22 @@ impl ENCONTONBNA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENCONTONBNA_A::VALUE1 + **self == ENCONTONBNA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENCONTONBNA_A::VALUE2 + **self == ENCONTONBNA_A::VALUE2 + } +} +impl core::ops::Deref for ENCONTONBNA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EnContOnBNA`"] +#[doc = "Field `EnContOnBNA` writer - Enable continue on BNA"] pub struct ENCONTONBNA_W<'a> { w: &'a mut W, } @@ -505,9 +607,7 @@ impl<'a> ENCONTONBNA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENCONTONBNA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "After receiving BNA interrupt, the core disables the endpoint. When the endpoint is re-enabled by the application, the core starts processing from the DOEPDMA descriptor."] #[inline(always)] @@ -532,7 +632,7 @@ impl<'a> ENCONTONBNA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -629,4 +729,30 @@ impl W { pub fn en_cont_on_bna(&mut self) -> ENCONTONBNA_W { ENCONTONBNA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Control Register\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 [dctl](index.html) module"] +pub struct DCTL_SPEC; +impl crate::RegisterSpec for DCTL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dctl::R](R) reader structure"] +impl crate::Readable for DCTL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dctl::W](W) writer structure"] +impl crate::Writable for DCTL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DCTL to value 0x02"] +impl crate::Resettable for DCTL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } } diff --git a/src/usb0/diepempmsk.rs b/src/usb0/diepempmsk.rs index e3bf06fe..54796d7d 100644 --- a/src/usb0/diepempmsk.rs +++ b/src/usb0/diepempmsk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPEMPMSK"] -pub type R = crate::R; -#[doc = "Writer for register DIEPEMPMSK"] -pub type W = crate::W; -#[doc = "Register DIEPEMPMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPEMPMSK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPEMPMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPEMPMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `InEpTxfEmpMsk`"] -pub type INEPTXFEMPMSK_R = crate::R; -#[doc = "Write proxy for field `InEpTxfEmpMsk`"] +#[doc = "Field `InEpTxfEmpMsk` reader - IN EP Tx FIFO Empty Interrupt Mask Bits"] +pub struct INEPTXFEMPMSK_R(crate::FieldReader); +impl INEPTXFEMPMSK_R { + pub(crate) fn new(bits: u16) -> Self { + INEPTXFEMPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPTXFEMPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `InEpTxfEmpMsk` writer - IN EP Tx FIFO Empty Interrupt Mask Bits"] pub struct INEPTXFEMPMSK_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> INEPTXFEMPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn in_ep_txf_emp_msk(&mut self) -> INEPTXFEMPMSK_W { INEPTXFEMPMSK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint FIFO Empty Interrupt Mask Register\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 [diepempmsk](index.html) module"] +pub struct DIEPEMPMSK_SPEC; +impl crate::RegisterSpec for DIEPEMPMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepempmsk::R](R) reader structure"] +impl crate::Readable for DIEPEMPMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepempmsk::W](W) writer structure"] +impl crate::Writable for DIEPEMPMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPEMPMSK to value 0"] +impl crate::Resettable for DIEPEMPMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/diepmsk.rs b/src/usb0/diepmsk.rs index f9c6b403..ea45b7d3 100644 --- a/src/usb0/diepmsk.rs +++ b/src/usb0/diepmsk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPMSK"] -pub type R = crate::R; -#[doc = "Writer for register DIEPMSK"] -pub type W = crate::W; -#[doc = "Register DIEPMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPMSK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferComplMsk` reader - Transfer Completed Interrupt Mask"] +pub struct XFERCOMPLMSK_R(crate::FieldReader); +impl XFERCOMPLMSK_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPLMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERCOMPLMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferComplMsk`"] -pub type XFERCOMPLMSK_R = crate::R; -#[doc = "Write proxy for field `XferComplMsk`"] +#[doc = "Field `XferComplMsk` writer - Transfer Completed Interrupt Mask"] pub struct XFERCOMPLMSK_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPLMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbldMsk`"] -pub type EPDISBLDMSK_R = crate::R; -#[doc = "Write proxy for field `EPDisbldMsk`"] +#[doc = "Field `EPDisbldMsk` reader - Endpoint Disabled Interrupt Mask"] +pub struct EPDISBLDMSK_R(crate::FieldReader); +impl EPDISBLDMSK_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLDMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLDMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbldMsk` writer - Endpoint Disabled Interrupt Mask"] pub struct EPDISBLDMSK_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLDMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErrMsk`"] -pub type AHBERRMSK_R = crate::R; -#[doc = "Write proxy for field `AHBErrMsk`"] +#[doc = "Field `AHBErrMsk` reader - AHB Error Mask"] +pub struct AHBERRMSK_R(crate::FieldReader); +impl AHBERRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErrMsk` writer - AHB Error Mask"] pub struct AHBERRMSK_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `TimeOUTMsk`"] -pub type TIMEOUTMSK_R = crate::R; -#[doc = "Write proxy for field `TimeOUTMsk`"] +#[doc = "Field `TimeOUTMsk` reader - Timeout Condition Mask"] +pub struct TIMEOUTMSK_R(crate::FieldReader); +impl TIMEOUTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + TIMEOUTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TIMEOUTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TimeOUTMsk` writer - Timeout Condition Mask"] pub struct TIMEOUTMSK_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> TIMEOUTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `INTknTXFEmpMsk`"] -pub type INTKNTXFEMPMSK_R = crate::R; -#[doc = "Write proxy for field `INTknTXFEmpMsk`"] +#[doc = "Field `INTknTXFEmpMsk` reader - IN Token Received When TxFIFO Empty Mask"] +pub struct INTKNTXFEMPMSK_R(crate::FieldReader); +impl INTKNTXFEMPMSK_R { + pub(crate) fn new(bits: bool) -> Self { + INTKNTXFEMPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INTKNTXFEMPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INTknTXFEmpMsk` writer - IN Token Received When TxFIFO Empty Mask"] pub struct INTKNTXFEMPMSK_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> INTKNTXFEMPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `INEPNakEffMsk`"] -pub type INEPNAKEFFMSK_R = crate::R; -#[doc = "Write proxy for field `INEPNakEffMsk`"] +#[doc = "Field `INEPNakEffMsk` reader - IN Endpoint NAK Effective Mask"] +pub struct INEPNAKEFFMSK_R(crate::FieldReader); +impl INEPNAKEFFMSK_R { + pub(crate) fn new(bits: bool) -> Self { + INEPNAKEFFMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNAKEFFMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPNakEffMsk` writer - IN Endpoint NAK Effective Mask"] pub struct INEPNAKEFFMSK_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> INEPNAKEFFMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `TxfifoUndrnMsk`"] -pub type TXFIFOUNDRNMSK_R = crate::R; -#[doc = "Write proxy for field `TxfifoUndrnMsk`"] +#[doc = "Field `TxfifoUndrnMsk` reader - Fifo Underrun Mask"] +pub struct TXFIFOUNDRNMSK_R(crate::FieldReader); +impl TXFIFOUNDRNMSK_R { + pub(crate) fn new(bits: bool) -> Self { + TXFIFOUNDRNMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFIFOUNDRNMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxfifoUndrnMsk` writer - Fifo Underrun Mask"] pub struct TXFIFOUNDRNMSK_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> TXFIFOUNDRNMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `BNAInIntrMsk`"] -pub type BNAININTRMSK_R = crate::R; -#[doc = "Write proxy for field `BNAInIntrMsk`"] +#[doc = "Field `BNAInIntrMsk` reader - BNA Interrupt Mask"] +pub struct BNAININTRMSK_R(crate::FieldReader); +impl BNAININTRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + BNAININTRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAININTRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAInIntrMsk` writer - BNA Interrupt Mask"] pub struct BNAININTRMSK_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> BNAININTRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `NAKMsk`"] -pub type NAKMSK_R = crate::R; -#[doc = "Write proxy for field `NAKMsk`"] +#[doc = "Field `NAKMsk` reader - NAK interrupt Mask"] +pub struct NAKMSK_R(crate::FieldReader); +impl NAKMSK_R { + pub(crate) fn new(bits: bool) -> Self { + NAKMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NAKMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NAKMsk` writer - NAK interrupt Mask"] pub struct NAKMSK_W<'a> { w: &'a mut W, } @@ -222,7 +354,7 @@ impl<'a> NAKMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -319,4 +451,30 @@ impl W { pub fn nakmsk(&mut self) -> NAKMSK_W { NAKMSK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint Common Interrupt Mask Register\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 [diepmsk](index.html) module"] +pub struct DIEPMSK_SPEC; +impl crate::RegisterSpec for DIEPMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepmsk::R](R) reader structure"] +impl crate::Readable for DIEPMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepmsk::W](W) writer structure"] +impl crate::Writable for DIEPMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPMSK to value 0"] +impl crate::Resettable for DIEPMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/dieptxf1.rs b/src/usb0/dieptxf1.rs index e45611a8..2d744d7a 100644 --- a/src/usb0/dieptxf1.rs +++ b/src/usb0/dieptxf1.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF1"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF1"] -pub type W = crate::W; -#[doc = "Register DIEPTXF1 `reset()`'s with value 0x0100_012a"] -impl crate::ResetValue for super::DIEPTXF1 { - type Type = u32; +#[doc = "Register `DIEPTXF1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_012a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 1 Transmit FIFO Size Register\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 [dieptxf1](index.html) module"] +pub struct DIEPTXF1_SPEC; +impl crate::RegisterSpec for DIEPTXF1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf1::R](R) reader structure"] +impl crate::Readable for DIEPTXF1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf1::W](W) writer structure"] +impl crate::Writable for DIEPTXF1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF1 to value 0x0100_012a"] +impl crate::Resettable for DIEPTXF1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_012a + } } diff --git a/src/usb0/dieptxf2.rs b/src/usb0/dieptxf2.rs index f438ee60..d5c8fc1e 100644 --- a/src/usb0/dieptxf2.rs +++ b/src/usb0/dieptxf2.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF2"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF2"] -pub type W = crate::W; -#[doc = "Register DIEPTXF2 `reset()`'s with value 0x0100_022a"] -impl crate::ResetValue for super::DIEPTXF2 { - type Type = u32; +#[doc = "Register `DIEPTXF2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_022a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 2 Transmit FIFO Size Register\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 [dieptxf2](index.html) module"] +pub struct DIEPTXF2_SPEC; +impl crate::RegisterSpec for DIEPTXF2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf2::R](R) reader structure"] +impl crate::Readable for DIEPTXF2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf2::W](W) writer structure"] +impl crate::Writable for DIEPTXF2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF2 to value 0x0100_022a"] +impl crate::Resettable for DIEPTXF2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_022a + } } diff --git a/src/usb0/dieptxf3.rs b/src/usb0/dieptxf3.rs index eb6b20e4..63988b3d 100644 --- a/src/usb0/dieptxf3.rs +++ b/src/usb0/dieptxf3.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF3"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF3"] -pub type W = crate::W; -#[doc = "Register DIEPTXF3 `reset()`'s with value 0x0100_032a"] -impl crate::ResetValue for super::DIEPTXF3 { - type Type = u32; +#[doc = "Register `DIEPTXF3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_032a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 3 Transmit FIFO Size Register\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 [dieptxf3](index.html) module"] +pub struct DIEPTXF3_SPEC; +impl crate::RegisterSpec for DIEPTXF3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf3::R](R) reader structure"] +impl crate::Readable for DIEPTXF3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf3::W](W) writer structure"] +impl crate::Writable for DIEPTXF3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF3 to value 0x0100_032a"] +impl crate::Resettable for DIEPTXF3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_032a + } } diff --git a/src/usb0/dieptxf4.rs b/src/usb0/dieptxf4.rs index 647299cd..84634d35 100644 --- a/src/usb0/dieptxf4.rs +++ b/src/usb0/dieptxf4.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF4"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF4"] -pub type W = crate::W; -#[doc = "Register DIEPTXF4 `reset()`'s with value 0x0100_042a"] -impl crate::ResetValue for super::DIEPTXF4 { - type Type = u32; +#[doc = "Register `DIEPTXF4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_042a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 4 Transmit FIFO Size Register\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 [dieptxf4](index.html) module"] +pub struct DIEPTXF4_SPEC; +impl crate::RegisterSpec for DIEPTXF4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf4::R](R) reader structure"] +impl crate::Readable for DIEPTXF4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf4::W](W) writer structure"] +impl crate::Writable for DIEPTXF4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF4 to value 0x0100_042a"] +impl crate::Resettable for DIEPTXF4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_042a + } } diff --git a/src/usb0/dieptxf5.rs b/src/usb0/dieptxf5.rs index 3824e01e..46ee5815 100644 --- a/src/usb0/dieptxf5.rs +++ b/src/usb0/dieptxf5.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF5"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF5"] -pub type W = crate::W; -#[doc = "Register DIEPTXF5 `reset()`'s with value 0x0100_052a"] -impl crate::ResetValue for super::DIEPTXF5 { - type Type = u32; +#[doc = "Register `DIEPTXF5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_052a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF5` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 5 Transmit FIFO Size Register\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 [dieptxf5](index.html) module"] +pub struct DIEPTXF5_SPEC; +impl crate::RegisterSpec for DIEPTXF5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf5::R](R) reader structure"] +impl crate::Readable for DIEPTXF5_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf5::W](W) writer structure"] +impl crate::Writable for DIEPTXF5_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF5 to value 0x0100_052a"] +impl crate::Resettable for DIEPTXF5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_052a + } } diff --git a/src/usb0/dieptxf6.rs b/src/usb0/dieptxf6.rs index f50a023e..f821bde4 100644 --- a/src/usb0/dieptxf6.rs +++ b/src/usb0/dieptxf6.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTXF6"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTXF6"] -pub type W = crate::W; -#[doc = "Register DIEPTXF6 `reset()`'s with value 0x0100_062a"] -impl crate::ResetValue for super::DIEPTXF6 { - type Type = u32; +#[doc = "Register `DIEPTXF6` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100_062a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTXF6` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] +pub struct INEPNTXFSTADDR_R(crate::FieldReader); +impl INEPNTXFSTADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFSTADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFSTADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPnTxFStAddr`"] -pub type INEPNTXFSTADDR_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFStAddr`"] +#[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] pub struct INEPNTXFSTADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPNTXFSTADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPnTxFDep`"] -pub type INEPNTXFDEP_R = crate::R; -#[doc = "Write proxy for field `INEPnTxFDep`"] +#[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] +pub struct INEPNTXFDEP_R(crate::FieldReader); +impl INEPNTXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPNTXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNTXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] pub struct INEPNTXFDEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPNTXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn inepn_tx_fdep(&mut self) -> INEPNTXFDEP_W { INEPNTXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint 6 Transmit FIFO Size Register\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 [dieptxf6](index.html) module"] +pub struct DIEPTXF6_SPEC; +impl crate::RegisterSpec for DIEPTXF6_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptxf6::R](R) reader structure"] +impl crate::Readable for DIEPTXF6_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptxf6::W](W) writer structure"] +impl crate::Writable for DIEPTXF6_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTXF6 to value 0x0100_062a"] +impl crate::Resettable for DIEPTXF6_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100_062a + } } diff --git a/src/usb0/doepmsk.rs b/src/usb0/doepmsk.rs index dfc1a85c..54be0633 100644 --- a/src/usb0/doepmsk.rs +++ b/src/usb0/doepmsk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPMSK"] -pub type R = crate::R; -#[doc = "Writer for register DOEPMSK"] -pub type W = crate::W; -#[doc = "Register DOEPMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPMSK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferComplMsk` reader - Transfer Completed Interrupt Mask"] +pub struct XFERCOMPLMSK_R(crate::FieldReader); +impl XFERCOMPLMSK_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPLMSK_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `XferComplMsk`"] -pub type XFERCOMPLMSK_R = crate::R; -#[doc = "Write proxy for field `XferComplMsk`"] +impl core::ops::Deref for XFERCOMPLMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XferComplMsk` writer - Transfer Completed Interrupt Mask"] pub struct XFERCOMPLMSK_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPLMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbldMsk`"] -pub type EPDISBLDMSK_R = crate::R; -#[doc = "Write proxy for field `EPDisbldMsk`"] +#[doc = "Field `EPDisbldMsk` reader - Endpoint Disabled Interrupt Mask"] +pub struct EPDISBLDMSK_R(crate::FieldReader); +impl EPDISBLDMSK_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLDMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLDMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbldMsk` writer - Endpoint Disabled Interrupt Mask"] pub struct EPDISBLDMSK_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLDMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErrMsk`"] -pub type AHBERRMSK_R = crate::R; -#[doc = "Write proxy for field `AHBErrMsk`"] +#[doc = "Field `AHBErrMsk` reader - AHB Error"] +pub struct AHBERRMSK_R(crate::FieldReader); +impl AHBERRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErrMsk` writer - AHB Error"] pub struct AHBERRMSK_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `SetUPMsk`"] -pub type SETUPMSK_R = crate::R; -#[doc = "Write proxy for field `SetUPMsk`"] +#[doc = "Field `SetUPMsk` reader - SETUP Phase Done Mask"] +pub struct SETUPMSK_R(crate::FieldReader); +impl SETUPMSK_R { + pub(crate) fn new(bits: bool) -> Self { + SETUPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SETUPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SetUPMsk` writer - SETUP Phase Done Mask"] pub struct SETUPMSK_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> SETUPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `OUTTknEPdisMsk`"] -pub type OUTTKNEPDISMSK_R = crate::R; -#[doc = "Write proxy for field `OUTTknEPdisMsk`"] +#[doc = "Field `OUTTknEPdisMsk` reader - OUT Token Received when Endpoint Disabled Mask"] +pub struct OUTTKNEPDISMSK_R(crate::FieldReader); +impl OUTTKNEPDISMSK_R { + pub(crate) fn new(bits: bool) -> Self { + OUTTKNEPDISMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTTKNEPDISMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OUTTknEPdisMsk` writer - OUT Token Received when Endpoint Disabled Mask"] pub struct OUTTKNEPDISMSK_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> OUTTKNEPDISMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `Back2BackSETup`"] -pub type BACK2BACKSETUP_R = crate::R; -#[doc = "Write proxy for field `Back2BackSETup`"] +#[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received Mask"] +pub struct BACK2BACKSETUP_R(crate::FieldReader); +impl BACK2BACKSETUP_R { + pub(crate) fn new(bits: bool) -> Self { + BACK2BACKSETUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BACK2BACKSETUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received Mask"] pub struct BACK2BACKSETUP_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> BACK2BACKSETUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `OutPktErrMsk`"] -pub type OUTPKTERRMSK_R = crate::R; -#[doc = "Write proxy for field `OutPktErrMsk`"] +#[doc = "Field `OutPktErrMsk` reader - OUT Packet Error Mask"] +pub struct OUTPKTERRMSK_R(crate::FieldReader); +impl OUTPKTERRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + OUTPKTERRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTPKTERRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OutPktErrMsk` writer - OUT Packet Error Mask"] pub struct OUTPKTERRMSK_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> OUTPKTERRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `BnaOutIntrMsk`"] -pub type BNAOUTINTRMSK_R = crate::R; -#[doc = "Write proxy for field `BnaOutIntrMsk`"] +#[doc = "Field `BnaOutIntrMsk` reader - BNA interrupt Mask"] +pub struct BNAOUTINTRMSK_R(crate::FieldReader); +impl BNAOUTINTRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + BNAOUTINTRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAOUTINTRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BnaOutIntrMsk` writer - BNA interrupt Mask"] pub struct BNAOUTINTRMSK_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> BNAOUTINTRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `BbleErrMsk`"] -pub type BBLEERRMSK_R = crate::R; -#[doc = "Write proxy for field `BbleErrMsk`"] +#[doc = "Field `BbleErrMsk` reader - Babble Interrupt Mask"] +pub struct BBLEERRMSK_R(crate::FieldReader); +impl BBLEERRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + BBLEERRMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BBLEERRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BbleErrMsk` writer - Babble Interrupt Mask"] pub struct BBLEERRMSK_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> BBLEERRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `NAKMsk`"] -pub type NAKMSK_R = crate::R; -#[doc = "Write proxy for field `NAKMsk`"] +#[doc = "Field `NAKMsk` reader - NAK Interrupt Mask"] +pub struct NAKMSK_R(crate::FieldReader); +impl NAKMSK_R { + pub(crate) fn new(bits: bool) -> Self { + NAKMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NAKMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NAKMsk` writer - NAK Interrupt Mask"] pub struct NAKMSK_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> NAKMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `NYETMsk`"] -pub type NYETMSK_R = crate::R; -#[doc = "Write proxy for field `NYETMsk`"] +#[doc = "Field `NYETMsk` reader - NYET Interrupt Mask"] +pub struct NYETMSK_R(crate::FieldReader); +impl NYETMSK_R { + pub(crate) fn new(bits: bool) -> Self { + NYETMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NYETMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NYETMsk` writer - NYET Interrupt Mask"] pub struct NYETMSK_W<'a> { w: &'a mut W, } @@ -270,7 +426,7 @@ impl<'a> NYETMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -387,4 +543,30 @@ impl W { pub fn nyetmsk(&mut self) -> NYETMSK_W { NYETMSK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device OUT Endpoint Common Interrupt Mask Register\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 [doepmsk](index.html) module"] +pub struct DOEPMSK_SPEC; +impl crate::RegisterSpec for DOEPMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepmsk::R](R) reader structure"] +impl crate::Readable for DOEPMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepmsk::W](W) writer structure"] +impl crate::Writable for DOEPMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPMSK to value 0"] +impl crate::Resettable for DOEPMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/dsts.rs b/src/usb0/dsts.rs index 1b85b4bc..4f25d7e5 100644 --- a/src/usb0/dsts.rs +++ b/src/usb0/dsts.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DSTS"] -pub type R = crate::R; -#[doc = "Reader of field `SuspSts`"] -pub type SUSPSTS_R = crate::R; +#[doc = "Register `DSTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `SuspSts` reader - Suspend Status"] +pub struct SUSPSTS_R(crate::FieldReader); +impl SUSPSTS_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPSTS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SUSPSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Enumerated Speed\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -15,28 +40,61 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EnumSpd`"] -pub type ENUMSPD_R = crate::R; +#[doc = "Field `EnumSpd` reader - Enumerated Speed"] +pub struct ENUMSPD_R(crate::FieldReader); impl ENUMSPD_R { + pub(crate) fn new(bits: u8) -> Self { + ENUMSPD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 3 => Val(ENUMSPD_A::VALUE4), - i => Res(i), + 3 => Some(ENUMSPD_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENUMSPD_A::VALUE4 + **self == ENUMSPD_A::VALUE4 + } +} +impl core::ops::Deref for ENUMSPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ErrticErr` reader - Erratic Error"] +pub struct ERRTICERR_R(crate::FieldReader); +impl ERRTICERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERRTICERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERRTICERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SOFFN` reader - Frame Number of the Received SOF"] +pub struct SOFFN_R(crate::FieldReader); +impl SOFFN_R { + pub(crate) fn new(bits: u16) -> Self { + SOFFN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SOFFN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ErrticErr`"] -pub type ERRTICERR_R = crate::R; -#[doc = "Reader of field `SOFFN`"] -pub type SOFFN_R = crate::R; impl R { #[doc = "Bit 0 - Suspend Status"] #[inline(always)] @@ -59,3 +117,19 @@ impl R { SOFFN_R::new(((self.bits >> 8) & 0x3fff) as u16) } } +#[doc = "Device Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dsts](index.html) module"] +pub struct DSTS_SPEC; +impl crate::RegisterSpec for DSTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dsts::R](R) reader structure"] +impl crate::Readable for DSTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DSTS to value 0x02"] +impl crate::Resettable for DSTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } +} diff --git a/src/usb0/dvbusdis.rs b/src/usb0/dvbusdis.rs index d524139c..1a54e980 100644 --- a/src/usb0/dvbusdis.rs +++ b/src/usb0/dvbusdis.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DVBUSDIS"] -pub type R = crate::R; -#[doc = "Writer for register DVBUSDIS"] -pub type W = crate::W; -#[doc = "Register DVBUSDIS `reset()`'s with value 0x17d7"] -impl crate::ResetValue for super::DVBUSDIS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x17d7 +#[doc = "Register `DVBUSDIS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DVBUSDIS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DVBUSDis`"] -pub type DVBUSDIS_R = crate::R; -#[doc = "Write proxy for field `DVBUSDis`"] +#[doc = "Field `DVBUSDis` reader - Device Vbus Discharge Time"] +pub struct DVBUSDIS_R(crate::FieldReader); +impl DVBUSDIS_R { + pub(crate) fn new(bits: u16) -> Self { + DVBUSDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DVBUSDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DVBUSDis` writer - Device Vbus Discharge Time"] pub struct DVBUSDIS_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DVBUSDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dvbusdis(&mut self) -> DVBUSDIS_W { DVBUSDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device VBUS Discharge Time Register\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 [dvbusdis](index.html) module"] +pub struct DVBUSDIS_SPEC; +impl crate::RegisterSpec for DVBUSDIS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dvbusdis::R](R) reader structure"] +impl crate::Readable for DVBUSDIS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dvbusdis::W](W) writer structure"] +impl crate::Writable for DVBUSDIS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DVBUSDIS to value 0x17d7"] +impl crate::Resettable for DVBUSDIS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x17d7 + } } diff --git a/src/usb0/dvbuspulse.rs b/src/usb0/dvbuspulse.rs index 4a7d597e..2618c7af 100644 --- a/src/usb0/dvbuspulse.rs +++ b/src/usb0/dvbuspulse.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DVBUSPULSE"] -pub type R = crate::R; -#[doc = "Writer for register DVBUSPULSE"] -pub type W = crate::W; -#[doc = "Register DVBUSPULSE `reset()`'s with value 0x05b8"] -impl crate::ResetValue for super::DVBUSPULSE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x05b8 +#[doc = "Register `DVBUSPULSE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DVBUSPULSE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DVBUSPulse`"] -pub type DVBUSPULSE_R = crate::R; -#[doc = "Write proxy for field `DVBUSPulse`"] +#[doc = "Field `DVBUSPulse` reader - Device Vbus Pulsing Time"] +pub struct DVBUSPULSE_R(crate::FieldReader); +impl DVBUSPULSE_R { + pub(crate) fn new(bits: u16) -> Self { + DVBUSPULSE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DVBUSPULSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DVBUSPulse` writer - Device Vbus Pulsing Time"] pub struct DVBUSPULSE_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DVBUSPULSE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dvbuspulse(&mut self) -> DVBUSPULSE_W { DVBUSPULSE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device VBUS Pulsing Time Register\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 [dvbuspulse](index.html) module"] +pub struct DVBUSPULSE_SPEC; +impl crate::RegisterSpec for DVBUSPULSE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dvbuspulse::R](R) reader structure"] +impl crate::Readable for DVBUSPULSE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dvbuspulse::W](W) writer structure"] +impl crate::Writable for DVBUSPULSE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DVBUSPULSE to value 0x05b8"] +impl crate::Resettable for DVBUSPULSE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x05b8 + } } diff --git a/src/usb0/gahbcfg.rs b/src/usb0/gahbcfg.rs index b31f93e0..532beeca 100644 --- a/src/usb0/gahbcfg.rs +++ b/src/usb0/gahbcfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GAHBCFG"] -pub type R = crate::R; -#[doc = "Writer for register GAHBCFG"] -pub type W = crate::W; -#[doc = "Register GAHBCFG `reset()`'s with value 0"] -impl crate::ResetValue for super::GAHBCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GAHBCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GAHBCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Global Interrupt Mask\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `GlblIntrMsk`"] -pub type GLBLINTRMSK_R = crate::R; +#[doc = "Field `GlblIntrMsk` reader - Global Interrupt Mask"] +pub struct GLBLINTRMSK_R(crate::FieldReader); impl GLBLINTRMSK_R { + pub(crate) fn new(bits: bool) -> Self { + GLBLINTRMSK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> GLBLINTRMSK_A { @@ -38,15 +65,22 @@ impl GLBLINTRMSK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == GLBLINTRMSK_A::VALUE1 + **self == GLBLINTRMSK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == GLBLINTRMSK_A::VALUE2 + **self == GLBLINTRMSK_A::VALUE2 + } +} +impl core::ops::Deref for GLBLINTRMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `GlblIntrMsk`"] +#[doc = "Field `GlblIntrMsk` writer - Global Interrupt Mask"] pub struct GLBLINTRMSK_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> GLBLINTRMSK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GLBLINTRMSK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Mask the interrupt assertion to the application."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> GLBLINTRMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -106,49 +138,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HBstLen`"] -pub type HBSTLEN_R = crate::R; +#[doc = "Field `HBstLen` reader - Burst Length/Type"] +pub struct HBSTLEN_R(crate::FieldReader); impl HBSTLEN_R { + pub(crate) fn new(bits: u8) -> Self { + HBSTLEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(HBSTLEN_A::VALUE1), - 1 => Val(HBSTLEN_A::VALUE2), - 3 => Val(HBSTLEN_A::VALUE3), - 5 => Val(HBSTLEN_A::VALUE4), - 7 => Val(HBSTLEN_A::VALUE5), - i => Res(i), + 0 => Some(HBSTLEN_A::VALUE1), + 1 => Some(HBSTLEN_A::VALUE2), + 3 => Some(HBSTLEN_A::VALUE3), + 5 => Some(HBSTLEN_A::VALUE4), + 7 => Some(HBSTLEN_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HBSTLEN_A::VALUE1 + **self == HBSTLEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HBSTLEN_A::VALUE2 + **self == HBSTLEN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HBSTLEN_A::VALUE3 + **self == HBSTLEN_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HBSTLEN_A::VALUE4 + **self == HBSTLEN_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == HBSTLEN_A::VALUE5 + **self == HBSTLEN_A::VALUE5 + } +} +impl core::ops::Deref for HBSTLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HBstLen`"] +#[doc = "Field `HBstLen` writer - Burst Length/Type"] pub struct HBSTLEN_W<'a> { w: &'a mut W, } @@ -186,7 +227,7 @@ impl<'a> HBSTLEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 1)) | (((value as u32) & 0x0f) << 1); + self.w.bits = (self.w.bits & !(0x0f << 1)) | ((value as u32 & 0x0f) << 1); self.w } } @@ -204,9 +245,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DMAEn`"] -pub type DMAEN_R = crate::R; +#[doc = "Field `DMAEn` reader - DMA Enable"] +pub struct DMAEN_R(crate::FieldReader); impl DMAEN_R { + pub(crate) fn new(bits: bool) -> Self { + DMAEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DMAEN_A { @@ -218,15 +262,22 @@ impl DMAEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DMAEN_A::VALUE1 + **self == DMAEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DMAEN_A::VALUE2 + **self == DMAEN_A::VALUE2 } } -#[doc = "Write proxy for field `DMAEn`"] +impl core::ops::Deref for DMAEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAEn` writer - DMA Enable"] pub struct DMAEN_W<'a> { w: &'a mut W, } @@ -234,9 +285,7 @@ impl<'a> DMAEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DMAEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Core operates in Slave mode"] #[inline(always)] @@ -261,7 +310,7 @@ impl<'a> DMAEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -279,9 +328,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NPTxFEmpLvl`"] -pub type NPTXFEMPLVL_R = crate::R; +#[doc = "Field `NPTxFEmpLvl` reader - Non-Periodic TxFIFO Empty Level"] +pub struct NPTXFEMPLVL_R(crate::FieldReader); impl NPTXFEMPLVL_R { + pub(crate) fn new(bits: bool) -> Self { + NPTXFEMPLVL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NPTXFEMPLVL_A { @@ -293,15 +345,22 @@ impl NPTXFEMPLVL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NPTXFEMPLVL_A::VALUE1 + **self == NPTXFEMPLVL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NPTXFEMPLVL_A::VALUE2 + **self == NPTXFEMPLVL_A::VALUE2 + } +} +impl core::ops::Deref for NPTXFEMPLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `NPTxFEmpLvl`"] +#[doc = "Field `NPTxFEmpLvl` writer - Non-Periodic TxFIFO Empty Level"] pub struct NPTXFEMPLVL_W<'a> { w: &'a mut W, } @@ -309,9 +368,7 @@ impl<'a> NPTXFEMPLVL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NPTXFEMPLVL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DIEPINTx.TxFEmp interrupt indicates that the IN Endpoint TxFIFO is half empty"] #[inline(always)] @@ -336,7 +393,7 @@ impl<'a> NPTXFEMPLVL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -354,9 +411,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AHBSingle`"] -pub type AHBSINGLE_R = crate::R; +#[doc = "Field `AHBSingle` reader - AHB Single Support"] +pub struct AHBSINGLE_R(crate::FieldReader); impl AHBSINGLE_R { + pub(crate) fn new(bits: bool) -> Self { + AHBSINGLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AHBSINGLE_A { @@ -368,15 +428,22 @@ impl AHBSINGLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AHBSINGLE_A::VALUE1 + **self == AHBSINGLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AHBSINGLE_A::VALUE2 + **self == AHBSINGLE_A::VALUE2 } } -#[doc = "Write proxy for field `AHBSingle`"] +impl core::ops::Deref for AHBSINGLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBSingle` writer - AHB Single Support"] pub struct AHBSINGLE_W<'a> { w: &'a mut W, } @@ -384,9 +451,7 @@ impl<'a> AHBSINGLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AHBSINGLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The remaining data in a transfer is sent using INCR burst size. This is the default mode."] #[inline(always)] @@ -411,7 +476,7 @@ impl<'a> AHBSINGLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -468,4 +533,30 @@ impl W { pub fn ahbsingle(&mut self) -> AHBSINGLE_W { AHBSINGLE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "AHB Configuration Register\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 [gahbcfg](index.html) module"] +pub struct GAHBCFG_SPEC; +impl crate::RegisterSpec for GAHBCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gahbcfg::R](R) reader structure"] +impl crate::Readable for GAHBCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gahbcfg::W](W) writer structure"] +impl crate::Writable for GAHBCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GAHBCFG to value 0"] +impl crate::Resettable for GAHBCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/gdfifocfg.rs b/src/usb0/gdfifocfg.rs index c1301dbb..d2607583 100644 --- a/src/usb0/gdfifocfg.rs +++ b/src/usb0/gdfifocfg.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GDFIFOCFG"] -pub type R = crate::R; -#[doc = "Writer for register GDFIFOCFG"] -pub type W = crate::W; -#[doc = "Register GDFIFOCFG `reset()`'s with value 0x027a_02b2"] -impl crate::ResetValue for super::GDFIFOCFG { - type Type = u32; +#[doc = "Register `GDFIFOCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x027a_02b2 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GDFIFOCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `GDFIFOCfg` reader - GDFIFOCfg"] +pub struct GDFIFOCFG_R(crate::FieldReader); +impl GDFIFOCFG_R { + pub(crate) fn new(bits: u16) -> Self { + GDFIFOCFG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GDFIFOCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `GDFIFOCfg`"] -pub type GDFIFOCFG_R = crate::R; -#[doc = "Write proxy for field `GDFIFOCfg`"] +#[doc = "Field `GDFIFOCfg` writer - GDFIFOCfg"] pub struct GDFIFOCFG_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> GDFIFOCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `EPInfoBaseAddr`"] -pub type EPINFOBASEADDR_R = crate::R; -#[doc = "Write proxy for field `EPInfoBaseAddr`"] +#[doc = "Field `EPInfoBaseAddr` reader - EPInfoBaseAddr"] +pub struct EPINFOBASEADDR_R(crate::FieldReader); +impl EPINFOBASEADDR_R { + pub(crate) fn new(bits: u16) -> Self { + EPINFOBASEADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPINFOBASEADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPInfoBaseAddr` writer - EPInfoBaseAddr"] pub struct EPINFOBASEADDR_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> EPINFOBASEADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn epinfo_base_addr(&mut self) -> EPINFOBASEADDR_W { EPINFOBASEADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global DFIFO Software Config Register\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 [gdfifocfg](index.html) module"] +pub struct GDFIFOCFG_SPEC; +impl crate::RegisterSpec for GDFIFOCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gdfifocfg::R](R) reader structure"] +impl crate::Readable for GDFIFOCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gdfifocfg::W](W) writer structure"] +impl crate::Writable for GDFIFOCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GDFIFOCFG to value 0x027a_02b2"] +impl crate::Resettable for GDFIFOCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x027a_02b2 + } } diff --git a/src/usb0/gintmsk.rs b/src/usb0/gintmsk.rs index f6b8f9f6..b4e79cbb 100644 --- a/src/usb0/gintmsk.rs +++ b/src/usb0/gintmsk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GINTMSK"] -pub type R = crate::R; -#[doc = "Writer for register GINTMSK"] -pub type W = crate::W; -#[doc = "Register GINTMSK `reset()`'s with value 0"] -impl crate::ResetValue for super::GINTMSK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GINTMSK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `SofMsk`"] -pub type SOFMSK_R = crate::R; -#[doc = "Write proxy for field `SofMsk`"] +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GINTMSK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SofMsk` reader - Start of Frame Mask"] +pub struct SOFMSK_R(crate::FieldReader); +impl SOFMSK_R { + pub(crate) fn new(bits: bool) -> Self { + SOFMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SOFMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SofMsk` writer - Start of Frame Mask"] pub struct SOFMSK_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> SOFMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `RxFLvlMsk`"] -pub type RXFLVLMSK_R = crate::R; -#[doc = "Write proxy for field `RxFLvlMsk`"] +#[doc = "Field `RxFLvlMsk` reader - Receive FIFO Non-Empty Mask"] +pub struct RXFLVLMSK_R(crate::FieldReader); +impl RXFLVLMSK_R { + pub(crate) fn new(bits: bool) -> Self { + RXFLVLMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXFLVLMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RxFLvlMsk` writer - Receive FIFO Non-Empty Mask"] pub struct RXFLVLMSK_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> RXFLVLMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `GINNakEffMsk`"] -pub type GINNAKEFFMSK_R = crate::R; -#[doc = "Write proxy for field `GINNakEffMsk`"] +#[doc = "Field `GINNakEffMsk` reader - Global Non-periodic IN NAK Effective Mask"] +pub struct GINNAKEFFMSK_R(crate::FieldReader); +impl GINNAKEFFMSK_R { + pub(crate) fn new(bits: bool) -> Self { + GINNAKEFFMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GINNAKEFFMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GINNakEffMsk` writer - Global Non-periodic IN NAK Effective Mask"] pub struct GINNAKEFFMSK_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> GINNAKEFFMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `GOUTNakEffMsk`"] -pub type GOUTNAKEFFMSK_R = crate::R; -#[doc = "Write proxy for field `GOUTNakEffMsk`"] +#[doc = "Field `GOUTNakEffMsk` reader - Global OUT NAK Effective Mask"] +pub struct GOUTNAKEFFMSK_R(crate::FieldReader); +impl GOUTNAKEFFMSK_R { + pub(crate) fn new(bits: bool) -> Self { + GOUTNAKEFFMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GOUTNAKEFFMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GOUTNakEffMsk` writer - Global OUT NAK Effective Mask"] pub struct GOUTNAKEFFMSK_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> GOUTNAKEFFMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `ErlySuspMsk`"] -pub type ERLYSUSPMSK_R = crate::R; -#[doc = "Write proxy for field `ErlySuspMsk`"] +#[doc = "Field `ErlySuspMsk` reader - Early Suspend Mask"] +pub struct ERLYSUSPMSK_R(crate::FieldReader); +impl ERLYSUSPMSK_R { + pub(crate) fn new(bits: bool) -> Self { + ERLYSUSPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERLYSUSPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ErlySuspMsk` writer - Early Suspend Mask"] pub struct ERLYSUSPMSK_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> ERLYSUSPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Reader of field `USBSuspMsk`"] -pub type USBSUSPMSK_R = crate::R; -#[doc = "Write proxy for field `USBSuspMsk`"] +#[doc = "Field `USBSuspMsk` reader - USB Suspend Mask"] +pub struct USBSUSPMSK_R(crate::FieldReader); +impl USBSUSPMSK_R { + pub(crate) fn new(bits: bool) -> Self { + USBSUSPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBSUSPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBSuspMsk` writer - USB Suspend Mask"] pub struct USBSUSPMSK_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> USBSUSPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `USBRstMsk`"] -pub type USBRSTMSK_R = crate::R; -#[doc = "Write proxy for field `USBRstMsk`"] +#[doc = "Field `USBRstMsk` reader - USB Reset Mask"] +pub struct USBRSTMSK_R(crate::FieldReader); +impl USBRSTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + USBRSTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBRSTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBRstMsk` writer - USB Reset Mask"] pub struct USBRSTMSK_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> USBRSTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `EnumDoneMsk`"] -pub type ENUMDONEMSK_R = crate::R; -#[doc = "Write proxy for field `EnumDoneMsk`"] +#[doc = "Field `EnumDoneMsk` reader - Enumeration Done Mask"] +pub struct ENUMDONEMSK_R(crate::FieldReader); +impl ENUMDONEMSK_R { + pub(crate) fn new(bits: bool) -> Self { + ENUMDONEMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENUMDONEMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EnumDoneMsk` writer - Enumeration Done Mask"] pub struct ENUMDONEMSK_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> ENUMDONEMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `ISOOutDropMsk`"] -pub type ISOOUTDROPMSK_R = crate::R; -#[doc = "Write proxy for field `ISOOutDropMsk`"] +#[doc = "Field `ISOOutDropMsk` reader - Isochronous OUT Packet Dropped Interrupt Mask"] +pub struct ISOOUTDROPMSK_R(crate::FieldReader); +impl ISOOUTDROPMSK_R { + pub(crate) fn new(bits: bool) -> Self { + ISOOUTDROPMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ISOOUTDROPMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ISOOutDropMsk` writer - Isochronous OUT Packet Dropped Interrupt Mask"] pub struct ISOOUTDROPMSK_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> ISOOUTDROPMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `EOPFMsk`"] -pub type EOPFMSK_R = crate::R; -#[doc = "Write proxy for field `EOPFMsk`"] +#[doc = "Field `EOPFMsk` reader - End of Periodic Frame Interrupt Mask"] +pub struct EOPFMSK_R(crate::FieldReader); +impl EOPFMSK_R { + pub(crate) fn new(bits: bool) -> Self { + EOPFMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EOPFMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EOPFMsk` writer - End of Periodic Frame Interrupt Mask"] pub struct EOPFMSK_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> EOPFMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `IEPIntMsk`"] -pub type IEPINTMSK_R = crate::R; -#[doc = "Write proxy for field `IEPIntMsk`"] +#[doc = "Field `IEPIntMsk` reader - IN Endpoints Interrupt Mask"] +pub struct IEPINTMSK_R(crate::FieldReader); +impl IEPINTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + IEPINTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IEPINTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IEPIntMsk` writer - IN Endpoints Interrupt Mask"] pub struct IEPINTMSK_W<'a> { w: &'a mut W, } @@ -270,13 +426,25 @@ impl<'a> IEPINTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `OEPIntMsk`"] -pub type OEPINTMSK_R = crate::R; -#[doc = "Write proxy for field `OEPIntMsk`"] +#[doc = "Field `OEPIntMsk` reader - OUT Endpoints Interrupt Mask"] +pub struct OEPINTMSK_R(crate::FieldReader); +impl OEPINTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + OEPINTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OEPINTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OEPIntMsk` writer - OUT Endpoints Interrupt Mask"] pub struct OEPINTMSK_W<'a> { w: &'a mut W, } @@ -294,13 +462,25 @@ impl<'a> OEPINTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Reader of field `incompISOINMsk`"] -pub type INCOMPISOINMSK_R = crate::R; -#[doc = "Write proxy for field `incompISOINMsk`"] +#[doc = "Field `incompISOINMsk` reader - Incomplete Isochronous IN Transfer Mask"] +pub struct INCOMPISOINMSK_R(crate::FieldReader); +impl INCOMPISOINMSK_R { + pub(crate) fn new(bits: bool) -> Self { + INCOMPISOINMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INCOMPISOINMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `incompISOINMsk` writer - Incomplete Isochronous IN Transfer Mask"] pub struct INCOMPISOINMSK_W<'a> { w: &'a mut W, } @@ -318,13 +498,25 @@ impl<'a> INCOMPISOINMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `incomplSOOUTMsk`"] -pub type INCOMPLSOOUTMSK_R = crate::R; -#[doc = "Write proxy for field `incomplSOOUTMsk`"] +#[doc = "Field `incomplSOOUTMsk` reader - Incomplete Isochronous OUT Transfer Mask"] +pub struct INCOMPLSOOUTMSK_R(crate::FieldReader); +impl INCOMPLSOOUTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + INCOMPLSOOUTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INCOMPLSOOUTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `incomplSOOUTMsk` writer - Incomplete Isochronous OUT Transfer Mask"] pub struct INCOMPLSOOUTMSK_W<'a> { w: &'a mut W, } @@ -342,13 +534,25 @@ impl<'a> INCOMPLSOOUTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `WkUpIntMsk`"] -pub type WKUPINTMSK_R = crate::R; -#[doc = "Write proxy for field `WkUpIntMsk`"] +#[doc = "Field `WkUpIntMsk` reader - Resume/Remote Wakeup Detected Interrupt Mask"] +pub struct WKUPINTMSK_R(crate::FieldReader); +impl WKUPINTMSK_R { + pub(crate) fn new(bits: bool) -> Self { + WKUPINTMSK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WKUPINTMSK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WkUpIntMsk` writer - Resume/Remote Wakeup Detected Interrupt Mask"] pub struct WKUPINTMSK_W<'a> { w: &'a mut W, } @@ -366,7 +570,7 @@ impl<'a> WKUPINTMSK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -523,4 +727,30 @@ impl W { pub fn wk_up_int_msk(&mut self) -> WKUPINTMSK_W { WKUPINTMSK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Mask Register\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 [gintmsk](index.html) module"] +pub struct GINTMSK_SPEC; +impl crate::RegisterSpec for GINTMSK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gintmsk::R](R) reader structure"] +impl crate::Readable for GINTMSK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gintmsk::W](W) writer structure"] +impl crate::Writable for GINTMSK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GINTMSK to value 0"] +impl crate::Resettable for GINTMSK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0/gintsts.rs b/src/usb0/gintsts.rs index 7d23a300..5d7610cc 100644 --- a/src/usb0/gintsts.rs +++ b/src/usb0/gintsts.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GINTSTS"] -pub type R = crate::R; -#[doc = "Writer for register GINTSTS"] -pub type W = crate::W; -#[doc = "Register GINTSTS `reset()`'s with value 0x1400_0020"] -impl crate::ResetValue for super::GINTSTS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x1400_0020 +#[doc = "Register `GINTSTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GINTSTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Current Mode of Operation\n\nValue on reset: 0"] @@ -22,27 +46,48 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CurMod`"] -pub type CURMOD_R = crate::R; +#[doc = "Field `CurMod` reader - Current Mode of Operation"] +pub struct CURMOD_R(crate::FieldReader); impl CURMOD_R { + pub(crate) fn new(bits: bool) -> Self { + CURMOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - false => Val(CURMOD_A::VALUE1), - i => Res(i), + false => Some(CURMOD_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CURMOD_A::VALUE1 + **self == CURMOD_A::VALUE1 + } +} +impl core::ops::Deref for CURMOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Sof` reader - Start of Frame"] +pub struct SOF_R(crate::FieldReader); +impl SOF_R { + pub(crate) fn new(bits: bool) -> Self { + SOF_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `Sof`"] -pub type SOF_R = crate::R; -#[doc = "Write proxy for field `Sof`"] +impl core::ops::Deref for SOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Sof` writer - Start of Frame"] pub struct SOF_W<'a> { w: &'a mut W, } @@ -60,19 +105,67 @@ impl<'a> SOF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `RxFLvl`"] -pub type RXFLVL_R = crate::R; -#[doc = "Reader of field `GINNakEff`"] -pub type GINNAKEFF_R = crate::R; -#[doc = "Reader of field `GOUTNakEff`"] -pub type GOUTNAKEFF_R = crate::R; -#[doc = "Reader of field `ErlySusp`"] -pub type ERLYSUSP_R = crate::R; -#[doc = "Write proxy for field `ErlySusp`"] +#[doc = "Field `RxFLvl` reader - RxFIFO Non-Empty"] +pub struct RXFLVL_R(crate::FieldReader); +impl RXFLVL_R { + pub(crate) fn new(bits: bool) -> Self { + RXFLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXFLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GINNakEff` reader - Global IN Non-Periodic NAK Effective"] +pub struct GINNAKEFF_R(crate::FieldReader); +impl GINNAKEFF_R { + pub(crate) fn new(bits: bool) -> Self { + GINNAKEFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GINNAKEFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GOUTNakEff` reader - Global OUT NAK Effective"] +pub struct GOUTNAKEFF_R(crate::FieldReader); +impl GOUTNAKEFF_R { + pub(crate) fn new(bits: bool) -> Self { + GOUTNAKEFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GOUTNAKEFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ErlySusp` reader - Early Suspend"] +pub struct ERLYSUSP_R(crate::FieldReader); +impl ERLYSUSP_R { + pub(crate) fn new(bits: bool) -> Self { + ERLYSUSP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERLYSUSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ErlySusp` writer - Early Suspend"] pub struct ERLYSUSP_W<'a> { w: &'a mut W, } @@ -90,13 +183,25 @@ impl<'a> ERLYSUSP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Reader of field `USBSusp`"] -pub type USBSUSP_R = crate::R; -#[doc = "Write proxy for field `USBSusp`"] +#[doc = "Field `USBSusp` reader - USB Suspend"] +pub struct USBSUSP_R(crate::FieldReader); +impl USBSUSP_R { + pub(crate) fn new(bits: bool) -> Self { + USBSUSP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBSUSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBSusp` writer - USB Suspend"] pub struct USBSUSP_W<'a> { w: &'a mut W, } @@ -114,13 +219,25 @@ impl<'a> USBSUSP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `USBRst`"] -pub type USBRST_R = crate::R; -#[doc = "Write proxy for field `USBRst`"] +#[doc = "Field `USBRst` reader - USB Reset"] +pub struct USBRST_R(crate::FieldReader); +impl USBRST_R { + pub(crate) fn new(bits: bool) -> Self { + USBRST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBRst` writer - USB Reset"] pub struct USBRST_W<'a> { w: &'a mut W, } @@ -138,13 +255,25 @@ impl<'a> USBRST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `EnumDone`"] -pub type ENUMDONE_R = crate::R; -#[doc = "Write proxy for field `EnumDone`"] +#[doc = "Field `EnumDone` reader - Enumeration Done"] +pub struct ENUMDONE_R(crate::FieldReader); +impl ENUMDONE_R { + pub(crate) fn new(bits: bool) -> Self { + ENUMDONE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENUMDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EnumDone` writer - Enumeration Done"] pub struct ENUMDONE_W<'a> { w: &'a mut W, } @@ -162,13 +291,25 @@ impl<'a> ENUMDONE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `ISOOutDrop`"] -pub type ISOOUTDROP_R = crate::R; -#[doc = "Write proxy for field `ISOOutDrop`"] +#[doc = "Field `ISOOutDrop` reader - Isochronous OUT Packet Dropped Interrupt"] +pub struct ISOOUTDROP_R(crate::FieldReader); +impl ISOOUTDROP_R { + pub(crate) fn new(bits: bool) -> Self { + ISOOUTDROP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ISOOUTDROP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ISOOutDrop` writer - Isochronous OUT Packet Dropped Interrupt"] pub struct ISOOUTDROP_W<'a> { w: &'a mut W, } @@ -186,13 +327,25 @@ impl<'a> ISOOUTDROP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `EOPF`"] -pub type EOPF_R = crate::R; -#[doc = "Write proxy for field `EOPF`"] +#[doc = "Field `EOPF` reader - End of Periodic Frame Interrupt"] +pub struct EOPF_R(crate::FieldReader); +impl EOPF_R { + pub(crate) fn new(bits: bool) -> Self { + EOPF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EOPF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EOPF` writer - End of Periodic Frame Interrupt"] pub struct EOPF_W<'a> { w: &'a mut W, } @@ -210,17 +363,53 @@ impl<'a> EOPF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `IEPInt`"] -pub type IEPINT_R = crate::R; -#[doc = "Reader of field `OEPInt`"] -pub type OEPINT_R = crate::R; -#[doc = "Reader of field `incompISOIN`"] -pub type INCOMPISOIN_R = crate::R; -#[doc = "Write proxy for field `incompISOIN`"] +#[doc = "Field `IEPInt` reader - IN Endpoints Interrupt"] +pub struct IEPINT_R(crate::FieldReader); +impl IEPINT_R { + pub(crate) fn new(bits: bool) -> Self { + IEPINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IEPINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OEPInt` reader - OUT Endpoints Interrupt"] +pub struct OEPINT_R(crate::FieldReader); +impl OEPINT_R { + pub(crate) fn new(bits: bool) -> Self { + OEPINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OEPINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `incompISOIN` reader - Incomplete Isochronous IN Transfer"] +pub struct INCOMPISOIN_R(crate::FieldReader); +impl INCOMPISOIN_R { + pub(crate) fn new(bits: bool) -> Self { + INCOMPISOIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INCOMPISOIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `incompISOIN` writer - Incomplete Isochronous IN Transfer"] pub struct INCOMPISOIN_W<'a> { w: &'a mut W, } @@ -238,13 +427,25 @@ impl<'a> INCOMPISOIN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `incomplSOOUT`"] -pub type INCOMPLSOOUT_R = crate::R; -#[doc = "Write proxy for field `incomplSOOUT`"] +#[doc = "Field `incomplSOOUT` reader - Incomplete Isochronous OUT Transfer"] +pub struct INCOMPLSOOUT_R(crate::FieldReader); +impl INCOMPLSOOUT_R { + pub(crate) fn new(bits: bool) -> Self { + INCOMPLSOOUT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INCOMPLSOOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `incomplSOOUT` writer - Incomplete Isochronous OUT Transfer"] pub struct INCOMPLSOOUT_W<'a> { w: &'a mut W, } @@ -262,13 +463,25 @@ impl<'a> INCOMPLSOOUT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `WkUpInt`"] -pub type WKUPINT_R = crate::R; -#[doc = "Write proxy for field `WkUpInt`"] +#[doc = "Field `WkUpInt` reader - Resume/Remote Wakeup Detected Interrupt"] +pub struct WKUPINT_R(crate::FieldReader); +impl WKUPINT_R { + pub(crate) fn new(bits: bool) -> Self { + WKUPINT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WKUPINT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WkUpInt` writer - Resume/Remote Wakeup Detected Interrupt"] pub struct WKUPINT_W<'a> { w: &'a mut W, } @@ -286,7 +499,7 @@ impl<'a> WKUPINT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -423,4 +636,30 @@ impl W { pub fn wk_up_int(&mut self) -> WKUPINT_W { WKUPINT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Register\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 [gintsts](index.html) module"] +pub struct GINTSTS_SPEC; +impl crate::RegisterSpec for GINTSTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gintsts::R](R) reader structure"] +impl crate::Readable for GINTSTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gintsts::W](W) writer structure"] +impl crate::Writable for GINTSTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GINTSTS to value 0x1400_0020"] +impl crate::Resettable for GINTSTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1400_0020 + } } diff --git a/src/usb0/gnptxfsiz.rs b/src/usb0/gnptxfsiz.rs index 6662ca55..a002b2b0 100644 --- a/src/usb0/gnptxfsiz.rs +++ b/src/usb0/gnptxfsiz.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GNPTXFSIZ"] -pub type R = crate::R; -#[doc = "Writer for register GNPTXFSIZ"] -pub type W = crate::W; -#[doc = "Register GNPTXFSIZ `reset()`'s with value 0x0010_011a"] -impl crate::ResetValue for super::GNPTXFSIZ { - type Type = u32; +#[doc = "Register `GNPTXFSIZ` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0010_011a + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GNPTXFSIZ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INEPTxF0StAddr` reader - IN Endpoint FIFO0 Transmit RAM Start Address"] +pub struct INEPTXF0STADDR_R(crate::FieldReader); +impl INEPTXF0STADDR_R { + pub(crate) fn new(bits: u16) -> Self { + INEPTXF0STADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPTXF0STADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `INEPTxF0StAddr`"] -pub type INEPTXF0STADDR_R = crate::R; -#[doc = "Write proxy for field `INEPTxF0StAddr`"] +#[doc = "Field `INEPTxF0StAddr` writer - IN Endpoint FIFO0 Transmit RAM Start Address"] pub struct INEPTXF0STADDR_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> INEPTXF0STADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `INEPTxF0Dep`"] -pub type INEPTXF0DEP_R = crate::R; -#[doc = "Write proxy for field `INEPTxF0Dep`"] +#[doc = "Field `INEPTxF0Dep` reader - IN Endpoint TxFIFO 0 Depth"] +pub struct INEPTXF0DEP_R(crate::FieldReader); +impl INEPTXF0DEP_R { + pub(crate) fn new(bits: u16) -> Self { + INEPTXF0DEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPTXF0DEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPTxF0Dep` writer - IN Endpoint TxFIFO 0 Depth"] pub struct INEPTXF0DEP_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> INEPTXF0DEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn ineptx_f0dep(&mut self) -> INEPTXF0DEP_W { INEPTXF0DEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Non-Periodic Transmit FIFO Size Register\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 [gnptxfsiz](index.html) module"] +pub struct GNPTXFSIZ_SPEC; +impl crate::RegisterSpec for GNPTXFSIZ_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gnptxfsiz::R](R) reader structure"] +impl crate::Readable for GNPTXFSIZ_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gnptxfsiz::W](W) writer structure"] +impl crate::Writable for GNPTXFSIZ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GNPTXFSIZ to value 0x0010_011a"] +impl crate::Resettable for GNPTXFSIZ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0010_011a + } } diff --git a/src/usb0/grstctl.rs b/src/usb0/grstctl.rs index af125f50..c9afb875 100644 --- a/src/usb0/grstctl.rs +++ b/src/usb0/grstctl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GRSTCTL"] -pub type R = crate::R; -#[doc = "Writer for register GRSTCTL"] -pub type W = crate::W; -#[doc = "Register GRSTCTL `reset()`'s with value 0x1000_0000"] -impl crate::ResetValue for super::GRSTCTL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x1000_0000 +#[doc = "Register `GRSTCTL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GRSTCTL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CSftRst` reader - Core Soft Reset"] +pub struct CSFTRST_R(crate::FieldReader); +impl CSFTRST_R { + pub(crate) fn new(bits: bool) -> Self { + CSFTRST_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `CSftRst`"] -pub type CSFTRST_R = crate::R; -#[doc = "Write proxy for field `CSftRst`"] +impl core::ops::Deref for CSFTRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CSftRst` writer - Core Soft Reset"] pub struct CSFTRST_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CSFTRST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `RxFFlsh`"] -pub type RXFFLSH_R = crate::R; -#[doc = "Write proxy for field `RxFFlsh`"] +#[doc = "Field `RxFFlsh` reader - RxFIFO Flush"] +pub struct RXFFLSH_R(crate::FieldReader); +impl RXFFLSH_R { + pub(crate) fn new(bits: bool) -> Self { + RXFFLSH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXFFLSH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RxFFlsh` writer - RxFIFO Flush"] pub struct RXFFLSH_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> RXFFLSH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `TxFFlsh`"] -pub type TXFFLSH_R = crate::R; -#[doc = "Write proxy for field `TxFFlsh`"] +#[doc = "Field `TxFFlsh` reader - TxFIFO Flush"] +pub struct TXFFLSH_R(crate::FieldReader); +impl TXFFLSH_R { + pub(crate) fn new(bits: bool) -> Self { + TXFFLSH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFFLSH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFFlsh` writer - TxFIFO Flush"] pub struct TXFFLSH_W<'a> { w: &'a mut W, } @@ -78,7 +138,7 @@ impl<'a> TXFFLSH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -103,49 +163,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TXFNUM_A::VALUE1), - 1 => Val(TXFNUM_A::VALUE2), - 2 => Val(TXFNUM_A::VALUE3), - 15 => Val(TXFNUM_A::VALUE4), - 16 => Val(TXFNUM_A::VALUE5), - i => Res(i), + 0 => Some(TXFNUM_A::VALUE1), + 1 => Some(TXFNUM_A::VALUE2), + 2 => Some(TXFNUM_A::VALUE3), + 15 => Some(TXFNUM_A::VALUE4), + 16 => Some(TXFNUM_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXFNUM_A::VALUE1 + **self == TXFNUM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXFNUM_A::VALUE2 + **self == TXFNUM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TXFNUM_A::VALUE3 + **self == TXFNUM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TXFNUM_A::VALUE4 + **self == TXFNUM_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == TXFNUM_A::VALUE5 + **self == TXFNUM_A::VALUE5 + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -183,14 +252,38 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 6)) | (((value as u32) & 0x1f) << 6); + self.w.bits = (self.w.bits & !(0x1f << 6)) | ((value as u32 & 0x1f) << 6); self.w } } -#[doc = "Reader of field `DMAReq`"] -pub type DMAREQ_R = crate::R; -#[doc = "Reader of field `AHBIdle`"] -pub type AHBIDLE_R = crate::R; +#[doc = "Field `DMAReq` reader - DMA Request Signal"] +pub struct DMAREQ_R(crate::FieldReader); +impl DMAREQ_R { + pub(crate) fn new(bits: bool) -> Self { + DMAREQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBIdle` reader - AHB Master Idle"] +pub struct AHBIDLE_R(crate::FieldReader); +impl AHBIDLE_R { + pub(crate) fn new(bits: bool) -> Self { + AHBIDLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBIDLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Core Soft Reset"] #[inline(always)] @@ -244,4 +337,30 @@ impl W { pub fn tx_fnum(&mut self) -> TXFNUM_W { TXFNUM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Reset Register\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 [grstctl](index.html) module"] +pub struct GRSTCTL_SPEC; +impl crate::RegisterSpec for GRSTCTL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [grstctl::R](R) reader structure"] +impl crate::Readable for GRSTCTL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [grstctl::W](W) writer structure"] +impl crate::Writable for GRSTCTL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GRSTCTL to value 0x1000_0000"] +impl crate::Resettable for GRSTCTL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1000_0000 + } } diff --git a/src/usb0/grxfsiz.rs b/src/usb0/grxfsiz.rs index 463f1a0b..86a668a5 100644 --- a/src/usb0/grxfsiz.rs +++ b/src/usb0/grxfsiz.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GRXFSIZ"] -pub type R = crate::R; -#[doc = "Writer for register GRXFSIZ"] -pub type W = crate::W; -#[doc = "Register GRXFSIZ `reset()`'s with value 0x011a"] -impl crate::ResetValue for super::GRXFSIZ { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x011a +#[doc = "Register `GRXFSIZ` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GRXFSIZ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `RxFDep`"] -pub type RXFDEP_R = crate::R; -#[doc = "Write proxy for field `RxFDep`"] +#[doc = "Field `RxFDep` reader - RxFIFO Depth"] +pub struct RXFDEP_R(crate::FieldReader); +impl RXFDEP_R { + pub(crate) fn new(bits: u16) -> Self { + RXFDEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXFDEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RxFDep` writer - RxFIFO Depth"] pub struct RXFDEP_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> RXFDEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn rx_fdep(&mut self) -> RXFDEP_W { RXFDEP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive FIFO Size Register\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 [grxfsiz](index.html) module"] +pub struct GRXFSIZ_SPEC; +impl crate::RegisterSpec for GRXFSIZ_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [grxfsiz::R](R) reader structure"] +impl crate::Readable for GRXFSIZ_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [grxfsiz::W](W) writer structure"] +impl crate::Writable for GRXFSIZ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GRXFSIZ to value 0x011a"] +impl crate::Resettable for GRXFSIZ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x011a + } } diff --git a/src/usb0/grxstsp.rs b/src/usb0/grxstsp.rs index c64a44a3..dd2a85a2 100644 --- a/src/usb0/grxstsp.rs +++ b/src/usb0/grxstsp.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register GRXSTSP"] -pub type R = crate::R; -#[doc = "Reader of field `EPNum`"] -pub type EPNUM_R = crate::R; -#[doc = "Reader of field `BCnt`"] -pub type BCNT_R = crate::R; +#[doc = "Register `GRXSTSP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `EPNum` reader - Endpoint Number"] +pub struct EPNUM_R(crate::FieldReader); +impl EPNUM_R { + pub(crate) fn new(bits: u8) -> Self { + EPNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BCnt` reader - Byte Count"] +pub struct BCNT_R(crate::FieldReader); +impl BCNT_R { + pub(crate) fn new(bits: u16) -> Self { + BCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -23,9 +60,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DPID`"] -pub type DPID_R = crate::R; +#[doc = "Field `DPID` reader - Data PID"] +pub struct DPID_R(crate::FieldReader); impl DPID_R { + pub(crate) fn new(bits: u8) -> Self { + DPID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPID_A { @@ -40,22 +80,29 @@ impl DPID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPID_A::VALUE1 + **self == DPID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPID_A::VALUE2 + **self == DPID_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DPID_A::VALUE3 + **self == DPID_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DPID_A::VALUE4 + **self == DPID_A::VALUE4 + } +} +impl core::ops::Deref for DPID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Packet Status\n\nValue on reset: 0"] @@ -79,50 +126,71 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PktSts`"] -pub type PKTSTS_R = crate::R; +#[doc = "Field `PktSts` reader - Packet Status"] +pub struct PKTSTS_R(crate::FieldReader); impl PKTSTS_R { + pub(crate) fn new(bits: u8) -> Self { + PKTSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(PKTSTS_A::VALUE1), - 2 => Val(PKTSTS_A::VALUE2), - 3 => Val(PKTSTS_A::VALUE3), - 4 => Val(PKTSTS_A::VALUE4), - 6 => Val(PKTSTS_A::VALUE5), - i => Res(i), + 1 => Some(PKTSTS_A::VALUE1), + 2 => Some(PKTSTS_A::VALUE2), + 3 => Some(PKTSTS_A::VALUE3), + 4 => Some(PKTSTS_A::VALUE4), + 6 => Some(PKTSTS_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PKTSTS_A::VALUE1 + **self == PKTSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PKTSTS_A::VALUE2 + **self == PKTSTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PKTSTS_A::VALUE3 + **self == PKTSTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PKTSTS_A::VALUE4 + **self == PKTSTS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PKTSTS_A::VALUE5 + **self == PKTSTS_A::VALUE5 + } +} +impl core::ops::Deref for PKTSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FN` reader - Frame Number"] +pub struct FN_R(crate::FieldReader); +impl FN_R { + pub(crate) fn new(bits: u8) -> Self { + FN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `FN`"] -pub type FN_R = crate::R; impl R { #[doc = "Bits 0:3 - Endpoint Number"] #[inline(always)] @@ -150,3 +218,19 @@ impl R { FN_R::new(((self.bits >> 21) & 0x0f) as u8) } } +#[doc = "Receive Status Read and Pop Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grxstsp](index.html) module"] +pub struct GRXSTSP_SPEC; +impl crate::RegisterSpec for GRXSTSP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [grxstsp::R](R) reader structure"] +impl crate::Readable for GRXSTSP_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GRXSTSP to value 0"] +impl crate::Resettable for GRXSTSP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0/grxstsr.rs b/src/usb0/grxstsr.rs index 6edaad6b..c823d1d0 100644 --- a/src/usb0/grxstsr.rs +++ b/src/usb0/grxstsr.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register GRXSTSR"] -pub type R = crate::R; -#[doc = "Reader of field `EPNum`"] -pub type EPNUM_R = crate::R; -#[doc = "Reader of field `BCnt`"] -pub type BCNT_R = crate::R; +#[doc = "Register `GRXSTSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `EPNum` reader - Endpoint Number"] +pub struct EPNUM_R(crate::FieldReader); +impl EPNUM_R { + pub(crate) fn new(bits: u8) -> Self { + EPNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BCnt` reader - Byte Count"] +pub struct BCNT_R(crate::FieldReader); +impl BCNT_R { + pub(crate) fn new(bits: u16) -> Self { + BCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -23,9 +60,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DPID`"] -pub type DPID_R = crate::R; +#[doc = "Field `DPID` reader - Data PID"] +pub struct DPID_R(crate::FieldReader); impl DPID_R { + pub(crate) fn new(bits: u8) -> Self { + DPID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPID_A { @@ -40,22 +80,29 @@ impl DPID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPID_A::VALUE1 + **self == DPID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPID_A::VALUE2 + **self == DPID_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DPID_A::VALUE3 + **self == DPID_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DPID_A::VALUE4 + **self == DPID_A::VALUE4 + } +} +impl core::ops::Deref for DPID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Packet Status\n\nValue on reset: 0"] @@ -79,50 +126,71 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PktSts`"] -pub type PKTSTS_R = crate::R; +#[doc = "Field `PktSts` reader - Packet Status"] +pub struct PKTSTS_R(crate::FieldReader); impl PKTSTS_R { + pub(crate) fn new(bits: u8) -> Self { + PKTSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(PKTSTS_A::VALUE1), - 2 => Val(PKTSTS_A::VALUE2), - 3 => Val(PKTSTS_A::VALUE3), - 4 => Val(PKTSTS_A::VALUE4), - 6 => Val(PKTSTS_A::VALUE5), - i => Res(i), + 1 => Some(PKTSTS_A::VALUE1), + 2 => Some(PKTSTS_A::VALUE2), + 3 => Some(PKTSTS_A::VALUE3), + 4 => Some(PKTSTS_A::VALUE4), + 6 => Some(PKTSTS_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PKTSTS_A::VALUE1 + **self == PKTSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PKTSTS_A::VALUE2 + **self == PKTSTS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PKTSTS_A::VALUE3 + **self == PKTSTS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PKTSTS_A::VALUE4 + **self == PKTSTS_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == PKTSTS_A::VALUE5 + **self == PKTSTS_A::VALUE5 + } +} +impl core::ops::Deref for PKTSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FN` reader - Frame Number"] +pub struct FN_R(crate::FieldReader); +impl FN_R { + pub(crate) fn new(bits: u8) -> Self { + FN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `FN`"] -pub type FN_R = crate::R; impl R { #[doc = "Bits 0:3 - Endpoint Number"] #[inline(always)] @@ -150,3 +218,19 @@ impl R { FN_R::new(((self.bits >> 21) & 0x0f) as u8) } } +#[doc = "Receive Status Debug Read Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [grxstsr](index.html) module"] +pub struct GRXSTSR_SPEC; +impl crate::RegisterSpec for GRXSTSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [grxstsr::R](R) reader structure"] +impl crate::Readable for GRXSTSR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets GRXSTSR to value 0"] +impl crate::Resettable for GRXSTSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0/guid.rs b/src/usb0/guid.rs index ae367114..c1922a82 100644 --- a/src/usb0/guid.rs +++ b/src/usb0/guid.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GUID"] -pub type R = crate::R; -#[doc = "Writer for register GUID"] -pub type W = crate::W; -#[doc = "Register GUID `reset()`'s with value 0x00b1_c000"] -impl crate::ResetValue for super::GUID { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x00b1_c000 +#[doc = "Register `GUID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GUID` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Write proxy for field `MOD_REV`"] +#[doc = "Field `MOD_REV` writer - Module Revision"] pub struct MOD_REV_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> MOD_REV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); self.w } } -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Write proxy for field `MOD_TYPE`"] +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` writer - Module Type"] pub struct MOD_TYPE_W<'a> { w: &'a mut W, } @@ -34,13 +82,25 @@ impl<'a> MOD_TYPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; -#[doc = "Write proxy for field `MOD_NUMBER`"] +#[doc = "Field `MOD_NUMBER` reader - Module Number"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` writer - Module Number"] pub struct MOD_NUMBER_W<'a> { w: &'a mut W, } @@ -48,7 +108,7 @@ impl<'a> MOD_NUMBER_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } @@ -85,4 +145,30 @@ impl W { pub fn mod_number(&mut self) -> MOD_NUMBER_W { MOD_NUMBER_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "USB Module Identification Register\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 [guid](index.html) module"] +pub struct GUID_SPEC; +impl crate::RegisterSpec for GUID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [guid::R](R) reader structure"] +impl crate::Readable for GUID_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [guid::W](W) writer structure"] +impl crate::Writable for GUID_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GUID to value 0x00b1_c000"] +impl crate::Resettable for GUID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00b1_c000 + } } diff --git a/src/usb0/gusbcfg.rs b/src/usb0/gusbcfg.rs index 45e7623f..f550a2ec 100644 --- a/src/usb0/gusbcfg.rs +++ b/src/usb0/gusbcfg.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GUSBCFG"] -pub type R = crate::R; -#[doc = "Writer for register GUSBCFG"] -pub type W = crate::W; -#[doc = "Register GUSBCFG `reset()`'s with value 0x1440"] -impl crate::ResetValue for super::GUSBCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x1440 +#[doc = "Register `GUSBCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GUSBCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TOutCal` reader - FS Timeout Calibration"] +pub struct TOUTCAL_R(crate::FieldReader); +impl TOUTCAL_R { + pub(crate) fn new(bits: u8) -> Self { + TOUTCAL_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `TOutCal`"] -pub type TOUTCAL_R = crate::R; -#[doc = "Write proxy for field `TOutCal`"] +impl core::ops::Deref for TOUTCAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TOutCal` writer - FS Timeout Calibration"] pub struct TOUTCAL_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> TOUTCAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -36,27 +72,48 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PHYSel`"] -pub type PHYSEL_R = crate::R; +#[doc = "Field `PHYSel` reader - USB 1.1 Full-Speed Serial Transceiver Select"] +pub struct PHYSEL_R(crate::FieldReader); impl PHYSEL_R { + pub(crate) fn new(bits: bool) -> Self { + PHYSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - true => Val(PHYSEL_A::VALUE2), - i => Res(i), + true => Some(PHYSEL_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PHYSEL_A::VALUE2 + **self == PHYSEL_A::VALUE2 + } +} +impl core::ops::Deref for PHYSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBTrdTim` reader - USB Turnaround Time"] +pub struct USBTRDTIM_R(crate::FieldReader); +impl USBTRDTIM_R { + pub(crate) fn new(bits: u8) -> Self { + USBTRDTIM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBTRDTIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `USBTrdTim`"] -pub type USBTRDTIM_R = crate::R; -#[doc = "Write proxy for field `USBTrdTim`"] +#[doc = "Field `USBTrdTim` writer - USB Turnaround Time"] pub struct USBTRDTIM_W<'a> { w: &'a mut W, } @@ -64,7 +121,7 @@ impl<'a> USBTRDTIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 10)) | (((value as u32) & 0x0f) << 10); + self.w.bits = (self.w.bits & !(0x0f << 10)) | ((value as u32 & 0x0f) << 10); self.w } } @@ -82,9 +139,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TxEndDelay`"] -pub type TXENDDELAY_R = crate::R; +#[doc = "Field `TxEndDelay` reader - Tx End Delay"] +pub struct TXENDDELAY_R(crate::FieldReader); impl TXENDDELAY_R { + pub(crate) fn new(bits: bool) -> Self { + TXENDDELAY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXENDDELAY_A { @@ -96,15 +156,22 @@ impl TXENDDELAY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXENDDELAY_A::VALUE1 + **self == TXENDDELAY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXENDDELAY_A::VALUE2 + **self == TXENDDELAY_A::VALUE2 } } -#[doc = "Write proxy for field `TxEndDelay`"] +impl core::ops::Deref for TXENDDELAY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxEndDelay` writer - Tx End Delay"] pub struct TXENDDELAY_W<'a> { w: &'a mut W, } @@ -112,9 +179,7 @@ impl<'a> TXENDDELAY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TXENDDELAY_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal mode"] #[inline(always)] @@ -139,7 +204,7 @@ impl<'a> TXENDDELAY_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -157,9 +222,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ForceDevMode`"] -pub type FORCEDEVMODE_R = crate::R; +#[doc = "Field `ForceDevMode` reader - Force Device Mode"] +pub struct FORCEDEVMODE_R(crate::FieldReader); impl FORCEDEVMODE_R { + pub(crate) fn new(bits: bool) -> Self { + FORCEDEVMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FORCEDEVMODE_A { @@ -171,15 +239,22 @@ impl FORCEDEVMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FORCEDEVMODE_A::VALUE1 + **self == FORCEDEVMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FORCEDEVMODE_A::VALUE2 + **self == FORCEDEVMODE_A::VALUE2 + } +} +impl core::ops::Deref for FORCEDEVMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ForceDevMode`"] +#[doc = "Field `ForceDevMode` writer - Force Device Mode"] pub struct FORCEDEVMODE_W<'a> { w: &'a mut W, } @@ -187,9 +262,7 @@ impl<'a> FORCEDEVMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FORCEDEVMODE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal Mode"] #[inline(always)] @@ -214,13 +287,25 @@ impl<'a> FORCEDEVMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `CTP`"] -pub type CTP_R = crate::R; -#[doc = "Write proxy for field `CTP`"] +#[doc = "Field `CTP` reader - Corrupt Tx packet"] +pub struct CTP_R(crate::FieldReader); +impl CTP_R { + pub(crate) fn new(bits: bool) -> Self { + CTP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTP` writer - Corrupt Tx packet"] pub struct CTP_W<'a> { w: &'a mut W, } @@ -238,7 +323,7 @@ impl<'a> CTP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -300,4 +385,30 @@ impl W { pub fn ctp(&mut self) -> CTP_W { CTP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "USB Configuration Register\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 [gusbcfg](index.html) module"] +pub struct GUSBCFG_SPEC; +impl crate::RegisterSpec for GUSBCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gusbcfg::R](R) reader structure"] +impl crate::Readable for GUSBCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gusbcfg::W](W) writer structure"] +impl crate::Writable for GUSBCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GUSBCFG to value 0x1440"] +impl crate::Resettable for GUSBCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1440 + } } diff --git a/src/usb0/pcgcctl.rs b/src/usb0/pcgcctl.rs index cd0fc06c..f3510c85 100644 --- a/src/usb0/pcgcctl.rs +++ b/src/usb0/pcgcctl.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PCGCCTL"] -pub type R = crate::R; -#[doc = "Writer for register PCGCCTL"] -pub type W = crate::W; -#[doc = "Register PCGCCTL `reset()`'s with value 0x0100"] -impl crate::ResetValue for super::PCGCCTL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100 +#[doc = "Register `PCGCCTL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Reader of field `StopPclk`"] -pub type STOPPCLK_R = crate::R; -#[doc = "Write proxy for field `StopPclk`"] +#[doc = "Register `PCGCCTL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `StopPclk` reader - Stop Pclk"] +pub struct STOPPCLK_R(crate::FieldReader); +impl STOPPCLK_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPCLK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STOPPCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `StopPclk` writer - Stop Pclk"] pub struct STOPPCLK_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> STOPPCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `GateHclk`"] -pub type GATEHCLK_R = crate::R; -#[doc = "Write proxy for field `GateHclk`"] +#[doc = "Field `GateHclk` reader - Gate Hclk"] +pub struct GATEHCLK_R(crate::FieldReader); +impl GATEHCLK_R { + pub(crate) fn new(bits: bool) -> Self { + GATEHCLK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GATEHCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GateHclk` writer - Gate Hclk"] pub struct GATEHCLK_W<'a> { w: &'a mut W, } @@ -54,7 +102,7 @@ impl<'a> GATEHCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -81,4 +129,30 @@ impl W { pub fn gate_hclk(&mut self) -> GATEHCLK_W { GATEHCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Power and Clock Gating Control Register\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 [pcgcctl](index.html) module"] +pub struct PCGCCTL_SPEC; +impl crate::RegisterSpec for PCGCCTL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcgcctl::R](R) reader structure"] +impl crate::Readable for PCGCCTL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcgcctl::W](W) writer structure"] +impl crate::Writable for PCGCCTL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCGCCTL to value 0x0100"] +impl crate::Resettable for PCGCCTL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100 + } } diff --git a/src/usb0_ep0.rs b/src/usb0_ep0.rs index fcd60ccb..5a97b8ed 100644 --- a/src/usb0_ep0.rs +++ b/src/usb0_ep0.rs @@ -2,146 +2,75 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Device Control IN Endpoint Control Register"] - pub diepctl0: DIEPCTL0, - _reserved1: [u8; 4usize], + pub diepctl0: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Device Endpoint Interrupt Register"] - pub diepint0: DIEPINT0, - _reserved2: [u8; 4usize], + pub diepint0: crate::Reg, + _reserved2: [u8; 0x04], #[doc = "0x10 - Device IN Endpoint Transfer Size Register"] - pub dieptsiz0: DIEPTSIZ0, + pub dieptsiz0: crate::Reg, #[doc = "0x14 - Device Endpoint DMA Address Register"] - pub diepdma0: DIEPDMA0, + pub diepdma0: crate::Reg, #[doc = "0x18 - Device IN Endpoint Transmit FIFO Status Register"] - pub dtxfsts0: DTXFSTS0, + pub dtxfsts0: crate::Reg, #[doc = "0x1c - Device Endpoint DMA Buffer Address Register"] - pub diepdmab0: DIEPDMAB0, - _reserved6: [u8; 480usize], + pub diepdmab0: crate::Reg, + _reserved6: [u8; 0x01e0], #[doc = "0x200 - Device Control OUT Endpoint Control Register"] - pub doepctl0: DOEPCTL0, - _reserved7: [u8; 4usize], + pub doepctl0: crate::Reg, + _reserved7: [u8; 0x04], #[doc = "0x208 - Device Endpoint Interrupt Register"] - pub doepint0: DOEPINT0, - _reserved8: [u8; 4usize], + pub doepint0: crate::Reg, + _reserved8: [u8; 0x04], #[doc = "0x210 - Device OUT Endpoint Transfer Size Register"] - pub doeptsiz0: DOEPTSIZ0, + pub doeptsiz0: crate::Reg, #[doc = "0x214 - Device Endpoint DMA Address Register"] - pub doepdma0: DOEPDMA0, - _reserved10: [u8; 4usize], + pub doepdma0: crate::Reg, + _reserved10: [u8; 0x04], #[doc = "0x21c - Device Endpoint DMA Buffer Address Register"] - pub doepdmab0: DOEPDMAB0, + pub doepdmab0: crate::Reg, } -#[doc = "Device Control IN Endpoint Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepctl0](diepctl0) module"] -pub type DIEPCTL0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPCTL0; -#[doc = "`read()` method returns [diepctl0::R](diepctl0::R) reader structure"] -impl crate::Readable for DIEPCTL0 {} -#[doc = "`write(|w| ..)` method takes [diepctl0::W](diepctl0::W) writer structure"] -impl crate::Writable for DIEPCTL0 {} +#[doc = "DIEPCTL0 register accessor: an alias for `Reg`"] +pub type DIEPCTL0 = crate::Reg; #[doc = "Device Control IN Endpoint Control Register"] pub mod diepctl0; -#[doc = "Device Endpoint Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepint0](diepint0) module"] -pub type DIEPINT0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPINT0; -#[doc = "`read()` method returns [diepint0::R](diepint0::R) reader structure"] -impl crate::Readable for DIEPINT0 {} -#[doc = "`write(|w| ..)` method takes [diepint0::W](diepint0::W) writer structure"] -impl crate::Writable for DIEPINT0 {} +#[doc = "DIEPINT0 register accessor: an alias for `Reg`"] +pub type DIEPINT0 = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod diepint0; -#[doc = "Device IN Endpoint Transfer Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptsiz0](dieptsiz0) module"] -pub type DIEPTSIZ0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTSIZ0; -#[doc = "`read()` method returns [dieptsiz0::R](dieptsiz0::R) reader structure"] -impl crate::Readable for DIEPTSIZ0 {} -#[doc = "`write(|w| ..)` method takes [dieptsiz0::W](dieptsiz0::W) writer structure"] -impl crate::Writable for DIEPTSIZ0 {} +#[doc = "DIEPTSIZ0 register accessor: an alias for `Reg`"] +pub type DIEPTSIZ0 = crate::Reg; #[doc = "Device IN Endpoint Transfer Size Register"] pub mod dieptsiz0; -#[doc = "Device Endpoint DMA Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdma0](diepdma0) module"] -pub type DIEPDMA0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPDMA0; -#[doc = "`read()` method returns [diepdma0::R](diepdma0::R) reader structure"] -impl crate::Readable for DIEPDMA0 {} -#[doc = "`write(|w| ..)` method takes [diepdma0::W](diepdma0::W) writer structure"] -impl crate::Writable for DIEPDMA0 {} +#[doc = "DIEPDMA0 register accessor: an alias for `Reg`"] +pub type DIEPDMA0 = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod diepdma0; -#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtxfsts0](dtxfsts0) module"] -pub type DTXFSTS0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTXFSTS0; -#[doc = "`read()` method returns [dtxfsts0::R](dtxfsts0::R) reader structure"] -impl crate::Readable for DTXFSTS0 {} +#[doc = "DTXFSTS0 register accessor: an alias for `Reg`"] +pub type DTXFSTS0 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Status Register"] pub mod dtxfsts0; -#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdmab0](diepdmab0) module"] -pub type DIEPDMAB0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPDMAB0; -#[doc = "`read()` method returns [diepdmab0::R](diepdmab0::R) reader structure"] -impl crate::Readable for DIEPDMAB0 {} +#[doc = "DIEPDMAB0 register accessor: an alias for `Reg`"] +pub type DIEPDMAB0 = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod diepdmab0; -#[doc = "Device Control OUT Endpoint Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepctl0](doepctl0) module"] -pub type DOEPCTL0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPCTL0; -#[doc = "`read()` method returns [doepctl0::R](doepctl0::R) reader structure"] -impl crate::Readable for DOEPCTL0 {} -#[doc = "`write(|w| ..)` method takes [doepctl0::W](doepctl0::W) writer structure"] -impl crate::Writable for DOEPCTL0 {} +#[doc = "DOEPCTL0 register accessor: an alias for `Reg`"] +pub type DOEPCTL0 = crate::Reg; #[doc = "Device Control OUT Endpoint Control Register"] pub mod doepctl0; -#[doc = "Device Endpoint Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepint0](doepint0) module"] -pub type DOEPINT0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPINT0; -#[doc = "`read()` method returns [doepint0::R](doepint0::R) reader structure"] -impl crate::Readable for DOEPINT0 {} -#[doc = "`write(|w| ..)` method takes [doepint0::W](doepint0::W) writer structure"] -impl crate::Writable for DOEPINT0 {} +#[doc = "DOEPINT0 register accessor: an alias for `Reg`"] +pub type DOEPINT0 = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod doepint0; -#[doc = "Device OUT Endpoint Transfer Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doeptsiz0](doeptsiz0) module"] -pub type DOEPTSIZ0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPTSIZ0; -#[doc = "`read()` method returns [doeptsiz0::R](doeptsiz0::R) reader structure"] -impl crate::Readable for DOEPTSIZ0 {} -#[doc = "`write(|w| ..)` method takes [doeptsiz0::W](doeptsiz0::W) writer structure"] -impl crate::Writable for DOEPTSIZ0 {} +#[doc = "DOEPTSIZ0 register accessor: an alias for `Reg`"] +pub type DOEPTSIZ0 = crate::Reg; #[doc = "Device OUT Endpoint Transfer Size Register"] pub mod doeptsiz0; -#[doc = "Device Endpoint DMA Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdma0](doepdma0) module"] -pub type DOEPDMA0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPDMA0; -#[doc = "`read()` method returns [doepdma0::R](doepdma0::R) reader structure"] -impl crate::Readable for DOEPDMA0 {} -#[doc = "`write(|w| ..)` method takes [doepdma0::W](doepdma0::W) writer structure"] -impl crate::Writable for DOEPDMA0 {} +#[doc = "DOEPDMA0 register accessor: an alias for `Reg`"] +pub type DOEPDMA0 = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod doepdma0; -#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdmab0](doepdmab0) module"] -pub type DOEPDMAB0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPDMAB0; -#[doc = "`read()` method returns [doepdmab0::R](doepdmab0::R) reader structure"] -impl crate::Readable for DOEPDMAB0 {} +#[doc = "DOEPDMAB0 register accessor: an alias for `Reg`"] +pub type DOEPDMAB0 = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod doepdmab0; diff --git a/src/usb0_ep0/diepctl0.rs b/src/usb0_ep0/diepctl0.rs index f035455c..80be5670 100644 --- a/src/usb0_ep0/diepctl0.rs +++ b/src/usb0_ep0/diepctl0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DIEPCTL0"] -pub type R = crate::R; -#[doc = "Writer for register DIEPCTL0"] -pub type W = crate::W; -#[doc = "Register DIEPCTL0 `reset()`'s with value 0x8000"] -impl crate::ResetValue for super::DIEPCTL0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x8000 +#[doc = "Register `DIEPCTL0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPCTL0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Maximum Packet Size\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); impl MPS_R { + pub(crate) fn new(bits: u8) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MPS_A { @@ -46,25 +73,32 @@ impl MPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MPS_A::VALUE1 + **self == MPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MPS_A::VALUE2 + **self == MPS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MPS_A::VALUE3 + **self == MPS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MPS_A::VALUE4 + **self == MPS_A::VALUE4 } } -#[doc = "Write proxy for field `MPS`"] +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MPS` writer - Maximum Packet Size"] pub struct MPS_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MPS_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "64 bytes"] #[inline(always)] @@ -99,12 +131,24 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "NAK Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum NAKSTS_A { @@ -119,9 +163,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -133,19 +180,50 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); +impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -163,13 +241,25 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); +impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -177,11 +267,11 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 22)) | (((value as u32) & 0x0f) << 22); + self.w.bits = (self.w.bits & !(0x0f << 22)) | ((value as u32 & 0x0f) << 22); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -199,11 +289,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -221,13 +311,25 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Write proxy for field `EPDis`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDis` writer - Endpoint Disable"] pub struct EPDIS_W<'a> { w: &'a mut W, } @@ -245,13 +347,25 @@ impl<'a> EPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -269,7 +383,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -351,4 +465,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Control IN Endpoint Control Register\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 [diepctl0](index.html) module"] +pub struct DIEPCTL0_SPEC; +impl crate::RegisterSpec for DIEPCTL0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepctl0::R](R) reader structure"] +impl crate::Readable for DIEPCTL0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepctl0::W](W) writer structure"] +impl crate::Writable for DIEPCTL0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPCTL0 to value 0x8000"] +impl crate::Resettable for DIEPCTL0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x8000 + } } diff --git a/src/usb0_ep0/diepdma0.rs b/src/usb0_ep0/diepdma0.rs index 959db7ce..2843495d 100644 --- a/src/usb0_ep0/diepdma0.rs +++ b/src/usb0_ep0/diepdma0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPDMA0"] -pub type R = crate::R; -#[doc = "Writer for register DIEPDMA0"] -pub type W = crate::W; -#[doc = "Register DIEPDMA0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPDMA0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPDMA0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPDMA0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DMAAddr`"] -pub type DMAADDR_R = crate::R; -#[doc = "Write proxy for field `DMAAddr`"] +#[doc = "Field `DMAAddr` reader - DMA Address"] +pub struct DMAADDR_R(crate::FieldReader); +impl DMAADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMAADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAAddr` writer - DMA Address"] pub struct DMAADDR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DMAADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dmaaddr(&mut self) -> DMAADDR_W { DMAADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint DMA Address Register\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 [diepdma0](index.html) module"] +pub struct DIEPDMA0_SPEC; +impl crate::RegisterSpec for DIEPDMA0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepdma0::R](R) reader structure"] +impl crate::Readable for DIEPDMA0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepdma0::W](W) writer structure"] +impl crate::Writable for DIEPDMA0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPDMA0 to value 0"] +impl crate::Resettable for DIEPDMA0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep0/diepdmab0.rs b/src/usb0_ep0/diepdmab0.rs index e4da7f94..04de5ee2 100644 --- a/src/usb0_ep0/diepdmab0.rs +++ b/src/usb0_ep0/diepdmab0.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DIEPDMAB0"] -pub type R = crate::R; -#[doc = "Reader of field `DMABufferAddr`"] -pub type DMABUFFERADDR_R = crate::R; +#[doc = "Register `DIEPDMAB0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] +pub struct DMABUFFERADDR_R(crate::FieldReader); +impl DMABUFFERADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMABUFFERADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMABUFFERADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DMABUFFERADDR_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdmab0](index.html) module"] +pub struct DIEPDMAB0_SPEC; +impl crate::RegisterSpec for DIEPDMAB0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepdmab0::R](R) reader structure"] +impl crate::Readable for DIEPDMAB0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DIEPDMAB0 to value 0"] +impl crate::Resettable for DIEPDMAB0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0_ep0/diepint0.rs b/src/usb0_ep0/diepint0.rs index a2738352..9db0bb56 100644 --- a/src/usb0_ep0/diepint0.rs +++ b/src/usb0_ep0/diepint0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPINT0"] -pub type R = crate::R; -#[doc = "Writer for register DIEPINT0"] -pub type W = crate::W; -#[doc = "Register DIEPINT0 `reset()`'s with value 0x80"] -impl crate::ResetValue for super::DIEPINT0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x80 +#[doc = "Register `DIEPINT0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPINT0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] +pub struct XFERCOMPL_R(crate::FieldReader); +impl XFERCOMPL_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPL_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `XferCompl`"] -pub type XFERCOMPL_R = crate::R; -#[doc = "Write proxy for field `XferCompl`"] +impl core::ops::Deref for XFERCOMPL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] pub struct XFERCOMPL_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbld`"] -pub type EPDISBLD_R = crate::R; -#[doc = "Write proxy for field `EPDisbld`"] +#[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] +pub struct EPDISBLD_R(crate::FieldReader); +impl EPDISBLD_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] pub struct EPDISBLD_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErr`"] -pub type AHBERR_R = crate::R; -#[doc = "Write proxy for field `AHBErr`"] +#[doc = "Field `AHBErr` reader - AHB Error"] +pub struct AHBERR_R(crate::FieldReader); +impl AHBERR_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErr` writer - AHB Error"] pub struct AHBERR_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `TimeOUT`"] -pub type TIMEOUT_R = crate::R; -#[doc = "Write proxy for field `TimeOUT`"] +#[doc = "Field `TimeOUT` reader - Timeout Condition"] +pub struct TIMEOUT_R(crate::FieldReader); +impl TIMEOUT_R { + pub(crate) fn new(bits: bool) -> Self { + TIMEOUT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TIMEOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TimeOUT` writer - Timeout Condition"] pub struct TIMEOUT_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> TIMEOUT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `INTknTXFEmp`"] -pub type INTKNTXFEMP_R = crate::R; -#[doc = "Write proxy for field `INTknTXFEmp`"] +#[doc = "Field `INTknTXFEmp` reader - IN Token Received When TxFIFO is Empty"] +pub struct INTKNTXFEMP_R(crate::FieldReader); +impl INTKNTXFEMP_R { + pub(crate) fn new(bits: bool) -> Self { + INTKNTXFEMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INTKNTXFEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INTknTXFEmp` writer - IN Token Received When TxFIFO is Empty"] pub struct INTKNTXFEMP_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> INTKNTXFEMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `INEPNakEff`"] -pub type INEPNAKEFF_R = crate::R; -#[doc = "Write proxy for field `INEPNakEff`"] +#[doc = "Field `INEPNakEff` reader - IN Endpoint NAK Effective"] +pub struct INEPNAKEFF_R(crate::FieldReader); +impl INEPNAKEFF_R { + pub(crate) fn new(bits: bool) -> Self { + INEPNAKEFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNAKEFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPNakEff` writer - IN Endpoint NAK Effective"] pub struct INEPNAKEFF_W<'a> { w: &'a mut W, } @@ -150,15 +246,39 @@ impl<'a> INEPNAKEFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `TxFEmp`"] -pub type TXFEMP_R = crate::R; -#[doc = "Reader of field `BNAIntr`"] -pub type BNAINTR_R = crate::R; -#[doc = "Write proxy for field `BNAIntr`"] +#[doc = "Field `TxFEmp` reader - Transmit FIFO Empty"] +pub struct TXFEMP_R(crate::FieldReader); +impl TXFEMP_R { + pub(crate) fn new(bits: bool) -> Self { + TXFEMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] +pub struct BNAINTR_R(crate::FieldReader); +impl BNAINTR_R { + pub(crate) fn new(bits: bool) -> Self { + BNAINTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAINTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] pub struct BNAINTR_W<'a> { w: &'a mut W, } @@ -176,7 +296,7 @@ impl<'a> BNAINTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -258,4 +378,30 @@ impl W { pub fn bnaintr(&mut self) -> BNAINTR_W { BNAINTR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Interrupt Register\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 [diepint0](index.html) module"] +pub struct DIEPINT0_SPEC; +impl crate::RegisterSpec for DIEPINT0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepint0::R](R) reader structure"] +impl crate::Readable for DIEPINT0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepint0::W](W) writer structure"] +impl crate::Writable for DIEPINT0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPINT0 to value 0x80"] +impl crate::Resettable for DIEPINT0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x80 + } } diff --git a/src/usb0_ep0/dieptsiz0.rs b/src/usb0_ep0/dieptsiz0.rs index 8b0f7393..9c160a1b 100644 --- a/src/usb0_ep0/dieptsiz0.rs +++ b/src/usb0_ep0/dieptsiz0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTSIZ0"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTSIZ0"] -pub type W = crate::W; -#[doc = "Register DIEPTSIZ0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPTSIZ0 { - type Type = u32; +#[doc = "Register `DIEPTSIZ0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTSIZ0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferSize` reader - Transfer Size"] +pub struct XFERSIZE_R(crate::FieldReader); +impl XFERSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + XFERSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferSize`"] -pub type XFERSIZE_R = crate::R; -#[doc = "Write proxy for field `XferSize`"] +#[doc = "Field `XferSize` writer - Transfer Size"] pub struct XFERSIZE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> XFERSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x7f) | ((value as u32) & 0x7f); + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); self.w } } -#[doc = "Reader of field `PktCnt`"] -pub type PKTCNT_R = crate::R; -#[doc = "Write proxy for field `PktCnt`"] +#[doc = "Field `PktCnt` reader - Packet Count"] +pub struct PKTCNT_R(crate::FieldReader); +impl PKTCNT_R { + pub(crate) fn new(bits: u8) -> Self { + PKTCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktCnt` writer - Packet Count"] pub struct PKTCNT_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PKTCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 19)) | (((value as u32) & 0x03) << 19); + self.w.bits = (self.w.bits & !(0x03 << 19)) | ((value as u32 & 0x03) << 19); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn pkt_cnt(&mut self) -> PKTCNT_W { PKTCNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device IN Endpoint Transfer Size Register\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 [dieptsiz0](index.html) module"] +pub struct DIEPTSIZ0_SPEC; +impl crate::RegisterSpec for DIEPTSIZ0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptsiz0::R](R) reader structure"] +impl crate::Readable for DIEPTSIZ0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptsiz0::W](W) writer structure"] +impl crate::Writable for DIEPTSIZ0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTSIZ0 to value 0"] +impl crate::Resettable for DIEPTSIZ0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep0/doepctl0.rs b/src/usb0_ep0/doepctl0.rs index adb24180..3fa05f2b 100644 --- a/src/usb0_ep0/doepctl0.rs +++ b/src/usb0_ep0/doepctl0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DOEPCTL0"] -pub type R = crate::R; -#[doc = "Writer for register DOEPCTL0"] -pub type W = crate::W; -#[doc = "Register DOEPCTL0 `reset()`'s with value 0x8000"] -impl crate::ResetValue for super::DOEPCTL0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x8000 +#[doc = "Register `DOEPCTL0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPCTL0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Maximum Packet Size\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); impl MPS_R { + pub(crate) fn new(bits: u8) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MPS_A { @@ -46,26 +73,45 @@ impl MPS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MPS_A::VALUE1 + **self == MPS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MPS_A::VALUE2 + **self == MPS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MPS_A::VALUE3 + **self == MPS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MPS_A::VALUE4 + **self == MPS_A::VALUE4 + } +} +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; #[doc = "NAK Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum NAKSTS_A { @@ -80,9 +126,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -94,19 +143,50 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; -#[doc = "Reader of field `Snp`"] -pub type SNP_R = crate::R; -#[doc = "Write proxy for field `Snp`"] +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); +impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` reader - Snoop Mode"] +pub struct SNP_R(crate::FieldReader); +impl SNP_R { + pub(crate) fn new(bits: bool) -> Self { + SNP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SNP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` writer - Snoop Mode"] pub struct SNP_W<'a> { w: &'a mut W, } @@ -124,13 +204,25 @@ impl<'a> SNP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -148,11 +240,11 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -170,11 +262,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -192,15 +284,39 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -218,7 +334,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -290,4 +406,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Control OUT Endpoint Control Register\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 [doepctl0](index.html) module"] +pub struct DOEPCTL0_SPEC; +impl crate::RegisterSpec for DOEPCTL0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepctl0::R](R) reader structure"] +impl crate::Readable for DOEPCTL0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepctl0::W](W) writer structure"] +impl crate::Writable for DOEPCTL0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPCTL0 to value 0x8000"] +impl crate::Resettable for DOEPCTL0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x8000 + } } diff --git a/src/usb0_ep0/doepdma0.rs b/src/usb0_ep0/doepdma0.rs index 42e12078..9e7c1bd4 100644 --- a/src/usb0_ep0/doepdma0.rs +++ b/src/usb0_ep0/doepdma0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPDMA0"] -pub type R = crate::R; -#[doc = "Writer for register DOEPDMA0"] -pub type W = crate::W; -#[doc = "Register DOEPDMA0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPDMA0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPDMA0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPDMA0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DMAAddr`"] -pub type DMAADDR_R = crate::R; -#[doc = "Write proxy for field `DMAAddr`"] +#[doc = "Field `DMAAddr` reader - DMA Address"] +pub struct DMAADDR_R(crate::FieldReader); +impl DMAADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMAADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAAddr` writer - DMA Address"] pub struct DMAADDR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DMAADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dmaaddr(&mut self) -> DMAADDR_W { DMAADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint DMA Address Register\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 [doepdma0](index.html) module"] +pub struct DOEPDMA0_SPEC; +impl crate::RegisterSpec for DOEPDMA0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepdma0::R](R) reader structure"] +impl crate::Readable for DOEPDMA0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepdma0::W](W) writer structure"] +impl crate::Writable for DOEPDMA0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPDMA0 to value 0"] +impl crate::Resettable for DOEPDMA0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep0/doepdmab0.rs b/src/usb0_ep0/doepdmab0.rs index 8dc5839c..1cff5fbc 100644 --- a/src/usb0_ep0/doepdmab0.rs +++ b/src/usb0_ep0/doepdmab0.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DOEPDMAB0"] -pub type R = crate::R; -#[doc = "Reader of field `DMABufferAddr`"] -pub type DMABUFFERADDR_R = crate::R; +#[doc = "Register `DOEPDMAB0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] +pub struct DMABUFFERADDR_R(crate::FieldReader); +impl DMABUFFERADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMABUFFERADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMABUFFERADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DMABUFFERADDR_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdmab0](index.html) module"] +pub struct DOEPDMAB0_SPEC; +impl crate::RegisterSpec for DOEPDMAB0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepdmab0::R](R) reader structure"] +impl crate::Readable for DOEPDMAB0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DOEPDMAB0 to value 0"] +impl crate::Resettable for DOEPDMAB0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0_ep0/doepint0.rs b/src/usb0_ep0/doepint0.rs index 81708617..9c3db13c 100644 --- a/src/usb0_ep0/doepint0.rs +++ b/src/usb0_ep0/doepint0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPINT0"] -pub type R = crate::R; -#[doc = "Writer for register DOEPINT0"] -pub type W = crate::W; -#[doc = "Register DOEPINT0 `reset()`'s with value 0x80"] -impl crate::ResetValue for super::DOEPINT0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x80 +#[doc = "Register `DOEPINT0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPINT0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `XferCompl`"] -pub type XFERCOMPL_R = crate::R; -#[doc = "Write proxy for field `XferCompl`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] +pub struct XFERCOMPL_R(crate::FieldReader); +impl XFERCOMPL_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERCOMPL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] pub struct XFERCOMPL_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbld`"] -pub type EPDISBLD_R = crate::R; -#[doc = "Write proxy for field `EPDisbld`"] +#[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] +pub struct EPDISBLD_R(crate::FieldReader); +impl EPDISBLD_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] pub struct EPDISBLD_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErr`"] -pub type AHBERR_R = crate::R; -#[doc = "Write proxy for field `AHBErr`"] +#[doc = "Field `AHBErr` reader - AHB Error"] +pub struct AHBERR_R(crate::FieldReader); +impl AHBERR_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErr` writer - AHB Error"] pub struct AHBERR_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `SetUp`"] -pub type SETUP_R = crate::R; -#[doc = "Write proxy for field `SetUp`"] +#[doc = "Field `SetUp` reader - SETUP Phase Done"] +pub struct SETUP_R(crate::FieldReader); +impl SETUP_R { + pub(crate) fn new(bits: bool) -> Self { + SETUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SETUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SetUp` writer - SETUP Phase Done"] pub struct SETUP_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> SETUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `OUTTknEPdis`"] -pub type OUTTKNEPDIS_R = crate::R; -#[doc = "Write proxy for field `OUTTknEPdis`"] +#[doc = "Field `OUTTknEPdis` reader - OUT Token Received When Endpoint Disabled"] +pub struct OUTTKNEPDIS_R(crate::FieldReader); +impl OUTTKNEPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + OUTTKNEPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTTKNEPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OUTTknEPdis` writer - OUT Token Received When Endpoint Disabled"] pub struct OUTTKNEPDIS_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> OUTTKNEPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `StsPhseRcvd`"] -pub type STSPHSERCVD_R = crate::R; -#[doc = "Write proxy for field `StsPhseRcvd`"] +#[doc = "Field `StsPhseRcvd` reader - Status Phase Received For Control Write"] +pub struct STSPHSERCVD_R(crate::FieldReader); +impl STSPHSERCVD_R { + pub(crate) fn new(bits: bool) -> Self { + STSPHSERCVD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STSPHSERCVD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `StsPhseRcvd` writer - Status Phase Received For Control Write"] pub struct STSPHSERCVD_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> STSPHSERCVD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `Back2BackSETup`"] -pub type BACK2BACKSETUP_R = crate::R; -#[doc = "Write proxy for field `Back2BackSETup`"] +#[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received"] +pub struct BACK2BACKSETUP_R(crate::FieldReader); +impl BACK2BACKSETUP_R { + pub(crate) fn new(bits: bool) -> Self { + BACK2BACKSETUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BACK2BACKSETUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received"] pub struct BACK2BACKSETUP_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> BACK2BACKSETUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `BNAIntr`"] -pub type BNAINTR_R = crate::R; -#[doc = "Write proxy for field `BNAIntr`"] +#[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] +pub struct BNAINTR_R(crate::FieldReader); +impl BNAINTR_R { + pub(crate) fn new(bits: bool) -> Self { + BNAINTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAINTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] pub struct BNAINTR_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> BNAINTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `PktDrpSts`"] -pub type PKTDRPSTS_R = crate::R; -#[doc = "Write proxy for field `PktDrpSts`"] +#[doc = "Field `PktDrpSts` reader - Packet Dropped Status"] +pub struct PKTDRPSTS_R(crate::FieldReader); +impl PKTDRPSTS_R { + pub(crate) fn new(bits: bool) -> Self { + PKTDRPSTS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTDRPSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktDrpSts` writer - Packet Dropped Status"] pub struct PKTDRPSTS_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> PKTDRPSTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `BbleErrIntrpt`"] -pub type BBLEERRINTRPT_R = crate::R; -#[doc = "Write proxy for field `BbleErrIntrpt`"] +#[doc = "Field `BbleErrIntrpt` reader - BbleErr (Babble Error) interrupt"] +pub struct BBLEERRINTRPT_R(crate::FieldReader); +impl BBLEERRINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + BBLEERRINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BBLEERRINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BbleErrIntrpt` writer - BbleErr (Babble Error) interrupt"] pub struct BBLEERRINTRPT_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> BBLEERRINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `NAKIntrpt`"] -pub type NAKINTRPT_R = crate::R; -#[doc = "Write proxy for field `NAKIntrpt`"] +#[doc = "Field `NAKIntrpt` reader - NAK interrupt"] +pub struct NAKINTRPT_R(crate::FieldReader); +impl NAKINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + NAKINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NAKINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NAKIntrpt` writer - NAK interrupt"] pub struct NAKINTRPT_W<'a> { w: &'a mut W, } @@ -270,13 +426,25 @@ impl<'a> NAKINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `NYETIntrpt`"] -pub type NYETINTRPT_R = crate::R; -#[doc = "Write proxy for field `NYETIntrpt`"] +#[doc = "Field `NYETIntrpt` reader - NYET interrupt"] +pub struct NYETINTRPT_R(crate::FieldReader); +impl NYETINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + NYETINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NYETINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NYETIntrpt` writer - NYET interrupt"] pub struct NYETINTRPT_W<'a> { w: &'a mut W, } @@ -294,7 +462,7 @@ impl<'a> NYETINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -421,4 +589,30 @@ impl W { pub fn nyetintrpt(&mut self) -> NYETINTRPT_W { NYETINTRPT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Interrupt Register\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 [doepint0](index.html) module"] +pub struct DOEPINT0_SPEC; +impl crate::RegisterSpec for DOEPINT0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepint0::R](R) reader structure"] +impl crate::Readable for DOEPINT0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepint0::W](W) writer structure"] +impl crate::Writable for DOEPINT0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPINT0 to value 0x80"] +impl crate::Resettable for DOEPINT0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x80 + } } diff --git a/src/usb0_ep0/doeptsiz0.rs b/src/usb0_ep0/doeptsiz0.rs index 2b8dd4a5..0cf1235d 100644 --- a/src/usb0_ep0/doeptsiz0.rs +++ b/src/usb0_ep0/doeptsiz0.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPTSIZ0"] -pub type R = crate::R; -#[doc = "Writer for register DOEPTSIZ0"] -pub type W = crate::W; -#[doc = "Register DOEPTSIZ0 `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPTSIZ0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPTSIZ0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPTSIZ0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferSize` reader - Transfer Size"] +pub struct XFERSIZE_R(crate::FieldReader); +impl XFERSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + XFERSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferSize`"] -pub type XFERSIZE_R = crate::R; -#[doc = "Write proxy for field `XferSize`"] +#[doc = "Field `XferSize` writer - Transfer Size"] pub struct XFERSIZE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> XFERSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x7f) | ((value as u32) & 0x7f); + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); self.w } } -#[doc = "Reader of field `PktCnt`"] -pub type PKTCNT_R = crate::R; -#[doc = "Write proxy for field `PktCnt`"] +#[doc = "Field `PktCnt` reader - Packet Count"] +pub struct PKTCNT_R(crate::FieldReader); +impl PKTCNT_R { + pub(crate) fn new(bits: u8) -> Self { + PKTCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktCnt` writer - Packet Count"] pub struct PKTCNT_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PKTCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 19)) | (((value as u32) & 0x03) << 19); + self.w.bits = (self.w.bits & !(0x03 << 19)) | ((value as u32 & 0x03) << 19); self.w } } @@ -55,37 +103,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUPCnt`"] -pub type SUPCNT_R = crate::R; +#[doc = "Field `SUPCnt` reader - SETUP Packet Count"] +pub struct SUPCNT_R(crate::FieldReader); impl SUPCNT_R { + pub(crate) fn new(bits: u8) -> Self { + SUPCNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(SUPCNT_A::VALUE1), - 2 => Val(SUPCNT_A::VALUE2), - 3 => Val(SUPCNT_A::VALUE3), - i => Res(i), + 1 => Some(SUPCNT_A::VALUE1), + 2 => Some(SUPCNT_A::VALUE2), + 3 => Some(SUPCNT_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUPCNT_A::VALUE1 + **self == SUPCNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUPCNT_A::VALUE2 + **self == SUPCNT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUPCNT_A::VALUE3 + **self == SUPCNT_A::VALUE3 + } +} +impl core::ops::Deref for SUPCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SUPCnt`"] +#[doc = "Field `SUPCnt` writer - SETUP Packet Count"] pub struct SUPCNT_W<'a> { w: &'a mut W, } @@ -113,7 +170,7 @@ impl<'a> SUPCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29); + self.w.bits = (self.w.bits & !(0x03 << 29)) | ((value as u32 & 0x03) << 29); self.w } } @@ -150,4 +207,30 @@ impl W { pub fn supcnt(&mut self) -> SUPCNT_W { SUPCNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device OUT Endpoint Transfer Size Register\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 [doeptsiz0](index.html) module"] +pub struct DOEPTSIZ0_SPEC; +impl crate::RegisterSpec for DOEPTSIZ0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doeptsiz0::R](R) reader structure"] +impl crate::Readable for DOEPTSIZ0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doeptsiz0::W](W) writer structure"] +impl crate::Writable for DOEPTSIZ0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPTSIZ0 to value 0"] +impl crate::Resettable for DOEPTSIZ0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep0/dtxfsts0.rs b/src/usb0_ep0/dtxfsts0.rs index 39432a03..9953f9ff 100644 --- a/src/usb0_ep0/dtxfsts0.rs +++ b/src/usb0_ep0/dtxfsts0.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register DTXFSTS0"] -pub type R = crate::R; +#[doc = "Register `DTXFSTS0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "IN Endpoint TxFIFO Space Avail\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] @@ -17,34 +30,43 @@ impl From for u16 { variant as _ } } -#[doc = "Reader of field `INEPTxFSpcAvail`"] -pub type INEPTXFSPCAVAIL_R = crate::R; +#[doc = "Field `INEPTxFSpcAvail` reader - IN Endpoint TxFIFO Space Avail"] +pub struct INEPTXFSPCAVAIL_R(crate::FieldReader); impl INEPTXFSPCAVAIL_R { + pub(crate) fn new(bits: u16) -> Self { + INEPTXFSPCAVAIL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(INEPTXFSPCAVAIL_A::VALUE1), - 1 => Val(INEPTXFSPCAVAIL_A::VALUE2), - 2 => Val(INEPTXFSPCAVAIL_A::VALUE3), - i => Res(i), + 0 => Some(INEPTXFSPCAVAIL_A::VALUE1), + 1 => Some(INEPTXFSPCAVAIL_A::VALUE2), + 2 => Some(INEPTXFSPCAVAIL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE1 + **self == INEPTXFSPCAVAIL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE2 + **self == INEPTXFSPCAVAIL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE3 + **self == INEPTXFSPCAVAIL_A::VALUE3 + } +} +impl core::ops::Deref for INEPTXFSPCAVAIL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -54,3 +76,19 @@ impl R { INEPTXFSPCAVAIL_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtxfsts0](index.html) module"] +pub struct DTXFSTS0_SPEC; +impl crate::RegisterSpec for DTXFSTS0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtxfsts0::R](R) reader structure"] +impl crate::Readable for DTXFSTS0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DTXFSTS0 to value 0"] +impl crate::Resettable for DTXFSTS0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0_ep1.rs b/src/usb0_ep1.rs index 67c762d8..69f8d80d 100644 --- a/src/usb0_ep1.rs +++ b/src/usb0_ep1.rs @@ -1,239 +1,117 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved_0_diepctl: [u8; 4usize], - _reserved1: [u8; 4usize], + _reserved_0_diepctl: [u8; 0x04], + _reserved1: [u8; 0x04], #[doc = "0x08 - Device Endpoint Interrupt Register"] - pub diepint: DIEPINT, - _reserved2: [u8; 4usize], + pub diepint: crate::Reg, + _reserved2: [u8; 0x04], #[doc = "0x10 - Device Endpoint Transfer Size Register"] - pub dieptsiz: DIEPTSIZ, + pub dieptsiz: crate::Reg, #[doc = "0x14 - Device Endpoint DMA Address Register"] - pub diepdma: DIEPDMA, + pub diepdma: crate::Reg, #[doc = "0x18 - Device IN Endpoint Transmit FIFO Status Register"] - pub dtxfsts: DTXFSTS, + pub dtxfsts: crate::Reg, #[doc = "0x1c - Device Endpoint DMA Buffer Address Register"] - pub diepdmab: DIEPDMAB, - _reserved6: [u8; 480usize], - _reserved_6_doepctl: [u8; 4usize], - _reserved7: [u8; 4usize], + pub diepdmab: crate::Reg, + _reserved6: [u8; 0x01e0], + _reserved_6_doepctl: [u8; 0x04], + _reserved7: [u8; 0x04], #[doc = "0x208 - Device Endpoint Interrupt Register"] - pub doepint: DOEPINT, - _reserved8: [u8; 4usize], - _reserved_8_doeptsiz: [u8; 4usize], + pub doepint: crate::Reg, + _reserved8: [u8; 0x04], + _reserved_8_doeptsiz: [u8; 0x04], #[doc = "0x214 - Device Endpoint DMA Address Register"] - pub doepdma: DOEPDMA, - _reserved10: [u8; 4usize], + pub doepdma: crate::Reg, + _reserved10: [u8; 0x04], #[doc = "0x21c - Device Endpoint DMA Buffer Address Register"] - pub doepdmab: DOEPDMAB, + pub doepdmab: crate::Reg, } impl RegisterBlock { #[doc = "0x00 - Device Endpoint Control Register \\[INTBULK\\]"] #[inline(always)] - pub fn diepctl_intbulk(&self) -> &DIEPCTL_INTBULK { - unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const DIEPCTL_INTBULK) } - } - #[doc = "0x00 - Device Endpoint Control Register \\[INTBULK\\]"] - #[inline(always)] - pub fn diepctl_intbulk_mut(&self) -> &mut DIEPCTL_INTBULK { - unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut DIEPCTL_INTBULK) } + pub fn diepctl_intbulk(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const crate::Reg) } } #[doc = "0x00 - Device Endpoint Control Register \\[ISOCONT\\]"] #[inline(always)] - pub fn diepctl_isocont(&self) -> &DIEPCTL_ISOCONT { - unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const DIEPCTL_ISOCONT) } - } - #[doc = "0x00 - Device Endpoint Control Register \\[ISOCONT\\]"] - #[inline(always)] - pub fn diepctl_isocont_mut(&self) -> &mut DIEPCTL_ISOCONT { - unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut DIEPCTL_ISOCONT) } - } - #[doc = "0x200 - Device Endpoint Control Register \\[INTBULK\\]"] - #[inline(always)] - pub fn doepctl_intbulk(&self) -> &DOEPCTL_INTBULK { - unsafe { &*(((self as *const Self) as *const u8).add(512usize) as *const DOEPCTL_INTBULK) } + pub fn diepctl_isocont(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const crate::Reg) } } #[doc = "0x200 - Device Endpoint Control Register \\[INTBULK\\]"] #[inline(always)] - pub fn doepctl_intbulk_mut(&self) -> &mut DOEPCTL_INTBULK { - unsafe { &mut *(((self as *const Self) as *mut u8).add(512usize) as *mut DOEPCTL_INTBULK) } + pub fn doepctl_intbulk(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(512usize) as *const crate::Reg) } } #[doc = "0x200 - Device Endpoint Control Register \\[ISOCONT\\]"] #[inline(always)] - pub fn doepctl_isocont(&self) -> &DOEPCTL_ISOCONT { - unsafe { &*(((self as *const Self) as *const u8).add(512usize) as *const DOEPCTL_ISOCONT) } - } - #[doc = "0x200 - Device Endpoint Control Register \\[ISOCONT\\]"] - #[inline(always)] - pub fn doepctl_isocont_mut(&self) -> &mut DOEPCTL_ISOCONT { - unsafe { &mut *(((self as *const Self) as *mut u8).add(512usize) as *mut DOEPCTL_ISOCONT) } + pub fn doepctl_isocont(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(512usize) as *const crate::Reg) } } #[doc = "0x210 - Device Endpoint Transfer Size Register \\[CONT\\]"] #[inline(always)] - pub fn doeptsiz_control(&self) -> &DOEPTSIZ_CONTROL { - unsafe { &*(((self as *const Self) as *const u8).add(528usize) as *const DOEPTSIZ_CONTROL) } - } - #[doc = "0x210 - Device Endpoint Transfer Size Register \\[CONT\\]"] - #[inline(always)] - pub fn doeptsiz_control_mut(&self) -> &mut DOEPTSIZ_CONTROL { - unsafe { &mut *(((self as *const Self) as *mut u8).add(528usize) as *mut DOEPTSIZ_CONTROL) } - } - #[doc = "0x210 - Device Endpoint Transfer Size Register \\[ISO\\]"] - #[inline(always)] - pub fn doeptsiz_iso(&self) -> &DOEPTSIZ_ISO { - unsafe { &*(((self as *const Self) as *const u8).add(528usize) as *const DOEPTSIZ_ISO) } + pub fn doeptsiz_control(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(528usize) as *const crate::Reg) } } #[doc = "0x210 - Device Endpoint Transfer Size Register \\[ISO\\]"] #[inline(always)] - pub fn doeptsiz_iso_mut(&self) -> &mut DOEPTSIZ_ISO { - unsafe { &mut *(((self as *const Self) as *mut u8).add(528usize) as *mut DOEPTSIZ_ISO) } + pub fn doeptsiz_iso(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(528usize) as *const crate::Reg) } } } -#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepctl_isocont](diepctl_isocont) module"] -pub type DIEPCTL_ISOCONT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPCTL_ISOCONT; -#[doc = "`read()` method returns [diepctl_isocont::R](diepctl_isocont::R) reader structure"] -impl crate::Readable for DIEPCTL_ISOCONT {} -#[doc = "`write(|w| ..)` method takes [diepctl_isocont::W](diepctl_isocont::W) writer structure"] -impl crate::Writable for DIEPCTL_ISOCONT {} +#[doc = "DIEPCTL_ISOCONT register accessor: an alias for `Reg`"] +pub type DIEPCTL_ISOCONT = crate::Reg; #[doc = "Device Endpoint Control Register \\[ISOCONT\\]"] pub mod diepctl_isocont; -#[doc = "Device Endpoint Control Register \\[INTBULK\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepctl_intbulk](diepctl_intbulk) module"] -pub type DIEPCTL_INTBULK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPCTL_INTBULK; -#[doc = "`read()` method returns [diepctl_intbulk::R](diepctl_intbulk::R) reader structure"] -impl crate::Readable for DIEPCTL_INTBULK {} -#[doc = "`write(|w| ..)` method takes [diepctl_intbulk::W](diepctl_intbulk::W) writer structure"] -impl crate::Writable for DIEPCTL_INTBULK {} +#[doc = "DIEPCTL_INTBULK register accessor: an alias for `Reg`"] +pub type DIEPCTL_INTBULK = crate::Reg; #[doc = "Device Endpoint Control Register \\[INTBULK\\]"] pub mod diepctl_intbulk; -#[doc = "Device Endpoint Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepint](diepint) module"] -pub type DIEPINT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPINT; -#[doc = "`read()` method returns [diepint::R](diepint::R) reader structure"] -impl crate::Readable for DIEPINT {} -#[doc = "`write(|w| ..)` method takes [diepint::W](diepint::W) writer structure"] -impl crate::Writable for DIEPINT {} +#[doc = "DIEPINT register accessor: an alias for `Reg`"] +pub type DIEPINT = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod diepint; -#[doc = "Device Endpoint Transfer Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dieptsiz](dieptsiz) module"] -pub type DIEPTSIZ = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPTSIZ; -#[doc = "`read()` method returns [dieptsiz::R](dieptsiz::R) reader structure"] -impl crate::Readable for DIEPTSIZ {} -#[doc = "`write(|w| ..)` method takes [dieptsiz::W](dieptsiz::W) writer structure"] -impl crate::Writable for DIEPTSIZ {} +#[doc = "DIEPTSIZ register accessor: an alias for `Reg`"] +pub type DIEPTSIZ = crate::Reg; #[doc = "Device Endpoint Transfer Size Register"] pub mod dieptsiz; -#[doc = "Device Endpoint DMA Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdma](diepdma) module"] -pub type DIEPDMA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPDMA; -#[doc = "`read()` method returns [diepdma::R](diepdma::R) reader structure"] -impl crate::Readable for DIEPDMA {} -#[doc = "`write(|w| ..)` method takes [diepdma::W](diepdma::W) writer structure"] -impl crate::Writable for DIEPDMA {} +#[doc = "DIEPDMA register accessor: an alias for `Reg`"] +pub type DIEPDMA = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod diepdma; -#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtxfsts](dtxfsts) module"] -pub type DTXFSTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DTXFSTS; -#[doc = "`read()` method returns [dtxfsts::R](dtxfsts::R) reader structure"] -impl crate::Readable for DTXFSTS {} +#[doc = "DTXFSTS register accessor: an alias for `Reg`"] +pub type DTXFSTS = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Status Register"] pub mod dtxfsts; -#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdmab](diepdmab) module"] -pub type DIEPDMAB = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DIEPDMAB; -#[doc = "`read()` method returns [diepdmab::R](diepdmab::R) reader structure"] -impl crate::Readable for DIEPDMAB {} +#[doc = "DIEPDMAB register accessor: an alias for `Reg`"] +pub type DIEPDMAB = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod diepdmab; -#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepctl_isocont](doepctl_isocont) module"] -pub type DOEPCTL_ISOCONT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPCTL_ISOCONT; -#[doc = "`read()` method returns [doepctl_isocont::R](doepctl_isocont::R) reader structure"] -impl crate::Readable for DOEPCTL_ISOCONT {} -#[doc = "`write(|w| ..)` method takes [doepctl_isocont::W](doepctl_isocont::W) writer structure"] -impl crate::Writable for DOEPCTL_ISOCONT {} +#[doc = "DOEPCTL_ISOCONT register accessor: an alias for `Reg`"] +pub type DOEPCTL_ISOCONT = crate::Reg; #[doc = "Device Endpoint Control Register \\[ISOCONT\\]"] pub mod doepctl_isocont; -#[doc = "Device Endpoint Control Register \\[INTBULK\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepctl_intbulk](doepctl_intbulk) module"] -pub type DOEPCTL_INTBULK = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPCTL_INTBULK; -#[doc = "`read()` method returns [doepctl_intbulk::R](doepctl_intbulk::R) reader structure"] -impl crate::Readable for DOEPCTL_INTBULK {} -#[doc = "`write(|w| ..)` method takes [doepctl_intbulk::W](doepctl_intbulk::W) writer structure"] -impl crate::Writable for DOEPCTL_INTBULK {} +#[doc = "DOEPCTL_INTBULK register accessor: an alias for `Reg`"] +pub type DOEPCTL_INTBULK = crate::Reg; #[doc = "Device Endpoint Control Register \\[INTBULK\\]"] pub mod doepctl_intbulk; -#[doc = "Device Endpoint Interrupt Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepint](doepint) module"] -pub type DOEPINT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPINT; -#[doc = "`read()` method returns [doepint::R](doepint::R) reader structure"] -impl crate::Readable for DOEPINT {} -#[doc = "`write(|w| ..)` method takes [doepint::W](doepint::W) writer structure"] -impl crate::Writable for DOEPINT {} +#[doc = "DOEPINT register accessor: an alias for `Reg`"] +pub type DOEPINT = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod doepint; -#[doc = "Device Endpoint Transfer Size Register \\[ISO\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doeptsiz_iso](doeptsiz_iso) module"] -pub type DOEPTSIZ_ISO = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPTSIZ_ISO; -#[doc = "`read()` method returns [doeptsiz_iso::R](doeptsiz_iso::R) reader structure"] -impl crate::Readable for DOEPTSIZ_ISO {} -#[doc = "`write(|w| ..)` method takes [doeptsiz_iso::W](doeptsiz_iso::W) writer structure"] -impl crate::Writable for DOEPTSIZ_ISO {} +#[doc = "DOEPTSIZ_ISO register accessor: an alias for `Reg`"] +pub type DOEPTSIZ_ISO = crate::Reg; #[doc = "Device Endpoint Transfer Size Register \\[ISO\\]"] pub mod doeptsiz_iso; -#[doc = "Device Endpoint Transfer Size Register \\[CONT\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doeptsiz_control](doeptsiz_control) module"] -pub type DOEPTSIZ_CONTROL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPTSIZ_CONTROL; -#[doc = "`read()` method returns [doeptsiz_control::R](doeptsiz_control::R) reader structure"] -impl crate::Readable for DOEPTSIZ_CONTROL {} -#[doc = "`write(|w| ..)` method takes [doeptsiz_control::W](doeptsiz_control::W) writer structure"] -impl crate::Writable for DOEPTSIZ_CONTROL {} +#[doc = "DOEPTSIZ_CONTROL register accessor: an alias for `Reg`"] +pub type DOEPTSIZ_CONTROL = crate::Reg; #[doc = "Device Endpoint Transfer Size Register \\[CONT\\]"] pub mod doeptsiz_control; -#[doc = "Device Endpoint DMA Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdma](doepdma) module"] -pub type DOEPDMA = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPDMA; -#[doc = "`read()` method returns [doepdma::R](doepdma::R) reader structure"] -impl crate::Readable for DOEPDMA {} -#[doc = "`write(|w| ..)` method takes [doepdma::W](doepdma::W) writer structure"] -impl crate::Writable for DOEPDMA {} +#[doc = "DOEPDMA register accessor: an alias for `Reg`"] +pub type DOEPDMA = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod doepdma; -#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdmab](doepdmab) module"] -pub type DOEPDMAB = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DOEPDMAB; -#[doc = "`read()` method returns [doepdmab::R](doepdmab::R) reader structure"] -impl crate::Readable for DOEPDMAB {} +#[doc = "DOEPDMAB register accessor: an alias for `Reg`"] +pub type DOEPDMAB = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod doepdmab; diff --git a/src/usb0_ep1/diepctl_intbulk.rs b/src/usb0_ep1/diepctl_intbulk.rs index 8602c565..dc4ddb3a 100644 --- a/src/usb0_ep1/diepctl_intbulk.rs +++ b/src/usb0_ep1/diepctl_intbulk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPCTL_INTBULK"] -pub type R = crate::R; -#[doc = "Writer for register DIEPCTL_INTBULK"] -pub type W = crate::W; -#[doc = "Register DIEPCTL_INTBULK `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPCTL_INTBULK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPCTL_INTBULK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPCTL_INTBULK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); +impl MPS_R { + pub(crate) fn new(bits: u16) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; -#[doc = "Write proxy for field `MPS`"] +#[doc = "Field `MPS` writer - Maximum Packet Size"] pub struct MPS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07ff) | ((value as u32) & 0x07ff); + self.w.bits = (self.w.bits & !0x07ff) | (value as u32 & 0x07ff); self.w } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; -#[doc = "Write proxy for field `USBActEP`"] +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBActEP` writer - USB Active Endpoint"] pub struct USBACTEP_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> USBACTEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -62,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPID`"] -pub type DPID_R = crate::R; +#[doc = "Field `DPID` reader - Endpoint Data PID"] +pub struct DPID_R(crate::FieldReader); impl DPID_R { + pub(crate) fn new(bits: bool) -> Self { + DPID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPID_A { @@ -76,12 +127,19 @@ impl DPID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPID_A::VALUE1 + **self == DPID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPID_A::VALUE2 + **self == DPID_A::VALUE2 + } +} +impl core::ops::Deref for DPID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "NAK Status\n\nValue on reset: 0"] @@ -98,9 +156,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -112,12 +173,19 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Endpoint Type\n\nValue on reset: 0"] @@ -139,9 +207,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPTYPE_A { @@ -156,25 +227,32 @@ impl EPTYPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPTYPE_A::VALUE1 + **self == EPTYPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPTYPE_A::VALUE2 + **self == EPTYPE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EPTYPE_A::VALUE3 + **self == EPTYPE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EPTYPE_A::VALUE4 + **self == EPTYPE_A::VALUE4 + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EPType`"] +#[doc = "Field `EPType` writer - Endpoint Type"] pub struct EPTYPE_W<'a> { w: &'a mut W, } @@ -182,9 +260,7 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPTYPE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Control"] #[inline(always)] @@ -209,13 +285,25 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } -#[doc = "Reader of field `Snp`"] -pub type SNP_R = crate::R; -#[doc = "Write proxy for field `Snp`"] +#[doc = "Field `Snp` reader - Snoop Mode"] +pub struct SNP_R(crate::FieldReader); +impl SNP_R { + pub(crate) fn new(bits: bool) -> Self { + SNP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SNP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` writer - Snoop Mode"] pub struct SNP_W<'a> { w: &'a mut W, } @@ -233,13 +321,25 @@ impl<'a> SNP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -257,13 +357,25 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); +impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -271,11 +383,11 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 22)) | (((value as u32) & 0x0f) << 22); + self.w.bits = (self.w.bits & !(0x0f << 22)) | ((value as u32 & 0x0f) << 22); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -293,11 +405,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -315,11 +427,11 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `SetD0PID`"] +#[doc = "Field `SetD0PID` writer - Set DATA0 PID"] pub struct SETD0PID_W<'a> { w: &'a mut W, } @@ -337,11 +449,11 @@ impl<'a> SETD0PID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `SetD1PID`"] +#[doc = "Field `SetD1PID` writer - 29 Set DATA1 PID"] pub struct SETD1PID_W<'a> { w: &'a mut W, } @@ -359,13 +471,25 @@ impl<'a> SETD1PID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Write proxy for field `EPDis`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDis` writer - Endpoint Disable"] pub struct EPDIS_W<'a> { w: &'a mut W, } @@ -383,13 +507,25 @@ impl<'a> EPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -407,7 +543,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -524,4 +660,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Control Register \\[INTBULK\\]\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 [diepctl_intbulk](index.html) module"] +pub struct DIEPCTL_INTBULK_SPEC; +impl crate::RegisterSpec for DIEPCTL_INTBULK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepctl_intbulk::R](R) reader structure"] +impl crate::Readable for DIEPCTL_INTBULK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepctl_intbulk::W](W) writer structure"] +impl crate::Writable for DIEPCTL_INTBULK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPCTL_INTBULK to value 0"] +impl crate::Resettable for DIEPCTL_INTBULK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/diepctl_isocont.rs b/src/usb0_ep1/diepctl_isocont.rs index 6cba1bd8..f5c0cb70 100644 --- a/src/usb0_ep1/diepctl_isocont.rs +++ b/src/usb0_ep1/diepctl_isocont.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPCTL_ISOCONT"] -pub type R = crate::R; -#[doc = "Writer for register DIEPCTL_ISOCONT"] -pub type W = crate::W; -#[doc = "Register DIEPCTL_ISOCONT `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPCTL_ISOCONT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPCTL_ISOCONT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPCTL_ISOCONT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); +impl MPS_R { + pub(crate) fn new(bits: u16) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; -#[doc = "Write proxy for field `MPS`"] +#[doc = "Field `MPS` writer - Maximum Packet Size"] pub struct MPS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07ff) | ((value as u32) & 0x07ff); + self.w.bits = (self.w.bits & !0x07ff) | (value as u32 & 0x07ff); self.w } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; -#[doc = "Write proxy for field `USBActEP`"] +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBActEP` writer - USB Active Endpoint"] pub struct USBACTEP_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> USBACTEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -62,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EO_FrNum`"] -pub type EO_FRNUM_R = crate::R; +#[doc = "Field `EO_FrNum` reader - Even/Odd Frame"] +pub struct EO_FRNUM_R(crate::FieldReader); impl EO_FRNUM_R { + pub(crate) fn new(bits: bool) -> Self { + EO_FRNUM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EO_FRNUM_A { @@ -76,12 +127,19 @@ impl EO_FRNUM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EO_FRNUM_A::VALUE1 + **self == EO_FRNUM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EO_FRNUM_A::VALUE2 + **self == EO_FRNUM_A::VALUE2 + } +} +impl core::ops::Deref for EO_FRNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "NAK Status\n\nValue on reset: 0"] @@ -98,9 +156,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -112,12 +173,19 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Endpoint Type\n\nValue on reset: 0"] @@ -139,9 +207,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPTYPE_A { @@ -156,25 +227,32 @@ impl EPTYPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPTYPE_A::VALUE1 + **self == EPTYPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPTYPE_A::VALUE2 + **self == EPTYPE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EPTYPE_A::VALUE3 + **self == EPTYPE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EPTYPE_A::VALUE4 + **self == EPTYPE_A::VALUE4 + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EPType`"] +#[doc = "Field `EPType` writer - Endpoint Type"] pub struct EPTYPE_W<'a> { w: &'a mut W, } @@ -182,9 +260,7 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPTYPE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Control"] #[inline(always)] @@ -209,13 +285,25 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } -#[doc = "Reader of field `Snp`"] -pub type SNP_R = crate::R; -#[doc = "Write proxy for field `Snp`"] +#[doc = "Field `Snp` reader - Snoop Mode"] +pub struct SNP_R(crate::FieldReader); +impl SNP_R { + pub(crate) fn new(bits: bool) -> Self { + SNP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SNP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` writer - Snoop Mode"] pub struct SNP_W<'a> { w: &'a mut W, } @@ -233,13 +321,25 @@ impl<'a> SNP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -257,13 +357,25 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); +impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -271,11 +383,11 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 22)) | (((value as u32) & 0x0f) << 22); + self.w.bits = (self.w.bits & !(0x0f << 22)) | ((value as u32 & 0x0f) << 22); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -293,11 +405,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -315,11 +427,11 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `SetEvenFr`"] +#[doc = "Field `SetEvenFr` writer - In non-Scatter/Gather DMA mode: Set Even frame"] pub struct SETEVENFR_W<'a> { w: &'a mut W, } @@ -337,11 +449,11 @@ impl<'a> SETEVENFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `SetOddFr`"] +#[doc = "Field `SetOddFr` writer - Set Odd frame"] pub struct SETODDFR_W<'a> { w: &'a mut W, } @@ -359,13 +471,25 @@ impl<'a> SETODDFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Write proxy for field `EPDis`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDis` writer - Endpoint Disable"] pub struct EPDIS_W<'a> { w: &'a mut W, } @@ -383,13 +507,25 @@ impl<'a> EPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -407,7 +543,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -524,4 +660,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\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 [diepctl_isocont](index.html) module"] +pub struct DIEPCTL_ISOCONT_SPEC; +impl crate::RegisterSpec for DIEPCTL_ISOCONT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepctl_isocont::R](R) reader structure"] +impl crate::Readable for DIEPCTL_ISOCONT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepctl_isocont::W](W) writer structure"] +impl crate::Writable for DIEPCTL_ISOCONT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPCTL_ISOCONT to value 0"] +impl crate::Resettable for DIEPCTL_ISOCONT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/diepdma.rs b/src/usb0_ep1/diepdma.rs index 53ff9d99..a728e062 100644 --- a/src/usb0_ep1/diepdma.rs +++ b/src/usb0_ep1/diepdma.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPDMA"] -pub type R = crate::R; -#[doc = "Writer for register DIEPDMA"] -pub type W = crate::W; -#[doc = "Register DIEPDMA `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPDMA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DIEPDMA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPDMA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DMAAddr`"] -pub type DMAADDR_R = crate::R; -#[doc = "Write proxy for field `DMAAddr`"] +#[doc = "Field `DMAAddr` reader - DMA Address"] +pub struct DMAADDR_R(crate::FieldReader); +impl DMAADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMAADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAAddr` writer - DMA Address"] pub struct DMAADDR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DMAADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dmaaddr(&mut self) -> DMAADDR_W { DMAADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint DMA Address Register\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 [diepdma](index.html) module"] +pub struct DIEPDMA_SPEC; +impl crate::RegisterSpec for DIEPDMA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepdma::R](R) reader structure"] +impl crate::Readable for DIEPDMA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepdma::W](W) writer structure"] +impl crate::Writable for DIEPDMA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPDMA to value 0"] +impl crate::Resettable for DIEPDMA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/diepdmab.rs b/src/usb0_ep1/diepdmab.rs index a7c38a73..bc7fe309 100644 --- a/src/usb0_ep1/diepdmab.rs +++ b/src/usb0_ep1/diepdmab.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DIEPDMAB"] -pub type R = crate::R; -#[doc = "Reader of field `DMABufferAddr`"] -pub type DMABUFFERADDR_R = crate::R; +#[doc = "Register `DIEPDMAB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] +pub struct DMABUFFERADDR_R(crate::FieldReader); +impl DMABUFFERADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMABUFFERADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMABUFFERADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DMABUFFERADDR_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [diepdmab](index.html) module"] +pub struct DIEPDMAB_SPEC; +impl crate::RegisterSpec for DIEPDMAB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepdmab::R](R) reader structure"] +impl crate::Readable for DIEPDMAB_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DIEPDMAB to value 0"] +impl crate::Resettable for DIEPDMAB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0_ep1/diepint.rs b/src/usb0_ep1/diepint.rs index 7ef3dc6e..e5fdba4d 100644 --- a/src/usb0_ep1/diepint.rs +++ b/src/usb0_ep1/diepint.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPINT"] -pub type R = crate::R; -#[doc = "Writer for register DIEPINT"] -pub type W = crate::W; -#[doc = "Register DIEPINT `reset()`'s with value 0x80"] -impl crate::ResetValue for super::DIEPINT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x80 +#[doc = "Register `DIEPINT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPINT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] +pub struct XFERCOMPL_R(crate::FieldReader); +impl XFERCOMPL_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPL_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `XferCompl`"] -pub type XFERCOMPL_R = crate::R; -#[doc = "Write proxy for field `XferCompl`"] +impl core::ops::Deref for XFERCOMPL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] pub struct XFERCOMPL_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbld`"] -pub type EPDISBLD_R = crate::R; -#[doc = "Write proxy for field `EPDisbld`"] +#[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] +pub struct EPDISBLD_R(crate::FieldReader); +impl EPDISBLD_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] pub struct EPDISBLD_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErr`"] -pub type AHBERR_R = crate::R; -#[doc = "Write proxy for field `AHBErr`"] +#[doc = "Field `AHBErr` reader - AHB Error"] +pub struct AHBERR_R(crate::FieldReader); +impl AHBERR_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErr` writer - AHB Error"] pub struct AHBERR_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `TimeOUT`"] -pub type TIMEOUT_R = crate::R; -#[doc = "Write proxy for field `TimeOUT`"] +#[doc = "Field `TimeOUT` reader - Timeout Condition"] +pub struct TIMEOUT_R(crate::FieldReader); +impl TIMEOUT_R { + pub(crate) fn new(bits: bool) -> Self { + TIMEOUT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TIMEOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TimeOUT` writer - Timeout Condition"] pub struct TIMEOUT_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> TIMEOUT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `INTknTXFEmp`"] -pub type INTKNTXFEMP_R = crate::R; -#[doc = "Write proxy for field `INTknTXFEmp`"] +#[doc = "Field `INTknTXFEmp` reader - IN Token Received When TxFIFO is Empty"] +pub struct INTKNTXFEMP_R(crate::FieldReader); +impl INTKNTXFEMP_R { + pub(crate) fn new(bits: bool) -> Self { + INTKNTXFEMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INTKNTXFEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INTknTXFEmp` writer - IN Token Received When TxFIFO is Empty"] pub struct INTKNTXFEMP_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> INTKNTXFEMP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `INEPNakEff`"] -pub type INEPNAKEFF_R = crate::R; -#[doc = "Write proxy for field `INEPNakEff`"] +#[doc = "Field `INEPNakEff` reader - IN Endpoint NAK Effective"] +pub struct INEPNAKEFF_R(crate::FieldReader); +impl INEPNAKEFF_R { + pub(crate) fn new(bits: bool) -> Self { + INEPNAKEFF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INEPNAKEFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INEPNakEff` writer - IN Endpoint NAK Effective"] pub struct INEPNAKEFF_W<'a> { w: &'a mut W, } @@ -150,15 +246,39 @@ impl<'a> INEPNAKEFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `TxFEmp`"] -pub type TXFEMP_R = crate::R; -#[doc = "Reader of field `BNAIntr`"] -pub type BNAINTR_R = crate::R; -#[doc = "Write proxy for field `BNAIntr`"] +#[doc = "Field `TxFEmp` reader - Transmit FIFO Empty"] +pub struct TXFEMP_R(crate::FieldReader); +impl TXFEMP_R { + pub(crate) fn new(bits: bool) -> Self { + TXFEMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] +pub struct BNAINTR_R(crate::FieldReader); +impl BNAINTR_R { + pub(crate) fn new(bits: bool) -> Self { + BNAINTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAINTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] pub struct BNAINTR_W<'a> { w: &'a mut W, } @@ -176,7 +296,7 @@ impl<'a> BNAINTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -258,4 +378,30 @@ impl W { pub fn bnaintr(&mut self) -> BNAINTR_W { BNAINTR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Interrupt Register\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 [diepint](index.html) module"] +pub struct DIEPINT_SPEC; +impl crate::RegisterSpec for DIEPINT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [diepint::R](R) reader structure"] +impl crate::Readable for DIEPINT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [diepint::W](W) writer structure"] +impl crate::Writable for DIEPINT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPINT to value 0x80"] +impl crate::Resettable for DIEPINT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x80 + } } diff --git a/src/usb0_ep1/dieptsiz.rs b/src/usb0_ep1/dieptsiz.rs index dac81543..ea565d78 100644 --- a/src/usb0_ep1/dieptsiz.rs +++ b/src/usb0_ep1/dieptsiz.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DIEPTSIZ"] -pub type R = crate::R; -#[doc = "Writer for register DIEPTSIZ"] -pub type W = crate::W; -#[doc = "Register DIEPTSIZ `reset()`'s with value 0"] -impl crate::ResetValue for super::DIEPTSIZ { - type Type = u32; +#[doc = "Register `DIEPTSIZ` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIEPTSIZ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferSize` reader - Transfer Size"] +pub struct XFERSIZE_R(crate::FieldReader); +impl XFERSIZE_R { + pub(crate) fn new(bits: u32) -> Self { + XFERSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferSize`"] -pub type XFERSIZE_R = crate::R; -#[doc = "Write proxy for field `XferSize`"] +#[doc = "Field `XferSize` writer - Transfer Size"] pub struct XFERSIZE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> XFERSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0007_ffff) | ((value as u32) & 0x0007_ffff); + self.w.bits = (self.w.bits & !0x0007_ffff) | (value as u32 & 0x0007_ffff); self.w } } -#[doc = "Reader of field `PktCnt`"] -pub type PKTCNT_R = crate::R; -#[doc = "Write proxy for field `PktCnt`"] +#[doc = "Field `PktCnt` reader - Packet Count"] +pub struct PKTCNT_R(crate::FieldReader); +impl PKTCNT_R { + pub(crate) fn new(bits: u16) -> Self { + PKTCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktCnt` writer - Packet Count"] pub struct PKTCNT_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PKTCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 19)) | (((value as u32) & 0x03ff) << 19); + self.w.bits = (self.w.bits & !(0x03ff << 19)) | ((value as u32 & 0x03ff) << 19); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn pkt_cnt(&mut self) -> PKTCNT_W { PKTCNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Transfer Size Register\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 [dieptsiz](index.html) module"] +pub struct DIEPTSIZ_SPEC; +impl crate::RegisterSpec for DIEPTSIZ_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dieptsiz::R](R) reader structure"] +impl crate::Readable for DIEPTSIZ_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dieptsiz::W](W) writer structure"] +impl crate::Writable for DIEPTSIZ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIEPTSIZ to value 0"] +impl crate::Resettable for DIEPTSIZ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/doepctl_intbulk.rs b/src/usb0_ep1/doepctl_intbulk.rs index cd5758a8..0f1dff1f 100644 --- a/src/usb0_ep1/doepctl_intbulk.rs +++ b/src/usb0_ep1/doepctl_intbulk.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPCTL_INTBULK"] -pub type R = crate::R; -#[doc = "Writer for register DOEPCTL_INTBULK"] -pub type W = crate::W; -#[doc = "Register DOEPCTL_INTBULK `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPCTL_INTBULK { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPCTL_INTBULK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPCTL_INTBULK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); +impl MPS_R { + pub(crate) fn new(bits: u16) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; -#[doc = "Write proxy for field `MPS`"] +#[doc = "Field `MPS` writer - Maximum Packet Size"] pub struct MPS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07ff) | ((value as u32) & 0x07ff); + self.w.bits = (self.w.bits & !0x07ff) | (value as u32 & 0x07ff); self.w } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; -#[doc = "Write proxy for field `USBActEP`"] +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBActEP` writer - USB Active Endpoint"] pub struct USBACTEP_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> USBACTEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -62,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPID`"] -pub type DPID_R = crate::R; +#[doc = "Field `DPID` reader - Endpoint Data PID"] +pub struct DPID_R(crate::FieldReader); impl DPID_R { + pub(crate) fn new(bits: bool) -> Self { + DPID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPID_A { @@ -76,12 +127,19 @@ impl DPID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPID_A::VALUE1 + **self == DPID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPID_A::VALUE2 + **self == DPID_A::VALUE2 + } +} +impl core::ops::Deref for DPID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "NAK Status\n\nValue on reset: 0"] @@ -98,9 +156,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -112,12 +173,19 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Endpoint Type\n\nValue on reset: 0"] @@ -139,9 +207,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPTYPE_A { @@ -156,25 +227,32 @@ impl EPTYPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPTYPE_A::VALUE1 + **self == EPTYPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPTYPE_A::VALUE2 + **self == EPTYPE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EPTYPE_A::VALUE3 + **self == EPTYPE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EPTYPE_A::VALUE4 + **self == EPTYPE_A::VALUE4 + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EPType`"] +#[doc = "Field `EPType` writer - Endpoint Type"] pub struct EPTYPE_W<'a> { w: &'a mut W, } @@ -182,9 +260,7 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPTYPE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Control"] #[inline(always)] @@ -209,13 +285,25 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } -#[doc = "Reader of field `Snp`"] -pub type SNP_R = crate::R; -#[doc = "Write proxy for field `Snp`"] +#[doc = "Field `Snp` reader - Snoop Mode"] +pub struct SNP_R(crate::FieldReader); +impl SNP_R { + pub(crate) fn new(bits: bool) -> Self { + SNP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SNP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` writer - Snoop Mode"] pub struct SNP_W<'a> { w: &'a mut W, } @@ -233,13 +321,25 @@ impl<'a> SNP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -257,13 +357,25 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); +impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -271,11 +383,11 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 22)) | (((value as u32) & 0x0f) << 22); + self.w.bits = (self.w.bits & !(0x0f << 22)) | ((value as u32 & 0x0f) << 22); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -293,11 +405,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -315,11 +427,11 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `SetD0PID`"] +#[doc = "Field `SetD0PID` writer - Set DATA0 PID"] pub struct SETD0PID_W<'a> { w: &'a mut W, } @@ -337,11 +449,11 @@ impl<'a> SETD0PID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `SetD1PID`"] +#[doc = "Field `SetD1PID` writer - 29 Set DATA1 PID"] pub struct SETD1PID_W<'a> { w: &'a mut W, } @@ -359,13 +471,25 @@ impl<'a> SETD1PID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Write proxy for field `EPDis`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDis` writer - Endpoint Disable"] pub struct EPDIS_W<'a> { w: &'a mut W, } @@ -383,13 +507,25 @@ impl<'a> EPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -407,7 +543,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -524,4 +660,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Control Register \\[INTBULK\\]\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 [doepctl_intbulk](index.html) module"] +pub struct DOEPCTL_INTBULK_SPEC; +impl crate::RegisterSpec for DOEPCTL_INTBULK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepctl_intbulk::R](R) reader structure"] +impl crate::Readable for DOEPCTL_INTBULK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepctl_intbulk::W](W) writer structure"] +impl crate::Writable for DOEPCTL_INTBULK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPCTL_INTBULK to value 0"] +impl crate::Resettable for DOEPCTL_INTBULK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/doepctl_isocont.rs b/src/usb0_ep1/doepctl_isocont.rs index 262711e6..cb26fa0b 100644 --- a/src/usb0_ep1/doepctl_isocont.rs +++ b/src/usb0_ep1/doepctl_isocont.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPCTL_ISOCONT"] -pub type R = crate::R; -#[doc = "Writer for register DOEPCTL_ISOCONT"] -pub type W = crate::W; -#[doc = "Register DOEPCTL_ISOCONT `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPCTL_ISOCONT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPCTL_ISOCONT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPCTL_ISOCONT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MPS` reader - Maximum Packet Size"] +pub struct MPS_R(crate::FieldReader); +impl MPS_R { + pub(crate) fn new(bits: u16) -> Self { + MPS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MPS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `MPS`"] -pub type MPS_R = crate::R; -#[doc = "Write proxy for field `MPS`"] +#[doc = "Field `MPS` writer - Maximum Packet Size"] pub struct MPS_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> MPS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07ff) | ((value as u32) & 0x07ff); + self.w.bits = (self.w.bits & !0x07ff) | (value as u32 & 0x07ff); self.w } } -#[doc = "Reader of field `USBActEP`"] -pub type USBACTEP_R = crate::R; -#[doc = "Write proxy for field `USBActEP`"] +#[doc = "Field `USBActEP` reader - USB Active Endpoint"] +pub struct USBACTEP_R(crate::FieldReader); +impl USBACTEP_R { + pub(crate) fn new(bits: bool) -> Self { + USBACTEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for USBACTEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `USBActEP` writer - USB Active Endpoint"] pub struct USBACTEP_W<'a> { w: &'a mut W, } @@ -44,7 +92,7 @@ impl<'a> USBACTEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -62,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EO_FrNum`"] -pub type EO_FRNUM_R = crate::R; +#[doc = "Field `EO_FrNum` reader - Even/Odd Frame"] +pub struct EO_FRNUM_R(crate::FieldReader); impl EO_FRNUM_R { + pub(crate) fn new(bits: bool) -> Self { + EO_FRNUM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EO_FRNUM_A { @@ -76,12 +127,19 @@ impl EO_FRNUM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EO_FRNUM_A::VALUE1 + **self == EO_FRNUM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EO_FRNUM_A::VALUE2 + **self == EO_FRNUM_A::VALUE2 + } +} +impl core::ops::Deref for EO_FRNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "NAK Status\n\nValue on reset: 0"] @@ -98,9 +156,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NAKSts`"] -pub type NAKSTS_R = crate::R; +#[doc = "Field `NAKSts` reader - NAK Status"] +pub struct NAKSTS_R(crate::FieldReader); impl NAKSTS_R { + pub(crate) fn new(bits: bool) -> Self { + NAKSTS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NAKSTS_A { @@ -112,12 +173,19 @@ impl NAKSTS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NAKSTS_A::VALUE1 + **self == NAKSTS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NAKSTS_A::VALUE2 + **self == NAKSTS_A::VALUE2 + } +} +impl core::ops::Deref for NAKSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Endpoint Type\n\nValue on reset: 0"] @@ -139,9 +207,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EPType`"] -pub type EPTYPE_R = crate::R; +#[doc = "Field `EPType` reader - Endpoint Type"] +pub struct EPTYPE_R(crate::FieldReader); impl EPTYPE_R { + pub(crate) fn new(bits: u8) -> Self { + EPTYPE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EPTYPE_A { @@ -156,25 +227,32 @@ impl EPTYPE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EPTYPE_A::VALUE1 + **self == EPTYPE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EPTYPE_A::VALUE2 + **self == EPTYPE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EPTYPE_A::VALUE3 + **self == EPTYPE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EPTYPE_A::VALUE4 + **self == EPTYPE_A::VALUE4 + } +} +impl core::ops::Deref for EPTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EPType`"] +#[doc = "Field `EPType` writer - Endpoint Type"] pub struct EPTYPE_W<'a> { w: &'a mut W, } @@ -182,9 +260,7 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EPTYPE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Control"] #[inline(always)] @@ -209,13 +285,25 @@ impl<'a> EPTYPE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18); + self.w.bits = (self.w.bits & !(0x03 << 18)) | ((value as u32 & 0x03) << 18); self.w } } -#[doc = "Reader of field `Snp`"] -pub type SNP_R = crate::R; -#[doc = "Write proxy for field `Snp`"] +#[doc = "Field `Snp` reader - Snoop Mode"] +pub struct SNP_R(crate::FieldReader); +impl SNP_R { + pub(crate) fn new(bits: bool) -> Self { + SNP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SNP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Snp` writer - Snoop Mode"] pub struct SNP_W<'a> { w: &'a mut W, } @@ -233,13 +321,25 @@ impl<'a> SNP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `Stall`"] -pub type STALL_R = crate::R; -#[doc = "Write proxy for field `Stall`"] +#[doc = "Field `Stall` reader - STALL Handshake"] +pub struct STALL_R(crate::FieldReader); +impl STALL_R { + pub(crate) fn new(bits: bool) -> Self { + STALL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Stall` writer - STALL Handshake"] pub struct STALL_W<'a> { w: &'a mut W, } @@ -257,13 +357,25 @@ impl<'a> STALL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `TxFNum`"] -pub type TXFNUM_R = crate::R; -#[doc = "Write proxy for field `TxFNum`"] +#[doc = "Field `TxFNum` reader - TxFIFO Number"] +pub struct TXFNUM_R(crate::FieldReader); +impl TXFNUM_R { + pub(crate) fn new(bits: u8) -> Self { + TXFNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXFNUM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TxFNum` writer - TxFIFO Number"] pub struct TXFNUM_W<'a> { w: &'a mut W, } @@ -271,11 +383,11 @@ impl<'a> TXFNUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 22)) | (((value as u32) & 0x0f) << 22); + self.w.bits = (self.w.bits & !(0x0f << 22)) | ((value as u32 & 0x0f) << 22); self.w } } -#[doc = "Write proxy for field `CNAK`"] +#[doc = "Field `CNAK` writer - Clear NAK"] pub struct CNAK_W<'a> { w: &'a mut W, } @@ -293,11 +405,11 @@ impl<'a> CNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Write proxy for field `SNAK`"] +#[doc = "Field `SNAK` writer - Set NAK"] pub struct SNAK_W<'a> { w: &'a mut W, } @@ -315,11 +427,11 @@ impl<'a> SNAK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Write proxy for field `SetEvenFr`"] +#[doc = "Field `SetEvenFr` writer - In non-Scatter/Gather DMA mode: Set Even frame"] pub struct SETEVENFR_W<'a> { w: &'a mut W, } @@ -337,11 +449,11 @@ impl<'a> SETEVENFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Write proxy for field `SetOddFr`"] +#[doc = "Field `SetOddFr` writer - Set Odd frame"] pub struct SETODDFR_W<'a> { w: &'a mut W, } @@ -359,13 +471,25 @@ impl<'a> SETODDFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Reader of field `EPDis`"] -pub type EPDIS_R = crate::R; -#[doc = "Write proxy for field `EPDis`"] +#[doc = "Field `EPDis` reader - Endpoint Disable"] +pub struct EPDIS_R(crate::FieldReader); +impl EPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDis` writer - Endpoint Disable"] pub struct EPDIS_W<'a> { w: &'a mut W, } @@ -383,13 +507,25 @@ impl<'a> EPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `EPEna`"] -pub type EPENA_R = crate::R; -#[doc = "Write proxy for field `EPEna`"] +#[doc = "Field `EPEna` reader - Endpoint Enable"] +pub struct EPENA_R(crate::FieldReader); +impl EPENA_R { + pub(crate) fn new(bits: bool) -> Self { + EPENA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPENA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPEna` writer - Endpoint Enable"] pub struct EPENA_W<'a> { w: &'a mut W, } @@ -407,7 +543,7 @@ impl<'a> EPENA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -524,4 +660,30 @@ impl W { pub fn epena(&mut self) -> EPENA_W { EPENA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\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 [doepctl_isocont](index.html) module"] +pub struct DOEPCTL_ISOCONT_SPEC; +impl crate::RegisterSpec for DOEPCTL_ISOCONT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepctl_isocont::R](R) reader structure"] +impl crate::Readable for DOEPCTL_ISOCONT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepctl_isocont::W](W) writer structure"] +impl crate::Writable for DOEPCTL_ISOCONT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPCTL_ISOCONT to value 0"] +impl crate::Resettable for DOEPCTL_ISOCONT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/doepdma.rs b/src/usb0_ep1/doepdma.rs index 1b38e1c8..e1fd5387 100644 --- a/src/usb0_ep1/doepdma.rs +++ b/src/usb0_ep1/doepdma.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPDMA"] -pub type R = crate::R; -#[doc = "Writer for register DOEPDMA"] -pub type W = crate::W; -#[doc = "Register DOEPDMA `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPDMA { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPDMA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPDMA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `DMAAddr`"] -pub type DMAADDR_R = crate::R; -#[doc = "Write proxy for field `DMAAddr`"] +#[doc = "Field `DMAAddr` reader - DMA Address"] +pub struct DMAADDR_R(crate::FieldReader); +impl DMAADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMAADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAAddr` writer - DMA Address"] pub struct DMAADDR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> DMAADDR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn dmaaddr(&mut self) -> DMAADDR_W { DMAADDR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint DMA Address Register\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 [doepdma](index.html) module"] +pub struct DOEPDMA_SPEC; +impl crate::RegisterSpec for DOEPDMA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepdma::R](R) reader structure"] +impl crate::Readable for DOEPDMA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepdma::W](W) writer structure"] +impl crate::Writable for DOEPDMA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPDMA to value 0"] +impl crate::Resettable for DOEPDMA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/doepdmab.rs b/src/usb0_ep1/doepdmab.rs index 16c884bd..0e2f73a3 100644 --- a/src/usb0_ep1/doepdmab.rs +++ b/src/usb0_ep1/doepdmab.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register DOEPDMAB"] -pub type R = crate::R; -#[doc = "Reader of field `DMABufferAddr`"] -pub type DMABUFFERADDR_R = crate::R; +#[doc = "Register `DOEPDMAB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] +pub struct DMABUFFERADDR_R(crate::FieldReader); +impl DMABUFFERADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DMABUFFERADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMABUFFERADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DMABUFFERADDR_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "Device Endpoint DMA Buffer Address Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doepdmab](index.html) module"] +pub struct DOEPDMAB_SPEC; +impl crate::RegisterSpec for DOEPDMAB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepdmab::R](R) reader structure"] +impl crate::Readable for DOEPDMAB_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DOEPDMAB to value 0"] +impl crate::Resettable for DOEPDMAB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usb0_ep1/doepint.rs b/src/usb0_ep1/doepint.rs index d2b23c23..80e7fd9a 100644 --- a/src/usb0_ep1/doepint.rs +++ b/src/usb0_ep1/doepint.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPINT"] -pub type R = crate::R; -#[doc = "Writer for register DOEPINT"] -pub type W = crate::W; -#[doc = "Register DOEPINT `reset()`'s with value 0x80"] -impl crate::ResetValue for super::DOEPINT { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x80 +#[doc = "Register `DOEPINT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPINT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `XferCompl`"] -pub type XFERCOMPL_R = crate::R; -#[doc = "Write proxy for field `XferCompl`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] +pub struct XFERCOMPL_R(crate::FieldReader); +impl XFERCOMPL_R { + pub(crate) fn new(bits: bool) -> Self { + XFERCOMPL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERCOMPL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] pub struct XFERCOMPL_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> XFERCOMPL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `EPDisbld`"] -pub type EPDISBLD_R = crate::R; -#[doc = "Write proxy for field `EPDisbld`"] +#[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] +pub struct EPDISBLD_R(crate::FieldReader); +impl EPDISBLD_R { + pub(crate) fn new(bits: bool) -> Self { + EPDISBLD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EPDISBLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] pub struct EPDISBLD_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> EPDISBLD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `AHBErr`"] -pub type AHBERR_R = crate::R; -#[doc = "Write proxy for field `AHBErr`"] +#[doc = "Field `AHBErr` reader - AHB Error"] +pub struct AHBERR_R(crate::FieldReader); +impl AHBERR_R { + pub(crate) fn new(bits: bool) -> Self { + AHBERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AHBERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AHBErr` writer - AHB Error"] pub struct AHBERR_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> AHBERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `SetUp`"] -pub type SETUP_R = crate::R; -#[doc = "Write proxy for field `SetUp`"] +#[doc = "Field `SetUp` reader - SETUP Phase Done"] +pub struct SETUP_R(crate::FieldReader); +impl SETUP_R { + pub(crate) fn new(bits: bool) -> Self { + SETUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SETUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SetUp` writer - SETUP Phase Done"] pub struct SETUP_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> SETUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `OUTTknEPdis`"] -pub type OUTTKNEPDIS_R = crate::R; -#[doc = "Write proxy for field `OUTTknEPdis`"] +#[doc = "Field `OUTTknEPdis` reader - OUT Token Received When Endpoint Disabled"] +pub struct OUTTKNEPDIS_R(crate::FieldReader); +impl OUTTKNEPDIS_R { + pub(crate) fn new(bits: bool) -> Self { + OUTTKNEPDIS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTTKNEPDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OUTTknEPdis` writer - OUT Token Received When Endpoint Disabled"] pub struct OUTTKNEPDIS_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> OUTTKNEPDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `StsPhseRcvd`"] -pub type STSPHSERCVD_R = crate::R; -#[doc = "Write proxy for field `StsPhseRcvd`"] +#[doc = "Field `StsPhseRcvd` reader - Status Phase Received For Control Write"] +pub struct STSPHSERCVD_R(crate::FieldReader); +impl STSPHSERCVD_R { + pub(crate) fn new(bits: bool) -> Self { + STSPHSERCVD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STSPHSERCVD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `StsPhseRcvd` writer - Status Phase Received For Control Write"] pub struct STSPHSERCVD_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> STSPHSERCVD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `Back2BackSETup`"] -pub type BACK2BACKSETUP_R = crate::R; -#[doc = "Write proxy for field `Back2BackSETup`"] +#[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received"] +pub struct BACK2BACKSETUP_R(crate::FieldReader); +impl BACK2BACKSETUP_R { + pub(crate) fn new(bits: bool) -> Self { + BACK2BACKSETUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BACK2BACKSETUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received"] pub struct BACK2BACKSETUP_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> BACK2BACKSETUP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `BNAIntr`"] -pub type BNAINTR_R = crate::R; -#[doc = "Write proxy for field `BNAIntr`"] +#[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] +pub struct BNAINTR_R(crate::FieldReader); +impl BNAINTR_R { + pub(crate) fn new(bits: bool) -> Self { + BNAINTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BNAINTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] pub struct BNAINTR_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> BNAINTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `PktDrpSts`"] -pub type PKTDRPSTS_R = crate::R; -#[doc = "Write proxy for field `PktDrpSts`"] +#[doc = "Field `PktDrpSts` reader - Packet Dropped Status"] +pub struct PKTDRPSTS_R(crate::FieldReader); +impl PKTDRPSTS_R { + pub(crate) fn new(bits: bool) -> Self { + PKTDRPSTS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTDRPSTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktDrpSts` writer - Packet Dropped Status"] pub struct PKTDRPSTS_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> PKTDRPSTS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `BbleErrIntrpt`"] -pub type BBLEERRINTRPT_R = crate::R; -#[doc = "Write proxy for field `BbleErrIntrpt`"] +#[doc = "Field `BbleErrIntrpt` reader - BbleErr (Babble Error) interrupt"] +pub struct BBLEERRINTRPT_R(crate::FieldReader); +impl BBLEERRINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + BBLEERRINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BBLEERRINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BbleErrIntrpt` writer - BbleErr (Babble Error) interrupt"] pub struct BBLEERRINTRPT_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> BBLEERRINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `NAKIntrpt`"] -pub type NAKINTRPT_R = crate::R; -#[doc = "Write proxy for field `NAKIntrpt`"] +#[doc = "Field `NAKIntrpt` reader - NAK interrupt"] +pub struct NAKINTRPT_R(crate::FieldReader); +impl NAKINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + NAKINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NAKINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NAKIntrpt` writer - NAK interrupt"] pub struct NAKINTRPT_W<'a> { w: &'a mut W, } @@ -270,13 +426,25 @@ impl<'a> NAKINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `NYETIntrpt`"] -pub type NYETINTRPT_R = crate::R; -#[doc = "Write proxy for field `NYETIntrpt`"] +#[doc = "Field `NYETIntrpt` reader - NYET interrupt"] +pub struct NYETINTRPT_R(crate::FieldReader); +impl NYETINTRPT_R { + pub(crate) fn new(bits: bool) -> Self { + NYETINTRPT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NYETINTRPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NYETIntrpt` writer - NYET interrupt"] pub struct NYETINTRPT_W<'a> { w: &'a mut W, } @@ -294,7 +462,7 @@ impl<'a> NYETINTRPT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -421,4 +589,30 @@ impl W { pub fn nyetintrpt(&mut self) -> NYETINTRPT_W { NYETINTRPT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Interrupt Register\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 [doepint](index.html) module"] +pub struct DOEPINT_SPEC; +impl crate::RegisterSpec for DOEPINT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doepint::R](R) reader structure"] +impl crate::Readable for DOEPINT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doepint::W](W) writer structure"] +impl crate::Writable for DOEPINT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPINT to value 0x80"] +impl crate::Resettable for DOEPINT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x80 + } } diff --git a/src/usb0_ep1/doeptsiz_control.rs b/src/usb0_ep1/doeptsiz_control.rs index 854e05d3..3da83134 100644 --- a/src/usb0_ep1/doeptsiz_control.rs +++ b/src/usb0_ep1/doeptsiz_control.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPTSIZ_CONTROL"] -pub type R = crate::R; -#[doc = "Writer for register DOEPTSIZ_CONTROL"] -pub type W = crate::W; -#[doc = "Register DOEPTSIZ_CONTROL `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPTSIZ_CONTROL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPTSIZ_CONTROL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPTSIZ_CONTROL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferSize` reader - Transfer Size"] +pub struct XFERSIZE_R(crate::FieldReader); +impl XFERSIZE_R { + pub(crate) fn new(bits: u32) -> Self { + XFERSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferSize`"] -pub type XFERSIZE_R = crate::R; -#[doc = "Write proxy for field `XferSize`"] +#[doc = "Field `XferSize` writer - Transfer Size"] pub struct XFERSIZE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> XFERSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0007_ffff) | ((value as u32) & 0x0007_ffff); + self.w.bits = (self.w.bits & !0x0007_ffff) | (value as u32 & 0x0007_ffff); self.w } } -#[doc = "Reader of field `PktCnt`"] -pub type PKTCNT_R = crate::R; -#[doc = "Write proxy for field `PktCnt`"] +#[doc = "Field `PktCnt` reader - Packet Count"] +pub struct PKTCNT_R(crate::FieldReader); +impl PKTCNT_R { + pub(crate) fn new(bits: u16) -> Self { + PKTCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktCnt` writer - Packet Count"] pub struct PKTCNT_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PKTCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 19)) | (((value as u32) & 0x03ff) << 19); + self.w.bits = (self.w.bits & !(0x03ff << 19)) | ((value as u32 & 0x03ff) << 19); self.w } } @@ -55,37 +103,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUPCnt`"] -pub type SUPCNT_R = crate::R; +#[doc = "Field `SUPCnt` reader - SETUP Packet Count"] +pub struct SUPCNT_R(crate::FieldReader); impl SUPCNT_R { + pub(crate) fn new(bits: u8) -> Self { + SUPCNT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 1 => Val(SUPCNT_A::VALUE1), - 2 => Val(SUPCNT_A::VALUE2), - 3 => Val(SUPCNT_A::VALUE3), - i => Res(i), + 1 => Some(SUPCNT_A::VALUE1), + 2 => Some(SUPCNT_A::VALUE2), + 3 => Some(SUPCNT_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUPCNT_A::VALUE1 + **self == SUPCNT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUPCNT_A::VALUE2 + **self == SUPCNT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUPCNT_A::VALUE3 + **self == SUPCNT_A::VALUE3 + } +} +impl core::ops::Deref for SUPCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SUPCnt`"] +#[doc = "Field `SUPCnt` writer - SETUP Packet Count"] pub struct SUPCNT_W<'a> { w: &'a mut W, } @@ -113,7 +170,7 @@ impl<'a> SUPCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29); + self.w.bits = (self.w.bits & !(0x03 << 29)) | ((value as u32 & 0x03) << 29); self.w } } @@ -150,4 +207,30 @@ impl W { pub fn supcnt(&mut self) -> SUPCNT_W { SUPCNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Transfer Size Register \\[CONT\\]\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 [doeptsiz_control](index.html) module"] +pub struct DOEPTSIZ_CONTROL_SPEC; +impl crate::RegisterSpec for DOEPTSIZ_CONTROL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doeptsiz_control::R](R) reader structure"] +impl crate::Readable for DOEPTSIZ_CONTROL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doeptsiz_control::W](W) writer structure"] +impl crate::Writable for DOEPTSIZ_CONTROL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPTSIZ_CONTROL to value 0"] +impl crate::Resettable for DOEPTSIZ_CONTROL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/doeptsiz_iso.rs b/src/usb0_ep1/doeptsiz_iso.rs index 9bad39ca..2567f37f 100644 --- a/src/usb0_ep1/doeptsiz_iso.rs +++ b/src/usb0_ep1/doeptsiz_iso.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register DOEPTSIZ_ISO"] -pub type R = crate::R; -#[doc = "Writer for register DOEPTSIZ_ISO"] -pub type W = crate::W; -#[doc = "Register DOEPTSIZ_ISO `reset()`'s with value 0"] -impl crate::ResetValue for super::DOEPTSIZ_ISO { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DOEPTSIZ_ISO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DOEPTSIZ_ISO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `XferSize` reader - Transfer Size"] +pub struct XFERSIZE_R(crate::FieldReader); +impl XFERSIZE_R { + pub(crate) fn new(bits: u32) -> Self { + XFERSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XFERSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `XferSize`"] -pub type XFERSIZE_R = crate::R; -#[doc = "Write proxy for field `XferSize`"] +#[doc = "Field `XferSize` writer - Transfer Size"] pub struct XFERSIZE_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> XFERSIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0007_ffff) | ((value as u32) & 0x0007_ffff); + self.w.bits = (self.w.bits & !0x0007_ffff) | (value as u32 & 0x0007_ffff); self.w } } -#[doc = "Reader of field `PktCnt`"] -pub type PKTCNT_R = crate::R; -#[doc = "Write proxy for field `PktCnt`"] +#[doc = "Field `PktCnt` reader - Packet Count"] +pub struct PKTCNT_R(crate::FieldReader); +impl PKTCNT_R { + pub(crate) fn new(bits: u16) -> Self { + PKTCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PKTCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PktCnt` writer - Packet Count"] pub struct PKTCNT_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> PKTCNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 19)) | (((value as u32) & 0x03ff) << 19); + self.w.bits = (self.w.bits & !(0x03ff << 19)) | ((value as u32 & 0x03ff) << 19); self.w } } @@ -57,9 +105,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `RxDPID`"] -pub type RXDPID_R = crate::R; +#[doc = "Field `RxDPID` reader - Received Data PID"] +pub struct RXDPID_R(crate::FieldReader); impl RXDPID_R { + pub(crate) fn new(bits: u8) -> Self { + RXDPID_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXDPID_A { @@ -74,22 +125,29 @@ impl RXDPID_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXDPID_A::VALUE1 + **self == RXDPID_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXDPID_A::VALUE2 + **self == RXDPID_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == RXDPID_A::VALUE3 + **self == RXDPID_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == RXDPID_A::VALUE4 + **self == RXDPID_A::VALUE4 + } +} +impl core::ops::Deref for RXDPID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -120,4 +178,30 @@ impl W { pub fn pkt_cnt(&mut self) -> PKTCNT_W { PKTCNT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device Endpoint Transfer Size Register \\[ISO\\]\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 [doeptsiz_iso](index.html) module"] +pub struct DOEPTSIZ_ISO_SPEC; +impl crate::RegisterSpec for DOEPTSIZ_ISO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [doeptsiz_iso::R](R) reader structure"] +impl crate::Readable for DOEPTSIZ_ISO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [doeptsiz_iso::W](W) writer structure"] +impl crate::Writable for DOEPTSIZ_ISO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DOEPTSIZ_ISO to value 0"] +impl crate::Resettable for DOEPTSIZ_ISO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usb0_ep1/dtxfsts.rs b/src/usb0_ep1/dtxfsts.rs index 343b425d..9703f5d1 100644 --- a/src/usb0_ep1/dtxfsts.rs +++ b/src/usb0_ep1/dtxfsts.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register DTXFSTS"] -pub type R = crate::R; +#[doc = "Register `DTXFSTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "IN Endpoint TxFIFO Space Avail\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] @@ -17,34 +30,43 @@ impl From for u16 { variant as _ } } -#[doc = "Reader of field `INEPTxFSpcAvail`"] -pub type INEPTXFSPCAVAIL_R = crate::R; +#[doc = "Field `INEPTxFSpcAvail` reader - IN Endpoint TxFIFO Space Avail"] +pub struct INEPTXFSPCAVAIL_R(crate::FieldReader); impl INEPTXFSPCAVAIL_R { + pub(crate) fn new(bits: u16) -> Self { + INEPTXFSPCAVAIL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(INEPTXFSPCAVAIL_A::VALUE1), - 1 => Val(INEPTXFSPCAVAIL_A::VALUE2), - 2 => Val(INEPTXFSPCAVAIL_A::VALUE3), - i => Res(i), + 0 => Some(INEPTXFSPCAVAIL_A::VALUE1), + 1 => Some(INEPTXFSPCAVAIL_A::VALUE2), + 2 => Some(INEPTXFSPCAVAIL_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE1 + **self == INEPTXFSPCAVAIL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE2 + **self == INEPTXFSPCAVAIL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == INEPTXFSPCAVAIL_A::VALUE3 + **self == INEPTXFSPCAVAIL_A::VALUE3 + } +} +impl core::ops::Deref for INEPTXFSPCAVAIL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -54,3 +76,19 @@ impl R { INEPTXFSPCAVAIL_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtxfsts](index.html) module"] +pub struct DTXFSTS_SPEC; +impl crate::RegisterSpec for DTXFSTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dtxfsts::R](R) reader structure"] +impl crate::Readable for DTXFSTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DTXFSTS to value 0"] +impl crate::Resettable for DTXFSTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0.rs b/src/usic0.rs index 513b7c69..d79818be 100644 --- a/src/usic0.rs +++ b/src/usic0.rs @@ -2,14 +2,9 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + pub id: crate::Reg, } -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; diff --git a/src/usic0/id.rs b/src/usic0/id.rs index ad754b74..1cd2633c 100644 --- a/src/usic0/id.rs +++ b/src/usic0/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision Number"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number Value"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00aa_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00aa_c000 + } +} diff --git a/src/usic0_ch0.rs b/src/usic0_ch0.rs index 69987c27..60f40fbc 100644 --- a/src/usic0_ch0.rs +++ b/src/usic0_ch0.rs @@ -1,636 +1,306 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved0: [u8; 4usize], + _reserved0: [u8; 0x04], #[doc = "0x04 - Channel Configuration Register"] - pub ccfg: CCFG, - _reserved1: [u8; 4usize], + pub ccfg: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x0c - Kernel State Configuration Register"] - pub kscfg: KSCFG, + pub kscfg: crate::Reg, #[doc = "0x10 - Fractional Divider Register"] - pub fdr: FDR, + pub fdr: crate::Reg, #[doc = "0x14 - Baud Rate Generator Register"] - pub brg: BRG, + pub brg: crate::Reg, #[doc = "0x18 - Interrupt Node Pointer Register"] - pub inpr: INPR, + pub inpr: crate::Reg, #[doc = "0x1c - Input Control Register 0"] - pub dx0cr: DX0CR, + pub dx0cr: crate::Reg, #[doc = "0x20 - Input Control Register 1"] - pub dx1cr: DX1CR, + pub dx1cr: crate::Reg, #[doc = "0x24 - Input Control Register 2"] - pub dx2cr: DX2CR, + pub dx2cr: crate::Reg, #[doc = "0x28 - Input Control Register 3"] - pub dx3cr: DX3CR, + pub dx3cr: crate::Reg, #[doc = "0x2c - Input Control Register 4"] - pub dx4cr: DX4CR, + pub dx4cr: crate::Reg, #[doc = "0x30 - Input Control Register 5"] - pub dx5cr: DX5CR, + pub dx5cr: crate::Reg, #[doc = "0x34 - Shift Control Register"] - pub sctr: SCTR, + pub sctr: crate::Reg, #[doc = "0x38 - Transmit Control/Status Register"] - pub tcsr: TCSR, - _reserved_13_pcr: [u8; 4usize], + pub tcsr: crate::Reg, + _reserved_13_pcr: [u8; 0x04], #[doc = "0x40 - Channel Control Register"] - pub ccr: CCR, + pub ccr: crate::Reg, #[doc = "0x44 - Capture Mode Timer Register"] - pub cmtr: CMTR, - _reserved_16_psr: [u8; 4usize], + pub cmtr: crate::Reg, + _reserved_16_psr: [u8; 0x04], #[doc = "0x4c - Protocol Status Clear Register"] - pub pscr: PSCR, + pub pscr: crate::Reg, #[doc = "0x50 - Receiver Buffer Status Register"] - pub rbufsr: RBUFSR, + pub rbufsr: crate::Reg, #[doc = "0x54 - Receiver Buffer Register"] - pub rbuf: RBUF, + pub rbuf: crate::Reg, #[doc = "0x58 - Receiver Buffer Register for Debugger"] - pub rbufd: RBUFD, + pub rbufd: crate::Reg, #[doc = "0x5c - Receiver Buffer Register 0"] - pub rbuf0: RBUF0, + pub rbuf0: crate::Reg, #[doc = "0x60 - Receiver Buffer Register 1"] - pub rbuf1: RBUF1, + pub rbuf1: crate::Reg, #[doc = "0x64 - Receiver Buffer 01 Status Register"] - pub rbuf01sr: RBUF01SR, + pub rbuf01sr: crate::Reg, #[doc = "0x68 - Flag Modification Register"] - pub fmr: FMR, - _reserved25: [u8; 20usize], - #[doc = "0x80 - Transmit Buffer"] - pub tbuf: [TBUF; 32], + pub fmr: crate::Reg, + _reserved25: [u8; 0x14], + #[doc = "0x80..0x100 - Transmit Buffer"] + pub tbuf: [crate::Reg; 32], #[doc = "0x100 - Bypass Data Register"] - pub byp: BYP, + pub byp: crate::Reg, #[doc = "0x104 - Bypass Control Register"] - pub bypcr: BYPCR, + pub bypcr: crate::Reg, #[doc = "0x108 - Transmitter Buffer Control Register"] - pub tbctr: TBCTR, + pub tbctr: crate::Reg, #[doc = "0x10c - Receiver Buffer Control Register"] - pub rbctr: RBCTR, + pub rbctr: crate::Reg, #[doc = "0x110 - Transmit/Receive Buffer Pointer Register"] - pub trbptr: TRBPTR, + pub trbptr: crate::Reg, #[doc = "0x114 - Transmit/Receive Buffer Status Register"] - pub trbsr: TRBSR, + pub trbsr: crate::Reg, #[doc = "0x118 - Transmit/Receive Buffer Status Clear Register"] - pub trbscr: TRBSCR, + pub trbscr: crate::Reg, #[doc = "0x11c - Receiver Buffer Output Register"] - pub outr: OUTR, + pub outr: crate::Reg, #[doc = "0x120 - Receiver Buffer Output Register L for Debugger"] - pub outdr: OUTDR, - _reserved35: [u8; 92usize], - #[doc = "0x180 - Transmit FIFO Buffer"] - pub in_: [IN; 32], + pub outdr: crate::Reg, + _reserved35: [u8; 0x5c], + #[doc = "0x180..0x200 - Transmit FIFO Buffer"] + pub in_: [crate::Reg; 32], } impl RegisterBlock { #[doc = "0x3c - Protocol Control Register \\[IIS Mode\\]"] #[inline(always)] - pub fn pcr_iismode(&self) -> &PCR_IISMODE { - unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const PCR_IISMODE) } - } - #[doc = "0x3c - Protocol Control Register \\[IIS Mode\\]"] - #[inline(always)] - pub fn pcr_iismode_mut(&self) -> &mut PCR_IISMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(60usize) as *mut PCR_IISMODE) } - } - #[doc = "0x3c - Protocol Control Register \\[IIC Mode\\]"] - #[inline(always)] - pub fn pcr_iicmode(&self) -> &PCR_IICMODE { - unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const PCR_IICMODE) } + pub fn pcr_iismode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const crate::Reg) } } #[doc = "0x3c - Protocol Control Register \\[IIC Mode\\]"] #[inline(always)] - pub fn pcr_iicmode_mut(&self) -> &mut PCR_IICMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(60usize) as *mut PCR_IICMODE) } + pub fn pcr_iicmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const crate::Reg) } } #[doc = "0x3c - Protocol Control Register \\[SSC Mode\\]"] #[inline(always)] - pub fn pcr_sscmode(&self) -> &PCR_SSCMODE { - unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const PCR_SSCMODE) } - } - #[doc = "0x3c - Protocol Control Register \\[SSC Mode\\]"] - #[inline(always)] - pub fn pcr_sscmode_mut(&self) -> &mut PCR_SSCMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(60usize) as *mut PCR_SSCMODE) } - } - #[doc = "0x3c - Protocol Control Register \\[ASC Mode\\]"] - #[inline(always)] - pub fn pcr_ascmode(&self) -> &PCR_ASCMODE { - unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const PCR_ASCMODE) } + pub fn pcr_sscmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const crate::Reg) } } #[doc = "0x3c - Protocol Control Register \\[ASC Mode\\]"] #[inline(always)] - pub fn pcr_ascmode_mut(&self) -> &mut PCR_ASCMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(60usize) as *mut PCR_ASCMODE) } - } - #[doc = "0x3c - Protocol Control Register"] - #[inline(always)] - pub fn pcr(&self) -> &PCR { - unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const PCR) } + pub fn pcr_ascmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const crate::Reg) } } #[doc = "0x3c - Protocol Control Register"] #[inline(always)] - pub fn pcr_mut(&self) -> &mut PCR { - unsafe { &mut *(((self as *const Self) as *mut u8).add(60usize) as *mut PCR) } + pub fn pcr(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(60usize) as *const crate::Reg) } } #[doc = "0x48 - Protocol Status Register \\[IIS Mode\\]"] #[inline(always)] - pub fn psr_iismode(&self) -> &PSR_IISMODE { - unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const PSR_IISMODE) } - } - #[doc = "0x48 - Protocol Status Register \\[IIS Mode\\]"] - #[inline(always)] - pub fn psr_iismode_mut(&self) -> &mut PSR_IISMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(72usize) as *mut PSR_IISMODE) } - } - #[doc = "0x48 - Protocol Status Register \\[IIC Mode\\]"] - #[inline(always)] - pub fn psr_iicmode(&self) -> &PSR_IICMODE { - unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const PSR_IICMODE) } + pub fn psr_iismode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const crate::Reg) } } #[doc = "0x48 - Protocol Status Register \\[IIC Mode\\]"] #[inline(always)] - pub fn psr_iicmode_mut(&self) -> &mut PSR_IICMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(72usize) as *mut PSR_IICMODE) } + pub fn psr_iicmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const crate::Reg) } } #[doc = "0x48 - Protocol Status Register \\[SSC Mode\\]"] #[inline(always)] - pub fn psr_sscmode(&self) -> &PSR_SSCMODE { - unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const PSR_SSCMODE) } - } - #[doc = "0x48 - Protocol Status Register \\[SSC Mode\\]"] - #[inline(always)] - pub fn psr_sscmode_mut(&self) -> &mut PSR_SSCMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(72usize) as *mut PSR_SSCMODE) } - } - #[doc = "0x48 - Protocol Status Register \\[ASC Mode\\]"] - #[inline(always)] - pub fn psr_ascmode(&self) -> &PSR_ASCMODE { - unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const PSR_ASCMODE) } + pub fn psr_sscmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const crate::Reg) } } #[doc = "0x48 - Protocol Status Register \\[ASC Mode\\]"] #[inline(always)] - pub fn psr_ascmode_mut(&self) -> &mut PSR_ASCMODE { - unsafe { &mut *(((self as *const Self) as *mut u8).add(72usize) as *mut PSR_ASCMODE) } - } - #[doc = "0x48 - Protocol Status Register"] - #[inline(always)] - pub fn psr(&self) -> &PSR { - unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const PSR) } + pub fn psr_ascmode(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const crate::Reg) } } #[doc = "0x48 - Protocol Status Register"] #[inline(always)] - pub fn psr_mut(&self) -> &mut PSR { - unsafe { &mut *(((self as *const Self) as *mut u8).add(72usize) as *mut PSR) } + pub fn psr(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(72usize) as *const crate::Reg) } } } -#[doc = "Channel Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccfg](ccfg) module"] -pub type CCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CCFG; -#[doc = "`read()` method returns [ccfg::R](ccfg::R) reader structure"] -impl crate::Readable for CCFG {} +#[doc = "CCFG register accessor: an alias for `Reg`"] +pub type CCFG = crate::Reg; #[doc = "Channel Configuration Register"] pub mod ccfg; -#[doc = "Kernel State Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [kscfg](kscfg) module"] -pub type KSCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _KSCFG; -#[doc = "`read()` method returns [kscfg::R](kscfg::R) reader structure"] -impl crate::Readable for KSCFG {} -#[doc = "`write(|w| ..)` method takes [kscfg::W](kscfg::W) writer structure"] -impl crate::Writable for KSCFG {} +#[doc = "KSCFG register accessor: an alias for `Reg`"] +pub type KSCFG = crate::Reg; #[doc = "Kernel State Configuration Register"] pub mod kscfg; -#[doc = "Fractional Divider Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fdr](fdr) module"] -pub type FDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FDR; -#[doc = "`read()` method returns [fdr::R](fdr::R) reader structure"] -impl crate::Readable for FDR {} -#[doc = "`write(|w| ..)` method takes [fdr::W](fdr::W) writer structure"] -impl crate::Writable for FDR {} +#[doc = "FDR register accessor: an alias for `Reg`"] +pub type FDR = crate::Reg; #[doc = "Fractional Divider Register"] pub mod fdr; -#[doc = "Baud Rate Generator Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [brg](brg) module"] -pub type BRG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BRG; -#[doc = "`read()` method returns [brg::R](brg::R) reader structure"] -impl crate::Readable for BRG {} -#[doc = "`write(|w| ..)` method takes [brg::W](brg::W) writer structure"] -impl crate::Writable for BRG {} +#[doc = "BRG register accessor: an alias for `Reg`"] +pub type BRG = crate::Reg; #[doc = "Baud Rate Generator Register"] pub mod brg; -#[doc = "Interrupt Node Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inpr](inpr) module"] -pub type INPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _INPR; -#[doc = "`read()` method returns [inpr::R](inpr::R) reader structure"] -impl crate::Readable for INPR {} -#[doc = "`write(|w| ..)` method takes [inpr::W](inpr::W) writer structure"] -impl crate::Writable for INPR {} +#[doc = "INPR register accessor: an alias for `Reg`"] +pub type INPR = crate::Reg; #[doc = "Interrupt Node Pointer Register"] pub mod inpr; -#[doc = "Input Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx0cr](dx0cr) module"] -pub type DX0CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX0CR; -#[doc = "`read()` method returns [dx0cr::R](dx0cr::R) reader structure"] -impl crate::Readable for DX0CR {} -#[doc = "`write(|w| ..)` method takes [dx0cr::W](dx0cr::W) writer structure"] -impl crate::Writable for DX0CR {} +#[doc = "DX0CR register accessor: an alias for `Reg`"] +pub type DX0CR = crate::Reg; #[doc = "Input Control Register 0"] pub mod dx0cr; -#[doc = "Input Control Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx1cr](dx1cr) module"] -pub type DX1CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX1CR; -#[doc = "`read()` method returns [dx1cr::R](dx1cr::R) reader structure"] -impl crate::Readable for DX1CR {} -#[doc = "`write(|w| ..)` method takes [dx1cr::W](dx1cr::W) writer structure"] -impl crate::Writable for DX1CR {} +#[doc = "DX1CR register accessor: an alias for `Reg`"] +pub type DX1CR = crate::Reg; #[doc = "Input Control Register 1"] pub mod dx1cr; -#[doc = "Input Control Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx2cr](dx2cr) module"] -pub type DX2CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX2CR; -#[doc = "`read()` method returns [dx2cr::R](dx2cr::R) reader structure"] -impl crate::Readable for DX2CR {} -#[doc = "`write(|w| ..)` method takes [dx2cr::W](dx2cr::W) writer structure"] -impl crate::Writable for DX2CR {} +#[doc = "DX2CR register accessor: an alias for `Reg`"] +pub type DX2CR = crate::Reg; #[doc = "Input Control Register 2"] pub mod dx2cr; -#[doc = "Input Control Register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx3cr](dx3cr) module"] -pub type DX3CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX3CR; -#[doc = "`read()` method returns [dx3cr::R](dx3cr::R) reader structure"] -impl crate::Readable for DX3CR {} -#[doc = "`write(|w| ..)` method takes [dx3cr::W](dx3cr::W) writer structure"] -impl crate::Writable for DX3CR {} +#[doc = "DX3CR register accessor: an alias for `Reg`"] +pub type DX3CR = crate::Reg; #[doc = "Input Control Register 3"] pub mod dx3cr; -#[doc = "Input Control Register 4\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx4cr](dx4cr) module"] -pub type DX4CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX4CR; -#[doc = "`read()` method returns [dx4cr::R](dx4cr::R) reader structure"] -impl crate::Readable for DX4CR {} -#[doc = "`write(|w| ..)` method takes [dx4cr::W](dx4cr::W) writer structure"] -impl crate::Writable for DX4CR {} +#[doc = "DX4CR register accessor: an alias for `Reg`"] +pub type DX4CR = crate::Reg; #[doc = "Input Control Register 4"] pub mod dx4cr; -#[doc = "Input Control Register 5\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx5cr](dx5cr) module"] -pub type DX5CR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _DX5CR; -#[doc = "`read()` method returns [dx5cr::R](dx5cr::R) reader structure"] -impl crate::Readable for DX5CR {} -#[doc = "`write(|w| ..)` method takes [dx5cr::W](dx5cr::W) writer structure"] -impl crate::Writable for DX5CR {} +#[doc = "DX5CR register accessor: an alias for `Reg`"] +pub type DX5CR = crate::Reg; #[doc = "Input Control Register 5"] pub mod dx5cr; -#[doc = "Shift Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sctr](sctr) module"] -pub type SCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SCTR; -#[doc = "`read()` method returns [sctr::R](sctr::R) reader structure"] -impl crate::Readable for SCTR {} -#[doc = "`write(|w| ..)` method takes [sctr::W](sctr::W) writer structure"] -impl crate::Writable for SCTR {} +#[doc = "SCTR register accessor: an alias for `Reg`"] +pub type SCTR = crate::Reg; #[doc = "Shift Control Register"] pub mod sctr; -#[doc = "Transmit Control/Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcsr](tcsr) module"] -pub type TCSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TCSR; -#[doc = "`read()` method returns [tcsr::R](tcsr::R) reader structure"] -impl crate::Readable for TCSR {} -#[doc = "`write(|w| ..)` method takes [tcsr::W](tcsr::W) writer structure"] -impl crate::Writable for TCSR {} +#[doc = "TCSR register accessor: an alias for `Reg`"] +pub type TCSR = crate::Reg; #[doc = "Transmit Control/Status Register"] pub mod tcsr; -#[doc = "Protocol Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcr](pcr) module"] -pub type PCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCR; -#[doc = "`read()` method returns [pcr::R](pcr::R) reader structure"] -impl crate::Readable for PCR {} -#[doc = "`write(|w| ..)` method takes [pcr::W](pcr::W) writer structure"] -impl crate::Writable for PCR {} +#[doc = "PCR register accessor: an alias for `Reg`"] +pub type PCR = crate::Reg; #[doc = "Protocol Control Register"] pub mod pcr; -#[doc = "Protocol Control Register \\[ASC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcr_ascmode](pcr_ascmode) module"] -pub type PCR_ASCMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCR_ASCMODE; -#[doc = "`read()` method returns [pcr_ascmode::R](pcr_ascmode::R) reader structure"] -impl crate::Readable for PCR_ASCMODE {} -#[doc = "`write(|w| ..)` method takes [pcr_ascmode::W](pcr_ascmode::W) writer structure"] -impl crate::Writable for PCR_ASCMODE {} +#[doc = "PCR_ASCMode register accessor: an alias for `Reg`"] +pub type PCR_ASCMODE = crate::Reg; #[doc = "Protocol Control Register \\[ASC Mode\\]"] pub mod pcr_ascmode; -#[doc = "Protocol Control Register \\[SSC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcr_sscmode](pcr_sscmode) module"] -pub type PCR_SSCMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCR_SSCMODE; -#[doc = "`read()` method returns [pcr_sscmode::R](pcr_sscmode::R) reader structure"] -impl crate::Readable for PCR_SSCMODE {} -#[doc = "`write(|w| ..)` method takes [pcr_sscmode::W](pcr_sscmode::W) writer structure"] -impl crate::Writable for PCR_SSCMODE {} +#[doc = "PCR_SSCMode register accessor: an alias for `Reg`"] +pub type PCR_SSCMODE = crate::Reg; #[doc = "Protocol Control Register \\[SSC Mode\\]"] pub mod pcr_sscmode; -#[doc = "Protocol Control Register \\[IIC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcr_iicmode](pcr_iicmode) module"] -pub type PCR_IICMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCR_IICMODE; -#[doc = "`read()` method returns [pcr_iicmode::R](pcr_iicmode::R) reader structure"] -impl crate::Readable for PCR_IICMODE {} -#[doc = "`write(|w| ..)` method takes [pcr_iicmode::W](pcr_iicmode::W) writer structure"] -impl crate::Writable for PCR_IICMODE {} +#[doc = "PCR_IICMode register accessor: an alias for `Reg`"] +pub type PCR_IICMODE = crate::Reg; #[doc = "Protocol Control Register \\[IIC Mode\\]"] pub mod pcr_iicmode; -#[doc = "Protocol Control Register \\[IIS Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcr_iismode](pcr_iismode) module"] -pub type PCR_IISMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PCR_IISMODE; -#[doc = "`read()` method returns [pcr_iismode::R](pcr_iismode::R) reader structure"] -impl crate::Readable for PCR_IISMODE {} -#[doc = "`write(|w| ..)` method takes [pcr_iismode::W](pcr_iismode::W) writer structure"] -impl crate::Writable for PCR_IISMODE {} +#[doc = "PCR_IISMode register accessor: an alias for `Reg`"] +pub type PCR_IISMODE = crate::Reg; #[doc = "Protocol Control Register \\[IIS Mode\\]"] pub mod pcr_iismode; -#[doc = "Channel Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccr](ccr) module"] -pub type CCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CCR; -#[doc = "`read()` method returns [ccr::R](ccr::R) reader structure"] -impl crate::Readable for CCR {} -#[doc = "`write(|w| ..)` method takes [ccr::W](ccr::W) writer structure"] -impl crate::Writable for CCR {} +#[doc = "CCR register accessor: an alias for `Reg`"] +pub type CCR = crate::Reg; #[doc = "Channel Control Register"] pub mod ccr; -#[doc = "Capture Mode Timer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cmtr](cmtr) module"] -pub type CMTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CMTR; -#[doc = "`read()` method returns [cmtr::R](cmtr::R) reader structure"] -impl crate::Readable for CMTR {} -#[doc = "`write(|w| ..)` method takes [cmtr::W](cmtr::W) writer structure"] -impl crate::Writable for CMTR {} +#[doc = "CMTR register accessor: an alias for `Reg`"] +pub type CMTR = crate::Reg; #[doc = "Capture Mode Timer Register"] pub mod cmtr; -#[doc = "Protocol Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psr](psr) module"] -pub type PSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSR; -#[doc = "`read()` method returns [psr::R](psr::R) reader structure"] -impl crate::Readable for PSR {} -#[doc = "`write(|w| ..)` method takes [psr::W](psr::W) writer structure"] -impl crate::Writable for PSR {} +#[doc = "PSR register accessor: an alias for `Reg`"] +pub type PSR = crate::Reg; #[doc = "Protocol Status Register"] pub mod psr; -#[doc = "Protocol Status Register \\[ASC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psr_ascmode](psr_ascmode) module"] -pub type PSR_ASCMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSR_ASCMODE; -#[doc = "`read()` method returns [psr_ascmode::R](psr_ascmode::R) reader structure"] -impl crate::Readable for PSR_ASCMODE {} -#[doc = "`write(|w| ..)` method takes [psr_ascmode::W](psr_ascmode::W) writer structure"] -impl crate::Writable for PSR_ASCMODE {} +#[doc = "PSR_ASCMode register accessor: an alias for `Reg`"] +pub type PSR_ASCMODE = crate::Reg; #[doc = "Protocol Status Register \\[ASC Mode\\]"] pub mod psr_ascmode; -#[doc = "Protocol Status Register \\[SSC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psr_sscmode](psr_sscmode) module"] -pub type PSR_SSCMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSR_SSCMODE; -#[doc = "`read()` method returns [psr_sscmode::R](psr_sscmode::R) reader structure"] -impl crate::Readable for PSR_SSCMODE {} -#[doc = "`write(|w| ..)` method takes [psr_sscmode::W](psr_sscmode::W) writer structure"] -impl crate::Writable for PSR_SSCMODE {} +#[doc = "PSR_SSCMode register accessor: an alias for `Reg`"] +pub type PSR_SSCMODE = crate::Reg; #[doc = "Protocol Status Register \\[SSC Mode\\]"] pub mod psr_sscmode; -#[doc = "Protocol Status Register \\[IIC Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psr_iicmode](psr_iicmode) module"] -pub type PSR_IICMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSR_IICMODE; -#[doc = "`read()` method returns [psr_iicmode::R](psr_iicmode::R) reader structure"] -impl crate::Readable for PSR_IICMODE {} -#[doc = "`write(|w| ..)` method takes [psr_iicmode::W](psr_iicmode::W) writer structure"] -impl crate::Writable for PSR_IICMODE {} +#[doc = "PSR_IICMode register accessor: an alias for `Reg`"] +pub type PSR_IICMODE = crate::Reg; #[doc = "Protocol Status Register \\[IIC Mode\\]"] pub mod psr_iicmode; -#[doc = "Protocol Status Register \\[IIS Mode\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psr_iismode](psr_iismode) module"] -pub type PSR_IISMODE = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSR_IISMODE; -#[doc = "`read()` method returns [psr_iismode::R](psr_iismode::R) reader structure"] -impl crate::Readable for PSR_IISMODE {} -#[doc = "`write(|w| ..)` method takes [psr_iismode::W](psr_iismode::W) writer structure"] -impl crate::Writable for PSR_IISMODE {} +#[doc = "PSR_IISMode register accessor: an alias for `Reg`"] +pub type PSR_IISMODE = crate::Reg; #[doc = "Protocol Status Register \\[IIS Mode\\]"] pub mod psr_iismode; -#[doc = "Protocol Status Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pscr](pscr) module"] -pub type PSCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _PSCR; -#[doc = "`write(|w| ..)` method takes [pscr::W](pscr::W) writer structure"] -impl crate::Writable for PSCR {} +#[doc = "PSCR register accessor: an alias for `Reg`"] +pub type PSCR = crate::Reg; #[doc = "Protocol Status Clear Register"] pub mod pscr; -#[doc = "Receiver Buffer Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbufsr](rbufsr) module"] -pub type RBUFSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUFSR; -#[doc = "`read()` method returns [rbufsr::R](rbufsr::R) reader structure"] -impl crate::Readable for RBUFSR {} +#[doc = "RBUFSR register accessor: an alias for `Reg`"] +pub type RBUFSR = crate::Reg; #[doc = "Receiver Buffer Status Register"] pub mod rbufsr; -#[doc = "Receiver Buffer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf](rbuf) module"] -pub type RBUF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUF; -#[doc = "`read()` method returns [rbuf::R](rbuf::R) reader structure"] -impl crate::Readable for RBUF {} +#[doc = "RBUF register accessor: an alias for `Reg`"] +pub type RBUF = crate::Reg; #[doc = "Receiver Buffer Register"] pub mod rbuf; -#[doc = "Receiver Buffer Register for Debugger\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbufd](rbufd) module"] -pub type RBUFD = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUFD; -#[doc = "`read()` method returns [rbufd::R](rbufd::R) reader structure"] -impl crate::Readable for RBUFD {} +#[doc = "RBUFD register accessor: an alias for `Reg`"] +pub type RBUFD = crate::Reg; #[doc = "Receiver Buffer Register for Debugger"] pub mod rbufd; -#[doc = "Receiver Buffer Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf0](rbuf0) module"] -pub type RBUF0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUF0; -#[doc = "`read()` method returns [rbuf0::R](rbuf0::R) reader structure"] -impl crate::Readable for RBUF0 {} +#[doc = "RBUF0 register accessor: an alias for `Reg`"] +pub type RBUF0 = crate::Reg; #[doc = "Receiver Buffer Register 0"] pub mod rbuf0; -#[doc = "Receiver Buffer Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf1](rbuf1) module"] -pub type RBUF1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUF1; -#[doc = "`read()` method returns [rbuf1::R](rbuf1::R) reader structure"] -impl crate::Readable for RBUF1 {} +#[doc = "RBUF1 register accessor: an alias for `Reg`"] +pub type RBUF1 = crate::Reg; #[doc = "Receiver Buffer Register 1"] pub mod rbuf1; -#[doc = "Receiver Buffer 01 Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf01sr](rbuf01sr) module"] -pub type RBUF01SR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBUF01SR; -#[doc = "`read()` method returns [rbuf01sr::R](rbuf01sr::R) reader structure"] -impl crate::Readable for RBUF01SR {} +#[doc = "RBUF01SR register accessor: an alias for `Reg`"] +pub type RBUF01SR = crate::Reg; #[doc = "Receiver Buffer 01 Status Register"] pub mod rbuf01sr; -#[doc = "Flag Modification Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fmr](fmr) module"] -pub type FMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _FMR; -#[doc = "`write(|w| ..)` method takes [fmr::W](fmr::W) writer structure"] -impl crate::Writable for FMR {} +#[doc = "FMR register accessor: an alias for `Reg`"] +pub type FMR = crate::Reg; #[doc = "Flag Modification Register"] pub mod fmr; -#[doc = "Transmit Buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tbuf](tbuf) module"] -pub type TBUF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TBUF; -#[doc = "`read()` method returns [tbuf::R](tbuf::R) reader structure"] -impl crate::Readable for TBUF {} -#[doc = "`write(|w| ..)` method takes [tbuf::W](tbuf::W) writer structure"] -impl crate::Writable for TBUF {} +#[doc = "TBUF register accessor: an alias for `Reg`"] +pub type TBUF = crate::Reg; #[doc = "Transmit Buffer"] pub mod tbuf; -#[doc = "Bypass Data Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [byp](byp) module"] -pub type BYP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BYP; -#[doc = "`read()` method returns [byp::R](byp::R) reader structure"] -impl crate::Readable for BYP {} -#[doc = "`write(|w| ..)` method takes [byp::W](byp::W) writer structure"] -impl crate::Writable for BYP {} +#[doc = "BYP register accessor: an alias for `Reg`"] +pub type BYP = crate::Reg; #[doc = "Bypass Data Register"] pub mod byp; -#[doc = "Bypass Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bypcr](bypcr) module"] -pub type BYPCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BYPCR; -#[doc = "`read()` method returns [bypcr::R](bypcr::R) reader structure"] -impl crate::Readable for BYPCR {} -#[doc = "`write(|w| ..)` method takes [bypcr::W](bypcr::W) writer structure"] -impl crate::Writable for BYPCR {} +#[doc = "BYPCR register accessor: an alias for `Reg`"] +pub type BYPCR = crate::Reg; #[doc = "Bypass Control Register"] pub mod bypcr; -#[doc = "Transmitter Buffer Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tbctr](tbctr) module"] -pub type TBCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TBCTR; -#[doc = "`read()` method returns [tbctr::R](tbctr::R) reader structure"] -impl crate::Readable for TBCTR {} -#[doc = "`write(|w| ..)` method takes [tbctr::W](tbctr::W) writer structure"] -impl crate::Writable for TBCTR {} +#[doc = "TBCTR register accessor: an alias for `Reg`"] +pub type TBCTR = crate::Reg; #[doc = "Transmitter Buffer Control Register"] pub mod tbctr; -#[doc = "Receiver Buffer Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbctr](rbctr) module"] -pub type RBCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RBCTR; -#[doc = "`read()` method returns [rbctr::R](rbctr::R) reader structure"] -impl crate::Readable for RBCTR {} -#[doc = "`write(|w| ..)` method takes [rbctr::W](rbctr::W) writer structure"] -impl crate::Writable for RBCTR {} +#[doc = "RBCTR register accessor: an alias for `Reg`"] +pub type RBCTR = crate::Reg; #[doc = "Receiver Buffer Control Register"] pub mod rbctr; -#[doc = "Transmit/Receive Buffer Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trbptr](trbptr) module"] -pub type TRBPTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRBPTR; -#[doc = "`read()` method returns [trbptr::R](trbptr::R) reader structure"] -impl crate::Readable for TRBPTR {} +#[doc = "TRBPTR register accessor: an alias for `Reg`"] +pub type TRBPTR = crate::Reg; #[doc = "Transmit/Receive Buffer Pointer Register"] pub mod trbptr; -#[doc = "Transmit/Receive Buffer Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trbsr](trbsr) module"] -pub type TRBSR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRBSR; -#[doc = "`read()` method returns [trbsr::R](trbsr::R) reader structure"] -impl crate::Readable for TRBSR {} -#[doc = "`write(|w| ..)` method takes [trbsr::W](trbsr::W) writer structure"] -impl crate::Writable for TRBSR {} +#[doc = "TRBSR register accessor: an alias for `Reg`"] +pub type TRBSR = crate::Reg; #[doc = "Transmit/Receive Buffer Status Register"] pub mod trbsr; -#[doc = "Transmit/Receive Buffer Status Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trbscr](trbscr) module"] -pub type TRBSCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TRBSCR; -#[doc = "`write(|w| ..)` method takes [trbscr::W](trbscr::W) writer structure"] -impl crate::Writable for TRBSCR {} +#[doc = "TRBSCR register accessor: an alias for `Reg`"] +pub type TRBSCR = crate::Reg; #[doc = "Transmit/Receive Buffer Status Clear Register"] pub mod trbscr; -#[doc = "Receiver Buffer Output Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outr](outr) module"] -pub type OUTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUTR; -#[doc = "`read()` method returns [outr::R](outr::R) reader structure"] -impl crate::Readable for OUTR {} +#[doc = "OUTR register accessor: an alias for `Reg`"] +pub type OUTR = crate::Reg; #[doc = "Receiver Buffer Output Register"] pub mod outr; -#[doc = "Receiver Buffer Output Register L for Debugger\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outdr](outdr) module"] -pub type OUTDR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OUTDR; -#[doc = "`read()` method returns [outdr::R](outdr::R) reader structure"] -impl crate::Readable for OUTDR {} +#[doc = "OUTDR register accessor: an alias for `Reg`"] +pub type OUTDR = crate::Reg; #[doc = "Receiver Buffer Output Register L for Debugger"] pub mod outdr; -#[doc = "Transmit FIFO Buffer\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](in_) module"] -pub type IN = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _IN; -#[doc = "`write(|w| ..)` method takes [in_::W](in_::W) writer structure"] -impl crate::Writable for IN {} +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; #[doc = "Transmit FIFO Buffer"] pub mod in_; diff --git a/src/usic0_ch0/brg.rs b/src/usic0_ch0/brg.rs index 618236a7..f3c66c69 100644 --- a/src/usic0_ch0/brg.rs +++ b/src/usic0_ch0/brg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BRG"] -pub type R = crate::R; -#[doc = "Writer for register BRG"] -pub type W = crate::W; -#[doc = "Register BRG `reset()`'s with value 0"] -impl crate::ResetValue for super::BRG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BRG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BRG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clock Selection\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CLKSEL`"] -pub type CLKSEL_R = crate::R; +#[doc = "Field `CLKSEL` reader - Clock Selection"] +pub struct CLKSEL_R(crate::FieldReader); impl CLKSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CLKSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CLKSEL_A::VALUE1), - 2 => Val(CLKSEL_A::VALUE3), - 3 => Val(CLKSEL_A::VALUE4), - i => Res(i), + 0 => Some(CLKSEL_A::VALUE1), + 2 => Some(CLKSEL_A::VALUE3), + 3 => Some(CLKSEL_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CLKSEL_A::VALUE1 + **self == CLKSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CLKSEL_A::VALUE3 + **self == CLKSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CLKSEL_A::VALUE4 + **self == CLKSEL_A::VALUE4 + } +} +impl core::ops::Deref for CLKSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CLKSEL`"] +#[doc = "Field `CLKSEL` writer - Clock Selection"] pub struct CLKSEL_W<'a> { w: &'a mut W, } @@ -85,7 +118,7 @@ impl<'a> CLKSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -103,9 +136,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TMEN`"] -pub type TMEN_R = crate::R; +#[doc = "Field `TMEN` reader - Timing Measurement Enable"] +pub struct TMEN_R(crate::FieldReader); impl TMEN_R { + pub(crate) fn new(bits: bool) -> Self { + TMEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TMEN_A { @@ -117,15 +153,22 @@ impl TMEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TMEN_A::VALUE1 + **self == TMEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TMEN_A::VALUE2 + **self == TMEN_A::VALUE2 } } -#[doc = "Write proxy for field `TMEN`"] +impl core::ops::Deref for TMEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TMEN` writer - Timing Measurement Enable"] pub struct TMEN_W<'a> { w: &'a mut W, } @@ -133,9 +176,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TMEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Timing measurement is disabled: The trigger signals DX0T and DX1T are ignored."] #[inline(always)] @@ -160,7 +201,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -178,9 +219,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PPPEN`"] -pub type PPPEN_R = crate::R; +#[doc = "Field `PPPEN` reader - Enable 2:1 Divider for fPPP"] +pub struct PPPEN_R(crate::FieldReader); impl PPPEN_R { + pub(crate) fn new(bits: bool) -> Self { + PPPEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PPPEN_A { @@ -192,15 +236,22 @@ impl PPPEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PPPEN_A::VALUE1 + **self == PPPEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PPPEN_A::VALUE2 + **self == PPPEN_A::VALUE2 + } +} +impl core::ops::Deref for PPPEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PPPEN`"] +#[doc = "Field `PPPEN` writer - Enable 2:1 Divider for fPPP"] pub struct PPPEN_W<'a> { w: &'a mut W, } @@ -208,9 +259,7 @@ impl<'a> PPPEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PPPEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The 2:1 divider for fPPP is disabled. fPPP = fPIN"] #[inline(always)] @@ -235,7 +284,7 @@ impl<'a> PPPEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -258,9 +307,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CTQSEL`"] -pub type CTQSEL_R = crate::R; +#[doc = "Field `CTQSEL` reader - Input Selection for CTQ"] +pub struct CTQSEL_R(crate::FieldReader); impl CTQSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CTQSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CTQSEL_A { @@ -275,25 +327,32 @@ impl CTQSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CTQSEL_A::VALUE1 + **self == CTQSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CTQSEL_A::VALUE2 + **self == CTQSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CTQSEL_A::VALUE3 + **self == CTQSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CTQSEL_A::VALUE4 + **self == CTQSEL_A::VALUE4 + } +} +impl core::ops::Deref for CTQSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CTQSEL`"] +#[doc = "Field `CTQSEL` writer - Input Selection for CTQ"] pub struct CTQSEL_W<'a> { w: &'a mut W, } @@ -301,9 +360,7 @@ impl<'a> CTQSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTQSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "fCTQIN = fPDIV"] #[inline(always)] @@ -328,13 +385,25 @@ impl<'a> CTQSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } -#[doc = "Reader of field `PCTQ`"] -pub type PCTQ_R = crate::R; -#[doc = "Write proxy for field `PCTQ`"] +#[doc = "Field `PCTQ` reader - Pre-Divider for Time Quanta Counter"] +pub struct PCTQ_R(crate::FieldReader); +impl PCTQ_R { + pub(crate) fn new(bits: u8) -> Self { + PCTQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCTQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCTQ` writer - Pre-Divider for Time Quanta Counter"] pub struct PCTQ_W<'a> { w: &'a mut W, } @@ -342,13 +411,25 @@ impl<'a> PCTQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } -#[doc = "Reader of field `DCTQ`"] -pub type DCTQ_R = crate::R; -#[doc = "Write proxy for field `DCTQ`"] +#[doc = "Field `DCTQ` reader - Denominator for Time Quanta Counter"] +pub struct DCTQ_R(crate::FieldReader); +impl DCTQ_R { + pub(crate) fn new(bits: u8) -> Self { + DCTQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCTQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCTQ` writer - Denominator for Time Quanta Counter"] pub struct DCTQ_W<'a> { w: &'a mut W, } @@ -356,13 +437,25 @@ impl<'a> DCTQ_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 10)) | (((value as u32) & 0x1f) << 10); + self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10); self.w } } -#[doc = "Reader of field `PDIV`"] -pub type PDIV_R = crate::R; -#[doc = "Write proxy for field `PDIV`"] +#[doc = "Field `PDIV` reader - Divider Mode: Divider Factor to Generate fPDIV"] +pub struct PDIV_R(crate::FieldReader); +impl PDIV_R { + pub(crate) fn new(bits: u16) -> Self { + PDIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PDIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PDIV` writer - Divider Mode: Divider Factor to Generate fPDIV"] pub struct PDIV_W<'a> { w: &'a mut W, } @@ -370,7 +463,7 @@ impl<'a> PDIV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 16)) | (((value as u32) & 0x03ff) << 16); + self.w.bits = (self.w.bits & !(0x03ff << 16)) | ((value as u32 & 0x03ff) << 16); self.w } } @@ -388,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCLKOSEL`"] -pub type SCLKOSEL_R = crate::R; +#[doc = "Field `SCLKOSEL` reader - Shift Clock Output Select"] +pub struct SCLKOSEL_R(crate::FieldReader); impl SCLKOSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SCLKOSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCLKOSEL_A { @@ -402,15 +498,22 @@ impl SCLKOSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCLKOSEL_A::VALUE1 + **self == SCLKOSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCLKOSEL_A::VALUE2 + **self == SCLKOSEL_A::VALUE2 } } -#[doc = "Write proxy for field `SCLKOSEL`"] +impl core::ops::Deref for SCLKOSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCLKOSEL` writer - Shift Clock Output Select"] pub struct SCLKOSEL_W<'a> { w: &'a mut W, } @@ -418,9 +521,7 @@ impl<'a> SCLKOSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCLKOSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "SCLK from the baud rate generator is selected as the SCLKOUT input source."] #[inline(always)] @@ -445,7 +546,7 @@ impl<'a> SCLKOSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -463,9 +564,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCLKCFG`"] -pub type MCLKCFG_R = crate::R; +#[doc = "Field `MCLKCFG` reader - Master Clock Configuration"] +pub struct MCLKCFG_R(crate::FieldReader); impl MCLKCFG_R { + pub(crate) fn new(bits: bool) -> Self { + MCLKCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCLKCFG_A { @@ -477,15 +581,22 @@ impl MCLKCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCLKCFG_A::VALUE1 + **self == MCLKCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCLKCFG_A::VALUE2 + **self == MCLKCFG_A::VALUE2 } } -#[doc = "Write proxy for field `MCLKCFG`"] +impl core::ops::Deref for MCLKCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCLKCFG` writer - Master Clock Configuration"] pub struct MCLKCFG_W<'a> { w: &'a mut W, } @@ -493,9 +604,7 @@ impl<'a> MCLKCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCLKCFG_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The passive level is 0."] #[inline(always)] @@ -520,7 +629,7 @@ impl<'a> MCLKCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -543,9 +652,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SCLKCFG`"] -pub type SCLKCFG_R = crate::R; +#[doc = "Field `SCLKCFG` reader - Shift Clock Output Configuration"] +pub struct SCLKCFG_R(crate::FieldReader); impl SCLKCFG_R { + pub(crate) fn new(bits: u8) -> Self { + SCLKCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCLKCFG_A { @@ -560,25 +672,32 @@ impl SCLKCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCLKCFG_A::VALUE1 + **self == SCLKCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCLKCFG_A::VALUE2 + **self == SCLKCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SCLKCFG_A::VALUE3 + **self == SCLKCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SCLKCFG_A::VALUE4 + **self == SCLKCFG_A::VALUE4 } } -#[doc = "Write proxy for field `SCLKCFG`"] +impl core::ops::Deref for SCLKCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCLKCFG` writer - Shift Clock Output Configuration"] pub struct SCLKCFG_W<'a> { w: &'a mut W, } @@ -586,9 +705,7 @@ impl<'a> SCLKCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCLKCFG_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The passive level is 0 and the delay is disabled."] #[inline(always)] @@ -613,7 +730,7 @@ impl<'a> SCLKCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30); + self.w.bits = (self.w.bits & !(0x03 << 30)) | ((value as u32 & 0x03) << 30); self.w } } @@ -720,4 +837,30 @@ impl W { pub fn sclkcfg(&mut self) -> SCLKCFG_W { SCLKCFG_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Baud Rate Generator Register\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 [brg](index.html) module"] +pub struct BRG_SPEC; +impl crate::RegisterSpec for BRG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [brg::R](R) reader structure"] +impl crate::Readable for BRG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [brg::W](W) writer structure"] +impl crate::Writable for BRG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BRG to value 0"] +impl crate::Resettable for BRG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/byp.rs b/src/usic0_ch0/byp.rs index 19e39378..79d1c94f 100644 --- a/src/usic0_ch0/byp.rs +++ b/src/usic0_ch0/byp.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register BYP"] -pub type R = crate::R; -#[doc = "Writer for register BYP"] -pub type W = crate::W; -#[doc = "Register BYP `reset()`'s with value 0"] -impl crate::ResetValue for super::BYP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BYP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BYP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `BDATA`"] -pub type BDATA_R = crate::R; -#[doc = "Write proxy for field `BDATA`"] +#[doc = "Field `BDATA` reader - Bypass Data"] +pub struct BDATA_R(crate::FieldReader); +impl BDATA_R { + pub(crate) fn new(bits: u16) -> Self { + BDATA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BDATA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BDATA` writer - Bypass Data"] pub struct BDATA_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> BDATA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn bdata(&mut self) -> BDATA_W { BDATA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Bypass Data Register\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 [byp](index.html) module"] +pub struct BYP_SPEC; +impl crate::RegisterSpec for BYP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [byp::R](R) reader structure"] +impl crate::Readable for BYP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [byp::W](W) writer structure"] +impl crate::Writable for BYP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BYP to value 0"] +impl crate::Resettable for BYP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/bypcr.rs b/src/usic0_ch0/bypcr.rs index a99637ab..887e4dce 100644 --- a/src/usic0_ch0/bypcr.rs +++ b/src/usic0_ch0/bypcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register BYPCR"] -pub type R = crate::R; -#[doc = "Writer for register BYPCR"] -pub type W = crate::W; -#[doc = "Register BYPCR `reset()`'s with value 0"] -impl crate::ResetValue for super::BYPCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BYPCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BYPCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BWLE` reader - Bypass Word Length"] +pub struct BWLE_R(crate::FieldReader); +impl BWLE_R { + pub(crate) fn new(bits: u8) -> Self { + BWLE_R(crate::FieldReader::new(bits)) } } -#[doc = "Reader of field `BWLE`"] -pub type BWLE_R = crate::R; -#[doc = "Write proxy for field `BWLE`"] +impl core::ops::Deref for BWLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BWLE` writer - Bypass Word Length"] pub struct BWLE_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> BWLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BDSSM`"] -pub type BDSSM_R = crate::R; +#[doc = "Field `BDSSM` reader - Bypass Data Single Shot Mode"] +pub struct BDSSM_R(crate::FieldReader); impl BDSSM_R { + pub(crate) fn new(bits: bool) -> Self { + BDSSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BDSSM_A { @@ -52,15 +91,22 @@ impl BDSSM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BDSSM_A::VALUE1 + **self == BDSSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BDSSM_A::VALUE2 + **self == BDSSM_A::VALUE2 } } -#[doc = "Write proxy for field `BDSSM`"] +impl core::ops::Deref for BDSSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BDSSM` writer - Bypass Data Single Shot Mode"] pub struct BDSSM_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> BDSSM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BDSSM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The bypass data is still considered as valid after it has been loaded into TBUF. The loading of the data into TBUF does not clear BDV."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> BDSSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -118,9 +162,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BDEN`"] -pub type BDEN_R = crate::R; +#[doc = "Field `BDEN` reader - Bypass Data Enable"] +pub struct BDEN_R(crate::FieldReader); impl BDEN_R { + pub(crate) fn new(bits: u8) -> Self { + BDEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BDEN_A { @@ -135,25 +182,32 @@ impl BDEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BDEN_A::VALUE1 + **self == BDEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BDEN_A::VALUE2 + **self == BDEN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BDEN_A::VALUE3 + **self == BDEN_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BDEN_A::VALUE4 + **self == BDEN_A::VALUE4 + } +} +impl core::ops::Deref for BDEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BDEN`"] +#[doc = "Field `BDEN` writer - Bypass Data Enable"] pub struct BDEN_W<'a> { w: &'a mut W, } @@ -161,9 +215,7 @@ impl<'a> BDEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BDEN_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The transfer of bypass data is disabled."] #[inline(always)] @@ -188,7 +240,7 @@ impl<'a> BDEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -206,9 +258,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BDVTR`"] -pub type BDVTR_R = crate::R; +#[doc = "Field `BDVTR` reader - Bypass Data Valid Trigger"] +pub struct BDVTR_R(crate::FieldReader); impl BDVTR_R { + pub(crate) fn new(bits: bool) -> Self { + BDVTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BDVTR_A { @@ -220,15 +275,22 @@ impl BDVTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BDVTR_A::VALUE1 + **self == BDVTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BDVTR_A::VALUE2 + **self == BDVTR_A::VALUE2 + } +} +impl core::ops::Deref for BDVTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BDVTR`"] +#[doc = "Field `BDVTR` writer - Bypass Data Valid Trigger"] pub struct BDVTR_W<'a> { w: &'a mut W, } @@ -236,9 +298,7 @@ impl<'a> BDVTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BDVTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Bit BDV is not influenced by DX2T."] #[inline(always)] @@ -263,7 +323,7 @@ impl<'a> BDVTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -281,9 +341,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BPRIO`"] -pub type BPRIO_R = crate::R; +#[doc = "Field `BPRIO` reader - Bypass Priority"] +pub struct BPRIO_R(crate::FieldReader); impl BPRIO_R { + pub(crate) fn new(bits: bool) -> Self { + BPRIO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BPRIO_A { @@ -295,15 +358,22 @@ impl BPRIO_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BPRIO_A::VALUE1 + **self == BPRIO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BPRIO_A::VALUE2 + **self == BPRIO_A::VALUE2 } } -#[doc = "Write proxy for field `BPRIO`"] +impl core::ops::Deref for BPRIO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BPRIO` writer - Bypass Priority"] pub struct BPRIO_W<'a> { w: &'a mut W, } @@ -311,9 +381,7 @@ impl<'a> BPRIO_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BPRIO_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmit FIFO data has a higher priority than the bypass data."] #[inline(always)] @@ -338,7 +406,7 @@ impl<'a> BPRIO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -356,9 +424,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BDV`"] -pub type BDV_R = crate::R; +#[doc = "Field `BDV` reader - Bypass Data Valid"] +pub struct BDV_R(crate::FieldReader); impl BDV_R { + pub(crate) fn new(bits: bool) -> Self { + BDV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BDV_A { @@ -370,17 +441,36 @@ impl BDV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BDV_A::VALUE1 + **self == BDV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BDV_A::VALUE2 + **self == BDV_A::VALUE2 + } +} +impl core::ops::Deref for BDV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `BSELO`"] -pub type BSELO_R = crate::R; -#[doc = "Write proxy for field `BSELO`"] +#[doc = "Field `BSELO` reader - Bypass Select Outputs"] +pub struct BSELO_R(crate::FieldReader); +impl BSELO_R { + pub(crate) fn new(bits: u8) -> Self { + BSELO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BSELO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BSELO` writer - Bypass Select Outputs"] pub struct BSELO_W<'a> { w: &'a mut W, } @@ -388,13 +478,25 @@ impl<'a> BSELO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); + self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16); self.w } } -#[doc = "Reader of field `BHPC`"] -pub type BHPC_R = crate::R; -#[doc = "Write proxy for field `BHPC`"] +#[doc = "Field `BHPC` reader - Bypass Hardware Port Control"] +pub struct BHPC_R(crate::FieldReader); +impl BHPC_R { + pub(crate) fn new(bits: u8) -> Self { + BHPC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BHPC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BHPC` writer - Bypass Hardware Port Control"] pub struct BHPC_W<'a> { w: &'a mut W, } @@ -402,7 +504,7 @@ impl<'a> BHPC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 21)) | (((value as u32) & 0x07) << 21); + self.w.bits = (self.w.bits & !(0x07 << 21)) | ((value as u32 & 0x07) << 21); self.w } } @@ -484,4 +586,30 @@ impl W { pub fn bhpc(&mut self) -> BHPC_W { BHPC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Bypass Control Register\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 [bypcr](index.html) module"] +pub struct BYPCR_SPEC; +impl crate::RegisterSpec for BYPCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bypcr::R](R) reader structure"] +impl crate::Readable for BYPCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bypcr::W](W) writer structure"] +impl crate::Writable for BYPCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BYPCR to value 0"] +impl crate::Resettable for BYPCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/ccfg.rs b/src/usic0_ch0/ccfg.rs index 7ccab7cb..35b4cfb9 100644 --- a/src/usic0_ch0/ccfg.rs +++ b/src/usic0_ch0/ccfg.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register CCFG"] -pub type R = crate::R; +#[doc = "Register `CCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "SSC Protocol Available\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SSC_A { @@ -14,9 +27,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SSC`"] -pub type SSC_R = crate::R; +#[doc = "Field `SSC` reader - SSC Protocol Available"] +pub struct SSC_R(crate::FieldReader); impl SSC_R { + pub(crate) fn new(bits: bool) -> Self { + SSC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SSC_A { @@ -28,12 +44,19 @@ impl SSC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SSC_A::VALUE1 + **self == SSC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SSC_A::VALUE2 + **self == SSC_A::VALUE2 + } +} +impl core::ops::Deref for SSC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "ASC Protocol Available\n\nValue on reset: 1"] @@ -50,9 +73,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASC`"] -pub type ASC_R = crate::R; +#[doc = "Field `ASC` reader - ASC Protocol Available"] +pub struct ASC_R(crate::FieldReader); impl ASC_R { + pub(crate) fn new(bits: bool) -> Self { + ASC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASC_A { @@ -64,12 +90,19 @@ impl ASC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASC_A::VALUE1 + **self == ASC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASC_A::VALUE2 + **self == ASC_A::VALUE2 + } +} +impl core::ops::Deref for ASC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "IIC Protocol Available\n\nValue on reset: 1"] @@ -86,9 +119,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IIC`"] -pub type IIC_R = crate::R; +#[doc = "Field `IIC` reader - IIC Protocol Available"] +pub struct IIC_R(crate::FieldReader); impl IIC_R { + pub(crate) fn new(bits: bool) -> Self { + IIC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IIC_A { @@ -100,12 +136,19 @@ impl IIC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IIC_A::VALUE1 + **self == IIC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IIC_A::VALUE2 + **self == IIC_A::VALUE2 + } +} +impl core::ops::Deref for IIC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "IIS Protocol Available\n\nValue on reset: 1"] @@ -122,9 +165,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IIS`"] -pub type IIS_R = crate::R; +#[doc = "Field `IIS` reader - IIS Protocol Available"] +pub struct IIS_R(crate::FieldReader); impl IIS_R { + pub(crate) fn new(bits: bool) -> Self { + IIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IIS_A { @@ -136,12 +182,19 @@ impl IIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IIS_A::VALUE1 + **self == IIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IIS_A::VALUE2 + **self == IIS_A::VALUE2 + } +} +impl core::ops::Deref for IIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive FIFO Buffer Available\n\nValue on reset: 1"] @@ -158,9 +211,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RB`"] -pub type RB_R = crate::R; +#[doc = "Field `RB` reader - Receive FIFO Buffer Available"] +pub struct RB_R(crate::FieldReader); impl RB_R { + pub(crate) fn new(bits: bool) -> Self { + RB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RB_A { @@ -172,12 +228,19 @@ impl RB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RB_A::VALUE1 + **self == RB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RB_A::VALUE2 + **self == RB_A::VALUE2 + } +} +impl core::ops::Deref for RB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit FIFO Buffer Available\n\nValue on reset: 1"] @@ -194,9 +257,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TB`"] -pub type TB_R = crate::R; +#[doc = "Field `TB` reader - Transmit FIFO Buffer Available"] +pub struct TB_R(crate::FieldReader); impl TB_R { + pub(crate) fn new(bits: bool) -> Self { + TB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TB_A { @@ -208,12 +274,19 @@ impl TB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TB_A::VALUE1 + **self == TB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TB_A::VALUE2 + **self == TB_A::VALUE2 + } +} +impl core::ops::Deref for TB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -248,3 +321,19 @@ impl R { TB_R::new(((self.bits >> 7) & 0x01) != 0) } } +#[doc = "Channel Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccfg](index.html) module"] +pub struct CCFG_SPEC; +impl crate::RegisterSpec for CCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccfg::R](R) reader structure"] +impl crate::Readable for CCFG_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CCFG to value 0xcf"] +impl crate::Resettable for CCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xcf + } +} diff --git a/src/usic0_ch0/ccr.rs b/src/usic0_ch0/ccr.rs index eb4cb207..d9150e52 100644 --- a/src/usic0_ch0/ccr.rs +++ b/src/usic0_ch0/ccr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CCR"] -pub type R = crate::R; -#[doc = "Writer for register CCR"] -pub type W = crate::W; -#[doc = "Register CCR `reset()`'s with value 0"] -impl crate::ResetValue for super::CCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Operating Mode\n\nValue on reset: 0"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `MODE`"] -pub type MODE_R = crate::R; +#[doc = "Field `MODE` reader - Operating Mode"] +pub struct MODE_R(crate::FieldReader); impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(MODE_A::VALUE1), - 1 => Val(MODE_A::VALUE2), - 2 => Val(MODE_A::VALUE3), - 3 => Val(MODE_A::VALUE4), - 4 => Val(MODE_A::VALUE5), - i => Res(i), + 0 => Some(MODE_A::VALUE1), + 1 => Some(MODE_A::VALUE2), + 2 => Some(MODE_A::VALUE3), + 3 => Some(MODE_A::VALUE4), + 4 => Some(MODE_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODE_A::VALUE1 + **self == MODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODE_A::VALUE2 + **self == MODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == MODE_A::VALUE3 + **self == MODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == MODE_A::VALUE4 + **self == MODE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == MODE_A::VALUE5 + **self == MODE_A::VALUE5 + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODE`"] +#[doc = "Field `MODE` writer - Operating Mode"] pub struct MODE_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> MODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -135,9 +168,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `HPCEN`"] -pub type HPCEN_R = crate::R; +#[doc = "Field `HPCEN` reader - Hardware Port Control Enable"] +pub struct HPCEN_R(crate::FieldReader); impl HPCEN_R { + pub(crate) fn new(bits: u8) -> Self { + HPCEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HPCEN_A { @@ -152,25 +188,32 @@ impl HPCEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HPCEN_A::VALUE1 + **self == HPCEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HPCEN_A::VALUE2 + **self == HPCEN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == HPCEN_A::VALUE3 + **self == HPCEN_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == HPCEN_A::VALUE4 + **self == HPCEN_A::VALUE4 } } -#[doc = "Write proxy for field `HPCEN`"] +impl core::ops::Deref for HPCEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HPCEN` writer - Hardware Port Control Enable"] pub struct HPCEN_W<'a> { w: &'a mut W, } @@ -178,9 +221,7 @@ impl<'a> HPCEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HPCEN_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The hardware port control is disabled."] #[inline(always)] @@ -206,7 +247,7 @@ and DOUT\\[3:0\\]."] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -227,37 +268,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PM`"] -pub type PM_R = crate::R; +#[doc = "Field `PM` reader - Parity Mode"] +pub struct PM_R(crate::FieldReader); impl PM_R { + pub(crate) fn new(bits: u8) -> Self { + PM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PM_A::VALUE1), - 2 => Val(PM_A::VALUE3), - 3 => Val(PM_A::VALUE4), - i => Res(i), + 0 => Some(PM_A::VALUE1), + 2 => Some(PM_A::VALUE3), + 3 => Some(PM_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PM_A::VALUE1 + **self == PM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PM_A::VALUE3 + **self == PM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PM_A::VALUE4 + **self == PM_A::VALUE4 + } +} +impl core::ops::Deref for PM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PM`"] +#[doc = "Field `PM` writer - Parity Mode"] pub struct PM_W<'a> { w: &'a mut W, } @@ -285,7 +335,7 @@ impl<'a> PM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -303,9 +353,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIEN`"] -pub type RSIEN_R = crate::R; +#[doc = "Field `RSIEN` reader - Receiver Start Interrupt Enable"] +pub struct RSIEN_R(crate::FieldReader); impl RSIEN_R { + pub(crate) fn new(bits: bool) -> Self { + RSIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIEN_A { @@ -317,15 +370,22 @@ impl RSIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIEN_A::VALUE1 + **self == RSIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIEN_A::VALUE2 + **self == RSIEN_A::VALUE2 } } -#[doc = "Write proxy for field `RSIEN`"] +impl core::ops::Deref for RSIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSIEN` writer - Receiver Start Interrupt Enable"] pub struct RSIEN_W<'a> { w: &'a mut W, } @@ -333,9 +393,7 @@ impl<'a> RSIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The receiver start interrupt is disabled."] #[inline(always)] @@ -360,7 +418,7 @@ impl<'a> RSIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -378,9 +436,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIEN`"] -pub type DLIEN_R = crate::R; +#[doc = "Field `DLIEN` reader - Data Lost Interrupt Enable"] +pub struct DLIEN_R(crate::FieldReader); impl DLIEN_R { + pub(crate) fn new(bits: bool) -> Self { + DLIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIEN_A { @@ -392,15 +453,22 @@ impl DLIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIEN_A::VALUE1 + **self == DLIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIEN_A::VALUE2 + **self == DLIEN_A::VALUE2 + } +} +impl core::ops::Deref for DLIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DLIEN`"] +#[doc = "Field `DLIEN` writer - Data Lost Interrupt Enable"] pub struct DLIEN_W<'a> { w: &'a mut W, } @@ -408,9 +476,7 @@ impl<'a> DLIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The data lost interrupt is disabled."] #[inline(always)] @@ -435,7 +501,7 @@ impl<'a> DLIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -453,9 +519,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIEN`"] -pub type TSIEN_R = crate::R; +#[doc = "Field `TSIEN` reader - Transmit Shift Interrupt Enable"] +pub struct TSIEN_R(crate::FieldReader); impl TSIEN_R { + pub(crate) fn new(bits: bool) -> Self { + TSIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIEN_A { @@ -467,15 +536,22 @@ impl TSIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIEN_A::VALUE1 + **self == TSIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIEN_A::VALUE2 + **self == TSIEN_A::VALUE2 + } +} +impl core::ops::Deref for TSIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSIEN`"] +#[doc = "Field `TSIEN` writer - Transmit Shift Interrupt Enable"] pub struct TSIEN_W<'a> { w: &'a mut W, } @@ -483,9 +559,7 @@ impl<'a> TSIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmit shift interrupt is disabled."] #[inline(always)] @@ -510,7 +584,7 @@ impl<'a> TSIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -528,9 +602,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIEN`"] -pub type TBIEN_R = crate::R; +#[doc = "Field `TBIEN` reader - Transmit Buffer Interrupt Enable"] +pub struct TBIEN_R(crate::FieldReader); impl TBIEN_R { + pub(crate) fn new(bits: bool) -> Self { + TBIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIEN_A { @@ -542,15 +619,22 @@ impl TBIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIEN_A::VALUE1 + **self == TBIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIEN_A::VALUE2 + **self == TBIEN_A::VALUE2 + } +} +impl core::ops::Deref for TBIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TBIEN`"] +#[doc = "Field `TBIEN` writer - Transmit Buffer Interrupt Enable"] pub struct TBIEN_W<'a> { w: &'a mut W, } @@ -558,9 +642,7 @@ impl<'a> TBIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmit buffer interrupt is disabled."] #[inline(always)] @@ -585,7 +667,7 @@ impl<'a> TBIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -603,9 +685,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIEN`"] -pub type RIEN_R = crate::R; +#[doc = "Field `RIEN` reader - Receive Interrupt Enable"] +pub struct RIEN_R(crate::FieldReader); impl RIEN_R { + pub(crate) fn new(bits: bool) -> Self { + RIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIEN_A { @@ -617,15 +702,22 @@ impl RIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIEN_A::VALUE1 + **self == RIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIEN_A::VALUE2 + **self == RIEN_A::VALUE2 } } -#[doc = "Write proxy for field `RIEN`"] +impl core::ops::Deref for RIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RIEN` writer - Receive Interrupt Enable"] pub struct RIEN_W<'a> { w: &'a mut W, } @@ -633,9 +725,7 @@ impl<'a> RIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The receive interrupt is disabled."] #[inline(always)] @@ -660,7 +750,7 @@ impl<'a> RIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -678,9 +768,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIEN`"] -pub type AIEN_R = crate::R; +#[doc = "Field `AIEN` reader - Alternative Receive Interrupt Enable"] +pub struct AIEN_R(crate::FieldReader); impl AIEN_R { + pub(crate) fn new(bits: bool) -> Self { + AIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIEN_A { @@ -692,15 +785,22 @@ impl AIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIEN_A::VALUE1 + **self == AIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIEN_A::VALUE2 + **self == AIEN_A::VALUE2 } } -#[doc = "Write proxy for field `AIEN`"] +impl core::ops::Deref for AIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AIEN` writer - Alternative Receive Interrupt Enable"] pub struct AIEN_W<'a> { w: &'a mut W, } @@ -708,9 +808,7 @@ impl<'a> AIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The alternative receive interrupt is disabled."] #[inline(always)] @@ -735,7 +833,7 @@ impl<'a> AIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -753,9 +851,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIEN`"] -pub type BRGIEN_R = crate::R; +#[doc = "Field `BRGIEN` reader - Baud Rate Generator Interrupt Enable"] +pub struct BRGIEN_R(crate::FieldReader); impl BRGIEN_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIEN_A { @@ -767,15 +868,22 @@ impl BRGIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIEN_A::VALUE1 + **self == BRGIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIEN_A::VALUE2 + **self == BRGIEN_A::VALUE2 } } -#[doc = "Write proxy for field `BRGIEN`"] +impl core::ops::Deref for BRGIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BRGIEN` writer - Baud Rate Generator Interrupt Enable"] pub struct BRGIEN_W<'a> { w: &'a mut W, } @@ -783,9 +891,7 @@ impl<'a> BRGIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The baud rate generator interrupt is disabled."] #[inline(always)] @@ -810,7 +916,7 @@ impl<'a> BRGIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -917,4 +1023,30 @@ impl W { pub fn brgien(&mut self) -> BRGIEN_W { BRGIEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Control Register\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 [ccr](index.html) module"] +pub struct CCR_SPEC; +impl crate::RegisterSpec for CCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccr::R](R) reader structure"] +impl crate::Readable for CCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccr::W](W) writer structure"] +impl crate::Writable for CCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCR to value 0"] +impl crate::Resettable for CCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/cmtr.rs b/src/usic0_ch0/cmtr.rs index 8cf5370d..0a53cb88 100644 --- a/src/usic0_ch0/cmtr.rs +++ b/src/usic0_ch0/cmtr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CMTR"] -pub type R = crate::R; -#[doc = "Writer for register CMTR"] -pub type W = crate::W; -#[doc = "Register CMTR `reset()`'s with value 0"] -impl crate::ResetValue for super::CMTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CMTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CMTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `CTV`"] -pub type CTV_R = crate::R; -#[doc = "Write proxy for field `CTV`"] +#[doc = "Field `CTV` reader - Captured Timer Value"] +pub struct CTV_R(crate::FieldReader); +impl CTV_R { + pub(crate) fn new(bits: u16) -> Self { + CTV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTV` writer - Captured Timer Value"] pub struct CTV_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CTV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn ctv(&mut self) -> CTV_W { CTV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Capture Mode Timer Register\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 [cmtr](index.html) module"] +pub struct CMTR_SPEC; +impl crate::RegisterSpec for CMTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cmtr::R](R) reader structure"] +impl crate::Readable for CMTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cmtr::W](W) writer structure"] +impl crate::Writable for CMTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CMTR to value 0"] +impl crate::Resettable for CMTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx0cr.rs b/src/usic0_ch0/dx0cr.rs index 0ab59404..c421b580 100644 --- a/src/usic0_ch0/dx0cr.rs +++ b/src/usic0_ch0/dx0cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX0CR"] -pub type R = crate::R; -#[doc = "Writer for register DX0CR"] -pub type W = crate::W; -#[doc = "Register DX0CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX0CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX0CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX0CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DXnA is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -183,15 +218,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -258,15 +301,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 + } +} +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DFEN`"] +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -333,15 +384,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 + } +} +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEN`"] +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -408,15 +467,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 } } -#[doc = "Write proxy for field `DPOL`"] +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -483,15 +550,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -549,9 +621,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -566,25 +641,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -592,9 +674,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -619,7 +699,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -637,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -651,12 +734,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -737,4 +827,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 0\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 [dx0cr](index.html) module"] +pub struct DX0CR_SPEC; +impl crate::RegisterSpec for DX0CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx0cr::R](R) reader structure"] +impl crate::Readable for DX0CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx0cr::W](W) writer structure"] +impl crate::Writable for DX0CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX0CR to value 0"] +impl crate::Resettable for DX0CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx1cr.rs b/src/usic0_ch0/dx1cr.rs index de7b8ee2..3e2f01b9 100644 --- a/src/usic0_ch0/dx1cr.rs +++ b/src/usic0_ch0/dx1cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX1CR"] -pub type R = crate::R; -#[doc = "Writer for register DX1CR"] -pub type W = crate::W; -#[doc = "Register DX1CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX1CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX1CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX1CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 + } +} +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEL`"] +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DX1A is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCEN`"] -pub type DCEN_R = crate::R; +#[doc = "Field `DCEN` reader - Delay Compensation Enable"] +pub struct DCEN_R(crate::FieldReader); impl DCEN_R { + pub(crate) fn new(bits: bool) -> Self { + DCEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCEN_A { @@ -183,15 +218,22 @@ impl DCEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCEN_A::VALUE1 + **self == DCEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCEN_A::VALUE2 + **self == DCEN_A::VALUE2 } } -#[doc = "Write proxy for field `DCEN`"] +impl core::ops::Deref for DCEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCEN` writer - Delay Compensation Enable"] pub struct DCEN_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> DCEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The receive shift clock is dependent on INSW selection."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> DCEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -258,15 +301,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -333,15 +384,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 } } -#[doc = "Write proxy for field `DFEN`"] +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -408,15 +467,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 } } -#[doc = "Write proxy for field `DSEN`"] +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -483,15 +550,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 + } +} +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DPOL`"] +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -544,9 +616,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -558,15 +633,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -574,9 +656,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -601,7 +681,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -624,9 +704,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -641,25 +724,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -667,9 +757,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -694,7 +782,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -712,9 +800,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -726,12 +817,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -822,4 +920,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 1\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 [dx1cr](index.html) module"] +pub struct DX1CR_SPEC; +impl crate::RegisterSpec for DX1CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx1cr::R](R) reader structure"] +impl crate::Readable for DX1CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx1cr::W](W) writer structure"] +impl crate::Writable for DX1CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX1CR to value 0"] +impl crate::Resettable for DX1CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx2cr.rs b/src/usic0_ch0/dx2cr.rs index a87409f7..d87e5dce 100644 --- a/src/usic0_ch0/dx2cr.rs +++ b/src/usic0_ch0/dx2cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX2CR"] -pub type R = crate::R; -#[doc = "Writer for register DX2CR"] -pub type W = crate::W; -#[doc = "Register DX2CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX2CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX2CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX2CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DXnA is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -183,15 +218,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -258,15 +301,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 + } +} +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DFEN`"] +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -333,15 +384,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 + } +} +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEN`"] +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -408,15 +467,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 } } -#[doc = "Write proxy for field `DPOL`"] +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -483,15 +550,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -549,9 +621,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -566,25 +641,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -592,9 +674,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -619,7 +699,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -637,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -651,12 +734,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -737,4 +827,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 2\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 [dx2cr](index.html) module"] +pub struct DX2CR_SPEC; +impl crate::RegisterSpec for DX2CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx2cr::R](R) reader structure"] +impl crate::Readable for DX2CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx2cr::W](W) writer structure"] +impl crate::Writable for DX2CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX2CR to value 0"] +impl crate::Resettable for DX2CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx3cr.rs b/src/usic0_ch0/dx3cr.rs index 50fef0c5..3d50d635 100644 --- a/src/usic0_ch0/dx3cr.rs +++ b/src/usic0_ch0/dx3cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX3CR"] -pub type R = crate::R; -#[doc = "Writer for register DX3CR"] -pub type W = crate::W; -#[doc = "Register DX3CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX3CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX3CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX3CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DXnA is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -183,15 +218,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -258,15 +301,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 + } +} +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DFEN`"] +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -333,15 +384,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 + } +} +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEN`"] +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -408,15 +467,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 } } -#[doc = "Write proxy for field `DPOL`"] +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -483,15 +550,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -549,9 +621,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -566,25 +641,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -592,9 +674,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -619,7 +699,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -637,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -651,12 +734,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -737,4 +827,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 3\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 [dx3cr](index.html) module"] +pub struct DX3CR_SPEC; +impl crate::RegisterSpec for DX3CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx3cr::R](R) reader structure"] +impl crate::Readable for DX3CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx3cr::W](W) writer structure"] +impl crate::Writable for DX3CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX3CR to value 0"] +impl crate::Resettable for DX3CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx4cr.rs b/src/usic0_ch0/dx4cr.rs index 8358db3e..4c773862 100644 --- a/src/usic0_ch0/dx4cr.rs +++ b/src/usic0_ch0/dx4cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX4CR"] -pub type R = crate::R; -#[doc = "Writer for register DX4CR"] -pub type W = crate::W; -#[doc = "Register DX4CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX4CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX4CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX4CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DXnA is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -183,15 +218,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -258,15 +301,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 + } +} +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DFEN`"] +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -333,15 +384,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 + } +} +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEN`"] +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -408,15 +467,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 } } -#[doc = "Write proxy for field `DPOL`"] +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -483,15 +550,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -549,9 +621,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -566,25 +641,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -592,9 +674,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -619,7 +699,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -637,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -651,12 +734,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -737,4 +827,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 4\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 [dx4cr](index.html) module"] +pub struct DX4CR_SPEC; +impl crate::RegisterSpec for DX4CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx4cr::R](R) reader structure"] +impl crate::Readable for DX4CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx4cr::W](W) writer structure"] +impl crate::Writable for DX4CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX4CR to value 0"] +impl crate::Resettable for DX4CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/dx5cr.rs b/src/usic0_ch0/dx5cr.rs index 3d444c3f..addf01bd 100644 --- a/src/usic0_ch0/dx5cr.rs +++ b/src/usic0_ch0/dx5cr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register DX5CR"] -pub type R = crate::R; -#[doc = "Writer for register DX5CR"] -pub type W = crate::W; -#[doc = "Register DX5CR `reset()`'s with value 0"] -impl crate::ResetValue for super::DX5CR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `DX5CR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DX5CR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] @@ -37,9 +61,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSEL`"] -pub type DSEL_R = crate::R; +#[doc = "Field `DSEL` reader - Data Selection for Input Signal"] +pub struct DSEL_R(crate::FieldReader); impl DSEL_R { + pub(crate) fn new(bits: u8) -> Self { + DSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEL_A { @@ -58,45 +85,52 @@ impl DSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEL_A::VALUE1 + **self == DSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEL_A::VALUE2 + **self == DSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSEL_A::VALUE3 + **self == DSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSEL_A::VALUE4 + **self == DSEL_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == DSEL_A::VALUE5 + **self == DSEL_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == DSEL_A::VALUE6 + **self == DSEL_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == DSEL_A::VALUE7 + **self == DSEL_A::VALUE7 } #[doc = "Checks if the value of the field is `VALUE8`"] #[inline(always)] pub fn is_value8(&self) -> bool { - *self == DSEL_A::VALUE8 + **self == DSEL_A::VALUE8 } } -#[doc = "Write proxy for field `DSEL`"] +impl core::ops::Deref for DSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSEL` writer - Data Selection for Input Signal"] pub struct DSEL_W<'a> { w: &'a mut W, } @@ -104,9 +138,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The data input DXnA is selected."] #[inline(always)] @@ -151,7 +183,7 @@ impl<'a> DSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } @@ -169,9 +201,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `INSW`"] -pub type INSW_R = crate::R; +#[doc = "Field `INSW` reader - Input Switch"] +pub struct INSW_R(crate::FieldReader); impl INSW_R { + pub(crate) fn new(bits: bool) -> Self { + INSW_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> INSW_A { @@ -183,15 +218,22 @@ impl INSW_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == INSW_A::VALUE1 + **self == INSW_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == INSW_A::VALUE2 + **self == INSW_A::VALUE2 } } -#[doc = "Write proxy for field `INSW`"] +impl core::ops::Deref for INSW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INSW` writer - Input Switch"] pub struct INSW_W<'a> { w: &'a mut W, } @@ -199,9 +241,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: INSW_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] @@ -226,7 +266,7 @@ impl<'a> INSW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -244,9 +284,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DFEN`"] -pub type DFEN_R = crate::R; +#[doc = "Field `DFEN` reader - Digital Filter Enable"] +pub struct DFEN_R(crate::FieldReader); impl DFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DFEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DFEN_A { @@ -258,15 +301,22 @@ impl DFEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DFEN_A::VALUE1 + **self == DFEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DFEN_A::VALUE2 + **self == DFEN_A::VALUE2 + } +} +impl core::ops::Deref for DFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DFEN`"] +#[doc = "Field `DFEN` writer - Digital Filter Enable"] pub struct DFEN_W<'a> { w: &'a mut W, } @@ -274,9 +324,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DFEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not digitally filtered."] #[inline(always)] @@ -301,7 +349,7 @@ impl<'a> DFEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -319,9 +367,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DSEN`"] -pub type DSEN_R = crate::R; +#[doc = "Field `DSEN` reader - Data Synchronization Enable"] +pub struct DSEN_R(crate::FieldReader); impl DSEN_R { + pub(crate) fn new(bits: bool) -> Self { + DSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DSEN_A { @@ -333,15 +384,22 @@ impl DSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSEN_A::VALUE1 + **self == DSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DSEN_A::VALUE2 + **self == DSEN_A::VALUE2 + } +} +impl core::ops::Deref for DSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DSEN`"] +#[doc = "Field `DSEN` writer - Data Synchronization Enable"] pub struct DSEN_W<'a> { w: &'a mut W, } @@ -349,9 +407,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] @@ -376,7 +432,7 @@ impl<'a> DSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -394,9 +450,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPOL`"] -pub type DPOL_R = crate::R; +#[doc = "Field `DPOL` reader - Data Polarity for DXn"] +pub struct DPOL_R(crate::FieldReader); impl DPOL_R { + pub(crate) fn new(bits: bool) -> Self { + DPOL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPOL_A { @@ -408,15 +467,22 @@ impl DPOL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPOL_A::VALUE1 + **self == DPOL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPOL_A::VALUE2 + **self == DPOL_A::VALUE2 } } -#[doc = "Write proxy for field `DPOL`"] +impl core::ops::Deref for DPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPOL` writer - Data Polarity for DXn"] pub struct DPOL_W<'a> { w: &'a mut W, } @@ -424,9 +490,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPOL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The input signal is not inverted."] #[inline(always)] @@ -451,7 +515,7 @@ impl<'a> DPOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -469,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SFSEL`"] -pub type SFSEL_R = crate::R; +#[doc = "Field `SFSEL` reader - Sampling Frequency Selection"] +pub struct SFSEL_R(crate::FieldReader); impl SFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SFSEL_A { @@ -483,15 +550,22 @@ impl SFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SFSEL_A::VALUE1 + **self == SFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SFSEL_A::VALUE2 + **self == SFSEL_A::VALUE2 + } +} +impl core::ops::Deref for SFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SFSEL`"] +#[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] pub struct SFSEL_W<'a> { w: &'a mut W, } @@ -499,9 +573,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The sampling frequency is fPB."] #[inline(always)] @@ -526,7 +598,7 @@ impl<'a> SFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -549,9 +621,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CM`"] -pub type CM_R = crate::R; +#[doc = "Field `CM` reader - Combination Mode"] +pub struct CM_R(crate::FieldReader); impl CM_R { + pub(crate) fn new(bits: u8) -> Self { + CM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CM_A { @@ -566,25 +641,32 @@ impl CM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CM_A::VALUE1 + **self == CM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CM_A::VALUE2 + **self == CM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CM_A::VALUE3 + **self == CM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CM_A::VALUE4 + **self == CM_A::VALUE4 } } -#[doc = "Write proxy for field `CM`"] +impl core::ops::Deref for CM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CM` writer - Combination Mode"] pub struct CM_W<'a> { w: &'a mut W, } @@ -592,9 +674,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The trigger activation is disabled."] #[inline(always)] @@ -619,7 +699,7 @@ impl<'a> CM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -637,9 +717,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DXS`"] -pub type DXS_R = crate::R; +#[doc = "Field `DXS` reader - Synchronized Data Value"] +pub struct DXS_R(crate::FieldReader); impl DXS_R { + pub(crate) fn new(bits: bool) -> Self { + DXS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DXS_A { @@ -651,12 +734,19 @@ impl DXS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DXS_A::VALUE1 + **self == DXS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DXS_A::VALUE2 + **self == DXS_A::VALUE2 + } +} +impl core::ops::Deref for DXS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -737,4 +827,30 @@ impl W { pub fn cm(&mut self) -> CM_W { CM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Control Register 5\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 [dx5cr](index.html) module"] +pub struct DX5CR_SPEC; +impl crate::RegisterSpec for DX5CR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dx5cr::R](R) reader structure"] +impl crate::Readable for DX5CR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dx5cr::W](W) writer structure"] +impl crate::Writable for DX5CR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DX5CR to value 0"] +impl crate::Resettable for DX5CR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/fdr.rs b/src/usic0_ch0/fdr.rs index d84fe719..aa52e101 100644 --- a/src/usic0_ch0/fdr.rs +++ b/src/usic0_ch0/fdr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register FDR"] -pub type R = crate::R; -#[doc = "Writer for register FDR"] -pub type W = crate::W; -#[doc = "Register FDR `reset()`'s with value 0"] -impl crate::ResetValue for super::FDR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `FDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FDR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `STEP` reader - Step Value"] +pub struct STEP_R(crate::FieldReader); +impl STEP_R { + pub(crate) fn new(bits: u16) -> Self { + STEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `STEP`"] -pub type STEP_R = crate::R; -#[doc = "Write proxy for field `STEP`"] +#[doc = "Field `STEP` writer - Step Value"] pub struct STEP_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> STEP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff); + self.w.bits = (self.w.bits & !0x03ff) | (value as u32 & 0x03ff); self.w } } @@ -43,9 +79,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DM`"] -pub type DM_R = crate::R; +#[doc = "Field `DM` reader - Divider Mode"] +pub struct DM_R(crate::FieldReader); impl DM_R { + pub(crate) fn new(bits: u8) -> Self { + DM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DM_A { @@ -60,25 +99,32 @@ impl DM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DM_A::VALUE1 + **self == DM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DM_A::VALUE2 + **self == DM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DM_A::VALUE3 + **self == DM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DM_A::VALUE4 + **self == DM_A::VALUE4 } } -#[doc = "Write proxy for field `DM`"] +impl core::ops::Deref for DM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DM` writer - Divider Mode"] pub struct DM_W<'a> { w: &'a mut W, } @@ -86,9 +132,7 @@ impl<'a> DM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The divider is switched off, fFD = 0."] #[inline(always)] @@ -113,12 +157,24 @@ impl<'a> DM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); + self.w.bits = (self.w.bits & !(0x03 << 14)) | ((value as u32 & 0x03) << 14); self.w } } -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; +#[doc = "Field `RESULT` reader - Result Value"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:9 - Step Value"] #[inline(always)] @@ -147,4 +203,30 @@ impl W { pub fn dm(&mut self) -> DM_W { DM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Fractional Divider Register\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 [fdr](index.html) module"] +pub struct FDR_SPEC; +impl crate::RegisterSpec for FDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fdr::R](R) reader structure"] +impl crate::Readable for FDR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fdr::W](W) writer structure"] +impl crate::Writable for FDR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FDR to value 0"] +impl crate::Resettable for FDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/fmr.rs b/src/usic0_ch0/fmr.rs index 1ac7864d..7e308229 100644 --- a/src/usic0_ch0/fmr.rs +++ b/src/usic0_ch0/fmr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register FMR"] -pub type W = crate::W; -#[doc = "Register FMR `reset()`'s with value 0"] -impl crate::ResetValue for super::FMR { - type Type = u32; +#[doc = "Register `FMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Modify Transmit Data Valid\n\nValue on reset: 0"] @@ -25,7 +36,7 @@ impl From for u8 { variant as _ } } -#[doc = "Write proxy for field `MTDV`"] +#[doc = "Field `MTDV` writer - Modify Transmit Data Valid"] pub struct MTDV_W<'a> { w: &'a mut W, } @@ -53,7 +64,7 @@ impl<'a> MTDV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -71,7 +82,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ATVC`"] +#[doc = "Field `ATVC` writer - Activate Bit TVC"] pub struct ATVC_W<'a> { w: &'a mut W, } @@ -79,9 +90,7 @@ impl<'a> ATVC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ATVC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -106,7 +115,7 @@ impl<'a> ATVC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -124,7 +133,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CRDV0`"] +#[doc = "Field `CRDV0` writer - Clear Bits RDV for RBUF0"] pub struct CRDV0_W<'a> { w: &'a mut W, } @@ -132,9 +141,7 @@ impl<'a> CRDV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRDV0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -159,7 +166,7 @@ impl<'a> CRDV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -177,7 +184,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CRDV1`"] +#[doc = "Field `CRDV1` writer - Clear Bit RDV for RBUF1"] pub struct CRDV1_W<'a> { w: &'a mut W, } @@ -185,9 +192,7 @@ impl<'a> CRDV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRDV1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -212,7 +217,7 @@ impl<'a> CRDV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -230,7 +235,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO0`"] +#[doc = "Field `SIO0` writer - Set Interrupt Output SRx"] pub struct SIO0_W<'a> { w: &'a mut W, } @@ -238,9 +243,7 @@ impl<'a> SIO0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -265,7 +268,7 @@ impl<'a> SIO0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -283,7 +286,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO1`"] +#[doc = "Field `SIO1` writer - Set Interrupt Output SRx"] pub struct SIO1_W<'a> { w: &'a mut W, } @@ -291,9 +294,7 @@ impl<'a> SIO1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -318,7 +319,7 @@ impl<'a> SIO1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -336,7 +337,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO2`"] +#[doc = "Field `SIO2` writer - Set Interrupt Output SRx"] pub struct SIO2_W<'a> { w: &'a mut W, } @@ -344,9 +345,7 @@ impl<'a> SIO2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -371,7 +370,7 @@ impl<'a> SIO2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -389,7 +388,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO3`"] +#[doc = "Field `SIO3` writer - Set Interrupt Output SRx"] pub struct SIO3_W<'a> { w: &'a mut W, } @@ -397,9 +396,7 @@ impl<'a> SIO3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -424,7 +421,7 @@ impl<'a> SIO3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -442,7 +439,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO4`"] +#[doc = "Field `SIO4` writer - Set Interrupt Output SRx"] pub struct SIO4_W<'a> { w: &'a mut W, } @@ -450,9 +447,7 @@ impl<'a> SIO4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -477,7 +472,7 @@ impl<'a> SIO4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -495,7 +490,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SIO5`"] +#[doc = "Field `SIO5` writer - Set Interrupt Output SRx"] pub struct SIO5_W<'a> { w: &'a mut W, } @@ -503,9 +498,7 @@ impl<'a> SIO5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIO5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action."] #[inline(always)] @@ -530,7 +523,7 @@ impl<'a> SIO5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -585,4 +578,26 @@ impl W { pub fn sio5(&mut self) -> SIO5_W { SIO5_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Flag Modification Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fmr](index.html) module"] +pub struct FMR_SPEC; +impl crate::RegisterSpec for FMR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [fmr::W](W) writer structure"] +impl crate::Writable for FMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FMR to value 0"] +impl crate::Resettable for FMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/in_.rs b/src/usic0_ch0/in_.rs index e281d533..f3c3ff02 100644 --- a/src/usic0_ch0/in_.rs +++ b/src/usic0_ch0/in_.rs @@ -1,15 +1,25 @@ -#[doc = "Writer for register IN[%s]"] -pub type W = crate::W; -#[doc = "Register IN[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::IN { - type Type = u32; +#[doc = "Register `IN[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `TDATA`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TDATA` writer - Transmit Data"] pub struct TDATA_W<'a> { w: &'a mut W, } @@ -17,7 +27,7 @@ impl<'a> TDATA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -27,4 +37,27 @@ impl W { pub fn tdata(&mut self) -> TDATA_W { TDATA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit FIFO Buffer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [in_::W](W) writer structure"] +impl crate::Writable for IN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IN[%s] +to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/inpr.rs b/src/usic0_ch0/inpr.rs index e5f93609..953c8b7f 100644 --- a/src/usic0_ch0/inpr.rs +++ b/src/usic0_ch0/inpr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register INPR"] -pub type R = crate::R; -#[doc = "Writer for register INPR"] -pub type W = crate::W; -#[doc = "Register INPR `reset()`'s with value 0"] -impl crate::ResetValue for super::INPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `INPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Transmit Shift Interrupt Node Pointer\n\nValue on reset: 0"] @@ -33,55 +57,64 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TSINP`"] -pub type TSINP_R = crate::R; +#[doc = "Field `TSINP` reader - Transmit Shift Interrupt Node Pointer"] +pub struct TSINP_R(crate::FieldReader); impl TSINP_R { + pub(crate) fn new(bits: u8) -> Self { + TSINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TSINP_A::VALUE1), - 1 => Val(TSINP_A::VALUE2), - 2 => Val(TSINP_A::VALUE3), - 3 => Val(TSINP_A::VALUE4), - 4 => Val(TSINP_A::VALUE5), - 5 => Val(TSINP_A::VALUE6), - i => Res(i), + 0 => Some(TSINP_A::VALUE1), + 1 => Some(TSINP_A::VALUE2), + 2 => Some(TSINP_A::VALUE3), + 3 => Some(TSINP_A::VALUE4), + 4 => Some(TSINP_A::VALUE5), + 5 => Some(TSINP_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSINP_A::VALUE1 + **self == TSINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSINP_A::VALUE2 + **self == TSINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TSINP_A::VALUE3 + **self == TSINP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TSINP_A::VALUE4 + **self == TSINP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == TSINP_A::VALUE5 + **self == TSINP_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == TSINP_A::VALUE6 + **self == TSINP_A::VALUE6 + } +} +impl core::ops::Deref for TSINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSINP`"] +#[doc = "Field `TSINP` writer - Transmit Shift Interrupt Node Pointer"] pub struct TSINP_W<'a> { w: &'a mut W, } @@ -124,13 +157,25 @@ impl<'a> TSINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `TBINP`"] -pub type TBINP_R = crate::R; -#[doc = "Write proxy for field `TBINP`"] +#[doc = "Field `TBINP` reader - Transmit Buffer Interrupt Node Pointer"] +pub struct TBINP_R(crate::FieldReader); +impl TBINP_R { + pub(crate) fn new(bits: u8) -> Self { + TBINP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TBINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBINP` writer - Transmit Buffer Interrupt Node Pointer"] pub struct TBINP_W<'a> { w: &'a mut W, } @@ -138,13 +183,25 @@ impl<'a> TBINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4); + self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4); self.w } } -#[doc = "Reader of field `RINP`"] -pub type RINP_R = crate::R; -#[doc = "Write proxy for field `RINP`"] +#[doc = "Field `RINP` reader - Receive Interrupt Node Pointer"] +pub struct RINP_R(crate::FieldReader); +impl RINP_R { + pub(crate) fn new(bits: u8) -> Self { + RINP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RINP` writer - Receive Interrupt Node Pointer"] pub struct RINP_W<'a> { w: &'a mut W, } @@ -152,13 +209,25 @@ impl<'a> RINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `AINP`"] -pub type AINP_R = crate::R; -#[doc = "Write proxy for field `AINP`"] +#[doc = "Field `AINP` reader - Alternative Receive Interrupt Node Pointer"] +pub struct AINP_R(crate::FieldReader); +impl AINP_R { + pub(crate) fn new(bits: u8) -> Self { + AINP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AINP` writer - Alternative Receive Interrupt Node Pointer"] pub struct AINP_W<'a> { w: &'a mut W, } @@ -166,13 +235,25 @@ impl<'a> AINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12); + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); self.w } } -#[doc = "Reader of field `PINP`"] -pub type PINP_R = crate::R; -#[doc = "Write proxy for field `PINP`"] +#[doc = "Field `PINP` reader - Transmit Shift Interrupt Node Pointer"] +pub struct PINP_R(crate::FieldReader); +impl PINP_R { + pub(crate) fn new(bits: u8) -> Self { + PINP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PINP` writer - Transmit Shift Interrupt Node Pointer"] pub struct PINP_W<'a> { w: &'a mut W, } @@ -180,7 +261,7 @@ impl<'a> PINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -237,4 +318,30 @@ impl W { pub fn pinp(&mut self) -> PINP_W { PINP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Interrupt Node Pointer Register\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 [inpr](index.html) module"] +pub struct INPR_SPEC; +impl crate::RegisterSpec for INPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inpr::R](R) reader structure"] +impl crate::Readable for INPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inpr::W](W) writer structure"] +impl crate::Writable for INPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INPR to value 0"] +impl crate::Resettable for INPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/kscfg.rs b/src/usic0_ch0/kscfg.rs index 7e51e0a8..6283581a 100644 --- a/src/usic0_ch0/kscfg.rs +++ b/src/usic0_ch0/kscfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register KSCFG"] -pub type R = crate::R; -#[doc = "Writer for register KSCFG"] -pub type W = crate::W; -#[doc = "Register KSCFG `reset()`'s with value 0"] -impl crate::ResetValue for super::KSCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `KSCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `KSCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Module Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MODEN`"] -pub type MODEN_R = crate::R; +#[doc = "Field `MODEN` reader - Module Enable"] +pub struct MODEN_R(crate::FieldReader); impl MODEN_R { + pub(crate) fn new(bits: bool) -> Self { + MODEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MODEN_A { @@ -38,15 +65,22 @@ impl MODEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MODEN_A::VALUE1 + **self == MODEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MODEN_A::VALUE2 + **self == MODEN_A::VALUE2 + } +} +impl core::ops::Deref for MODEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MODEN`"] +#[doc = "Field `MODEN` writer - Module Enable"] pub struct MODEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> MODEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MODEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The module is switched off immediately (without respecting a stop condition). It does not react on mode control actions and the module clock is switched off. The module does not react on read accesses and ignores write accesses (except to KSCFG)."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> MODEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,7 +131,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BPMODEN`"] +#[doc = "Field `BPMODEN` writer - Bit Protection for MODEN"] pub struct BPMODEN_W<'a> { w: &'a mut W, } @@ -107,9 +139,7 @@ impl<'a> BPMODEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BPMODEN_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "MODEN is not changed."] #[inline(always)] @@ -134,7 +164,7 @@ impl<'a> BPMODEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -157,9 +187,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `NOMCFG`"] -pub type NOMCFG_R = crate::R; +#[doc = "Field `NOMCFG` reader - Normal Operation Mode Configuration"] +pub struct NOMCFG_R(crate::FieldReader); impl NOMCFG_R { + pub(crate) fn new(bits: u8) -> Self { + NOMCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NOMCFG_A { @@ -174,25 +207,32 @@ impl NOMCFG_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NOMCFG_A::VALUE1 + **self == NOMCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NOMCFG_A::VALUE2 + **self == NOMCFG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == NOMCFG_A::VALUE3 + **self == NOMCFG_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == NOMCFG_A::VALUE4 + **self == NOMCFG_A::VALUE4 } } -#[doc = "Write proxy for field `NOMCFG`"] +impl core::ops::Deref for NOMCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NOMCFG` writer - Normal Operation Mode Configuration"] pub struct NOMCFG_W<'a> { w: &'a mut W, } @@ -200,9 +240,7 @@ impl<'a> NOMCFG_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NOMCFG_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Run mode 0 is selected."] #[inline(always)] @@ -227,7 +265,7 @@ impl<'a> NOMCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -245,7 +283,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BPNOM`"] +#[doc = "Field `BPNOM` writer - Bit Protection for NOMCFG"] pub struct BPNOM_W<'a> { w: &'a mut W, } @@ -253,9 +291,7 @@ impl<'a> BPNOM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BPNOM_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "NOMCFG is not changed."] #[inline(always)] @@ -280,13 +316,25 @@ impl<'a> BPNOM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `SUMCFG`"] -pub type SUMCFG_R = crate::R; -#[doc = "Write proxy for field `SUMCFG`"] +#[doc = "Field `SUMCFG` reader - Suspend Mode Configuration"] +pub struct SUMCFG_R(crate::FieldReader); +impl SUMCFG_R { + pub(crate) fn new(bits: u8) -> Self { + SUMCFG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SUMCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUMCFG` writer - Suspend Mode Configuration"] pub struct SUMCFG_W<'a> { w: &'a mut W, } @@ -294,7 +342,7 @@ impl<'a> SUMCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -312,7 +360,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BPSUM`"] +#[doc = "Field `BPSUM` writer - Bit Protection for SUMCFG"] pub struct BPSUM_W<'a> { w: &'a mut W, } @@ -320,9 +368,7 @@ impl<'a> BPSUM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BPSUM_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "SUMCFG is not changed."] #[inline(always)] @@ -347,7 +393,7 @@ impl<'a> BPSUM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -399,4 +445,30 @@ impl W { pub fn bpsum(&mut self) -> BPSUM_W { BPSUM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Kernel State Configuration Register\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 [kscfg](index.html) module"] +pub struct KSCFG_SPEC; +impl crate::RegisterSpec for KSCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [kscfg::R](R) reader structure"] +impl crate::Readable for KSCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [kscfg::W](W) writer structure"] +impl crate::Writable for KSCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets KSCFG to value 0"] +impl crate::Resettable for KSCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/outdr.rs b/src/usic0_ch0/outdr.rs index 19f1845b..64e7fdac 100644 --- a/src/usic0_ch0/outdr.rs +++ b/src/usic0_ch0/outdr.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register OUTDR"] -pub type R = crate::R; -#[doc = "Reader of field `DSR`"] -pub type DSR_R = crate::R; -#[doc = "Reader of field `RCI`"] -pub type RCI_R = crate::R; +#[doc = "Register `OUTDR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR` reader - Data from Shift Register"] +pub struct DSR_R(crate::FieldReader); +impl DSR_R { + pub(crate) fn new(bits: u16) -> Self { + DSR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RCI` reader - Receive Control Information from Shift Register"] +pub struct RCI_R(crate::FieldReader); +impl RCI_R { + pub(crate) fn new(bits: u8) -> Self { + RCI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RCI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Data from Shift Register"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { RCI_R::new(((self.bits >> 16) & 0x1f) as u8) } } +#[doc = "Receiver Buffer Output Register L for Debugger\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outdr](index.html) module"] +pub struct OUTDR_SPEC; +impl crate::RegisterSpec for OUTDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [outdr::R](R) reader structure"] +impl crate::Readable for OUTDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets OUTDR to value 0"] +impl crate::Resettable for OUTDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/outr.rs b/src/usic0_ch0/outr.rs index 5b86ad10..dbb791a7 100644 --- a/src/usic0_ch0/outr.rs +++ b/src/usic0_ch0/outr.rs @@ -1,9 +1,46 @@ -#[doc = "Reader of register OUTR"] -pub type R = crate::R; -#[doc = "Reader of field `DSR`"] -pub type DSR_R = crate::R; -#[doc = "Reader of field `RCI`"] -pub type RCI_R = crate::R; +#[doc = "Register `OUTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR` reader - Received Data"] +pub struct DSR_R(crate::FieldReader); +impl DSR_R { + pub(crate) fn new(bits: u16) -> Self { + DSR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RCI` reader - Receiver Control Information"] +pub struct RCI_R(crate::FieldReader); +impl RCI_R { + pub(crate) fn new(bits: u8) -> Self { + RCI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RCI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Received Data"] #[inline(always)] @@ -16,3 +53,19 @@ impl R { RCI_R::new(((self.bits >> 16) & 0x1f) as u8) } } +#[doc = "Receiver Buffer Output Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outr](index.html) module"] +pub struct OUTR_SPEC; +impl crate::RegisterSpec for OUTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [outr::R](R) reader structure"] +impl crate::Readable for OUTR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets OUTR to value 0"] +impl crate::Resettable for OUTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/pcr.rs b/src/usic0_ch0/pcr.rs index 8030adcc..32b657bd 100644 --- a/src/usic0_ch0/pcr.rs +++ b/src/usic0_ch0/pcr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PCR"] -pub type R = crate::R; -#[doc = "Writer for register PCR"] -pub type W = crate::W; -#[doc = "Register PCR `reset()`'s with value 0"] -impl crate::ResetValue for super::PCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CTR0`"] -pub type CTR0_R = crate::R; -#[doc = "Write proxy for field `CTR0`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CTR0` reader - Protocol Control Bit 0"] +pub struct CTR0_R(crate::FieldReader); +impl CTR0_R { + pub(crate) fn new(bits: bool) -> Self { + CTR0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR0` writer - Protocol Control Bit 0"] pub struct CTR0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> CTR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `CTR1`"] -pub type CTR1_R = crate::R; -#[doc = "Write proxy for field `CTR1`"] +#[doc = "Field `CTR1` reader - Protocol Control Bit 1"] +pub struct CTR1_R(crate::FieldReader); +impl CTR1_R { + pub(crate) fn new(bits: bool) -> Self { + CTR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR1` writer - Protocol Control Bit 1"] pub struct CTR1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> CTR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `CTR2`"] -pub type CTR2_R = crate::R; -#[doc = "Write proxy for field `CTR2`"] +#[doc = "Field `CTR2` reader - Protocol Control Bit 2"] +pub struct CTR2_R(crate::FieldReader); +impl CTR2_R { + pub(crate) fn new(bits: bool) -> Self { + CTR2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR2` writer - Protocol Control Bit 2"] pub struct CTR2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> CTR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `CTR3`"] -pub type CTR3_R = crate::R; -#[doc = "Write proxy for field `CTR3`"] +#[doc = "Field `CTR3` reader - Protocol Control Bit 3"] +pub struct CTR3_R(crate::FieldReader); +impl CTR3_R { + pub(crate) fn new(bits: bool) -> Self { + CTR3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR3` writer - Protocol Control Bit 3"] pub struct CTR3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> CTR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `CTR4`"] -pub type CTR4_R = crate::R; -#[doc = "Write proxy for field `CTR4`"] +#[doc = "Field `CTR4` reader - Protocol Control Bit 4"] +pub struct CTR4_R(crate::FieldReader); +impl CTR4_R { + pub(crate) fn new(bits: bool) -> Self { + CTR4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR4` writer - Protocol Control Bit 4"] pub struct CTR4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> CTR4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `CTR5`"] -pub type CTR5_R = crate::R; -#[doc = "Write proxy for field `CTR5`"] +#[doc = "Field `CTR5` reader - Protocol Control Bit 5"] +pub struct CTR5_R(crate::FieldReader); +impl CTR5_R { + pub(crate) fn new(bits: bool) -> Self { + CTR5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR5` writer - Protocol Control Bit 5"] pub struct CTR5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> CTR5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `CTR6`"] -pub type CTR6_R = crate::R; -#[doc = "Write proxy for field `CTR6`"] +#[doc = "Field `CTR6` reader - Protocol Control Bit 6"] +pub struct CTR6_R(crate::FieldReader); +impl CTR6_R { + pub(crate) fn new(bits: bool) -> Self { + CTR6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR6` writer - Protocol Control Bit 6"] pub struct CTR6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> CTR6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `CTR7`"] -pub type CTR7_R = crate::R; -#[doc = "Write proxy for field `CTR7`"] +#[doc = "Field `CTR7` reader - Protocol Control Bit 7"] +pub struct CTR7_R(crate::FieldReader); +impl CTR7_R { + pub(crate) fn new(bits: bool) -> Self { + CTR7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR7` writer - Protocol Control Bit 7"] pub struct CTR7_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> CTR7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `CTR8`"] -pub type CTR8_R = crate::R; -#[doc = "Write proxy for field `CTR8`"] +#[doc = "Field `CTR8` reader - Protocol Control Bit 8"] +pub struct CTR8_R(crate::FieldReader); +impl CTR8_R { + pub(crate) fn new(bits: bool) -> Self { + CTR8_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR8` writer - Protocol Control Bit 8"] pub struct CTR8_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> CTR8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `CTR9`"] -pub type CTR9_R = crate::R; -#[doc = "Write proxy for field `CTR9`"] +#[doc = "Field `CTR9` reader - Protocol Control Bit 9"] +pub struct CTR9_R(crate::FieldReader); +impl CTR9_R { + pub(crate) fn new(bits: bool) -> Self { + CTR9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR9` writer - Protocol Control Bit 9"] pub struct CTR9_W<'a> { w: &'a mut W, } @@ -246,13 +390,25 @@ impl<'a> CTR9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } -#[doc = "Reader of field `CTR10`"] -pub type CTR10_R = crate::R; -#[doc = "Write proxy for field `CTR10`"] +#[doc = "Field `CTR10` reader - Protocol Control Bit 10"] +pub struct CTR10_R(crate::FieldReader); +impl CTR10_R { + pub(crate) fn new(bits: bool) -> Self { + CTR10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR10` writer - Protocol Control Bit 10"] pub struct CTR10_W<'a> { w: &'a mut W, } @@ -270,13 +426,25 @@ impl<'a> CTR10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } -#[doc = "Reader of field `CTR11`"] -pub type CTR11_R = crate::R; -#[doc = "Write proxy for field `CTR11`"] +#[doc = "Field `CTR11` reader - Protocol Control Bit 11"] +pub struct CTR11_R(crate::FieldReader); +impl CTR11_R { + pub(crate) fn new(bits: bool) -> Self { + CTR11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR11` writer - Protocol Control Bit 11"] pub struct CTR11_W<'a> { w: &'a mut W, } @@ -294,13 +462,25 @@ impl<'a> CTR11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } -#[doc = "Reader of field `CTR12`"] -pub type CTR12_R = crate::R; -#[doc = "Write proxy for field `CTR12`"] +#[doc = "Field `CTR12` reader - Protocol Control Bit 12"] +pub struct CTR12_R(crate::FieldReader); +impl CTR12_R { + pub(crate) fn new(bits: bool) -> Self { + CTR12_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR12` writer - Protocol Control Bit 12"] pub struct CTR12_W<'a> { w: &'a mut W, } @@ -318,13 +498,25 @@ impl<'a> CTR12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } -#[doc = "Reader of field `CTR13`"] -pub type CTR13_R = crate::R; -#[doc = "Write proxy for field `CTR13`"] +#[doc = "Field `CTR13` reader - Protocol Control Bit 13"] +pub struct CTR13_R(crate::FieldReader); +impl CTR13_R { + pub(crate) fn new(bits: bool) -> Self { + CTR13_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR13` writer - Protocol Control Bit 13"] pub struct CTR13_W<'a> { w: &'a mut W, } @@ -342,13 +534,25 @@ impl<'a> CTR13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } -#[doc = "Reader of field `CTR14`"] -pub type CTR14_R = crate::R; -#[doc = "Write proxy for field `CTR14`"] +#[doc = "Field `CTR14` reader - Protocol Control Bit 14"] +pub struct CTR14_R(crate::FieldReader); +impl CTR14_R { + pub(crate) fn new(bits: bool) -> Self { + CTR14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR14` writer - Protocol Control Bit 14"] pub struct CTR14_W<'a> { w: &'a mut W, } @@ -366,13 +570,25 @@ impl<'a> CTR14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } -#[doc = "Reader of field `CTR15`"] -pub type CTR15_R = crate::R; -#[doc = "Write proxy for field `CTR15`"] +#[doc = "Field `CTR15` reader - Protocol Control Bit 15"] +pub struct CTR15_R(crate::FieldReader); +impl CTR15_R { + pub(crate) fn new(bits: bool) -> Self { + CTR15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR15` writer - Protocol Control Bit 15"] pub struct CTR15_W<'a> { w: &'a mut W, } @@ -390,13 +606,25 @@ impl<'a> CTR15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `CTR16`"] -pub type CTR16_R = crate::R; -#[doc = "Write proxy for field `CTR16`"] +#[doc = "Field `CTR16` reader - Protocol Control Bit 16"] +pub struct CTR16_R(crate::FieldReader); +impl CTR16_R { + pub(crate) fn new(bits: bool) -> Self { + CTR16_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR16` writer - Protocol Control Bit 16"] pub struct CTR16_W<'a> { w: &'a mut W, } @@ -414,13 +642,25 @@ impl<'a> CTR16_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } -#[doc = "Reader of field `CTR17`"] -pub type CTR17_R = crate::R; -#[doc = "Write proxy for field `CTR17`"] +#[doc = "Field `CTR17` reader - Protocol Control Bit 17"] +pub struct CTR17_R(crate::FieldReader); +impl CTR17_R { + pub(crate) fn new(bits: bool) -> Self { + CTR17_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR17` writer - Protocol Control Bit 17"] pub struct CTR17_W<'a> { w: &'a mut W, } @@ -438,13 +678,25 @@ impl<'a> CTR17_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } -#[doc = "Reader of field `CTR18`"] -pub type CTR18_R = crate::R; -#[doc = "Write proxy for field `CTR18`"] +#[doc = "Field `CTR18` reader - Protocol Control Bit 18"] +pub struct CTR18_R(crate::FieldReader); +impl CTR18_R { + pub(crate) fn new(bits: bool) -> Self { + CTR18_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR18` writer - Protocol Control Bit 18"] pub struct CTR18_W<'a> { w: &'a mut W, } @@ -462,13 +714,25 @@ impl<'a> CTR18_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } -#[doc = "Reader of field `CTR19`"] -pub type CTR19_R = crate::R; -#[doc = "Write proxy for field `CTR19`"] +#[doc = "Field `CTR19` reader - Protocol Control Bit 19"] +pub struct CTR19_R(crate::FieldReader); +impl CTR19_R { + pub(crate) fn new(bits: bool) -> Self { + CTR19_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR19` writer - Protocol Control Bit 19"] pub struct CTR19_W<'a> { w: &'a mut W, } @@ -486,13 +750,25 @@ impl<'a> CTR19_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } -#[doc = "Reader of field `CTR20`"] -pub type CTR20_R = crate::R; -#[doc = "Write proxy for field `CTR20`"] +#[doc = "Field `CTR20` reader - Protocol Control Bit 20"] +pub struct CTR20_R(crate::FieldReader); +impl CTR20_R { + pub(crate) fn new(bits: bool) -> Self { + CTR20_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR20` writer - Protocol Control Bit 20"] pub struct CTR20_W<'a> { w: &'a mut W, } @@ -510,13 +786,25 @@ impl<'a> CTR20_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } -#[doc = "Reader of field `CTR21`"] -pub type CTR21_R = crate::R; -#[doc = "Write proxy for field `CTR21`"] +#[doc = "Field `CTR21` reader - Protocol Control Bit 21"] +pub struct CTR21_R(crate::FieldReader); +impl CTR21_R { + pub(crate) fn new(bits: bool) -> Self { + CTR21_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR21` writer - Protocol Control Bit 21"] pub struct CTR21_W<'a> { w: &'a mut W, } @@ -534,13 +822,25 @@ impl<'a> CTR21_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } -#[doc = "Reader of field `CTR22`"] -pub type CTR22_R = crate::R; -#[doc = "Write proxy for field `CTR22`"] +#[doc = "Field `CTR22` reader - Protocol Control Bit 22"] +pub struct CTR22_R(crate::FieldReader); +impl CTR22_R { + pub(crate) fn new(bits: bool) -> Self { + CTR22_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR22` writer - Protocol Control Bit 22"] pub struct CTR22_W<'a> { w: &'a mut W, } @@ -558,13 +858,25 @@ impl<'a> CTR22_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } -#[doc = "Reader of field `CTR23`"] -pub type CTR23_R = crate::R; -#[doc = "Write proxy for field `CTR23`"] +#[doc = "Field `CTR23` reader - Protocol Control Bit 23"] +pub struct CTR23_R(crate::FieldReader); +impl CTR23_R { + pub(crate) fn new(bits: bool) -> Self { + CTR23_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR23` writer - Protocol Control Bit 23"] pub struct CTR23_W<'a> { w: &'a mut W, } @@ -582,13 +894,25 @@ impl<'a> CTR23_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } -#[doc = "Reader of field `CTR24`"] -pub type CTR24_R = crate::R; -#[doc = "Write proxy for field `CTR24`"] +#[doc = "Field `CTR24` reader - Protocol Control Bit 24"] +pub struct CTR24_R(crate::FieldReader); +impl CTR24_R { + pub(crate) fn new(bits: bool) -> Self { + CTR24_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR24` writer - Protocol Control Bit 24"] pub struct CTR24_W<'a> { w: &'a mut W, } @@ -606,13 +930,25 @@ impl<'a> CTR24_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } -#[doc = "Reader of field `CTR25`"] -pub type CTR25_R = crate::R; -#[doc = "Write proxy for field `CTR25`"] +#[doc = "Field `CTR25` reader - Protocol Control Bit 25"] +pub struct CTR25_R(crate::FieldReader); +impl CTR25_R { + pub(crate) fn new(bits: bool) -> Self { + CTR25_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR25` writer - Protocol Control Bit 25"] pub struct CTR25_W<'a> { w: &'a mut W, } @@ -630,13 +966,25 @@ impl<'a> CTR25_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Reader of field `CTR26`"] -pub type CTR26_R = crate::R; -#[doc = "Write proxy for field `CTR26`"] +#[doc = "Field `CTR26` reader - Protocol Control Bit 26"] +pub struct CTR26_R(crate::FieldReader); +impl CTR26_R { + pub(crate) fn new(bits: bool) -> Self { + CTR26_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR26` writer - Protocol Control Bit 26"] pub struct CTR26_W<'a> { w: &'a mut W, } @@ -654,13 +1002,25 @@ impl<'a> CTR26_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } -#[doc = "Reader of field `CTR27`"] -pub type CTR27_R = crate::R; -#[doc = "Write proxy for field `CTR27`"] +#[doc = "Field `CTR27` reader - Protocol Control Bit 27"] +pub struct CTR27_R(crate::FieldReader); +impl CTR27_R { + pub(crate) fn new(bits: bool) -> Self { + CTR27_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR27` writer - Protocol Control Bit 27"] pub struct CTR27_W<'a> { w: &'a mut W, } @@ -678,13 +1038,25 @@ impl<'a> CTR27_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } -#[doc = "Reader of field `CTR28`"] -pub type CTR28_R = crate::R; -#[doc = "Write proxy for field `CTR28`"] +#[doc = "Field `CTR28` reader - Protocol Control Bit 28"] +pub struct CTR28_R(crate::FieldReader); +impl CTR28_R { + pub(crate) fn new(bits: bool) -> Self { + CTR28_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR28` writer - Protocol Control Bit 28"] pub struct CTR28_W<'a> { w: &'a mut W, } @@ -702,13 +1074,25 @@ impl<'a> CTR28_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } -#[doc = "Reader of field `CTR29`"] -pub type CTR29_R = crate::R; -#[doc = "Write proxy for field `CTR29`"] +#[doc = "Field `CTR29` reader - Protocol Control Bit 29"] +pub struct CTR29_R(crate::FieldReader); +impl CTR29_R { + pub(crate) fn new(bits: bool) -> Self { + CTR29_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR29` writer - Protocol Control Bit 29"] pub struct CTR29_W<'a> { w: &'a mut W, } @@ -726,13 +1110,25 @@ impl<'a> CTR29_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } -#[doc = "Reader of field `CTR30`"] -pub type CTR30_R = crate::R; -#[doc = "Write proxy for field `CTR30`"] +#[doc = "Field `CTR30` reader - Protocol Control Bit 30"] +pub struct CTR30_R(crate::FieldReader); +impl CTR30_R { + pub(crate) fn new(bits: bool) -> Self { + CTR30_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR30` writer - Protocol Control Bit 30"] pub struct CTR30_W<'a> { w: &'a mut W, } @@ -750,13 +1146,25 @@ impl<'a> CTR30_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } -#[doc = "Reader of field `CTR31`"] -pub type CTR31_R = crate::R; -#[doc = "Write proxy for field `CTR31`"] +#[doc = "Field `CTR31` reader - Protocol Control Bit 31"] +pub struct CTR31_R(crate::FieldReader); +impl CTR31_R { + pub(crate) fn new(bits: bool) -> Self { + CTR31_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTR31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTR31` writer - Protocol Control Bit 31"] pub struct CTR31_W<'a> { w: &'a mut W, } @@ -774,7 +1182,7 @@ impl<'a> CTR31_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1101,4 +1509,30 @@ impl W { pub fn ctr31(&mut self) -> CTR31_W { CTR31_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Control Register\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 [pcr](index.html) module"] +pub struct PCR_SPEC; +impl crate::RegisterSpec for PCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcr::R](R) reader structure"] +impl crate::Readable for PCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcr::W](W) writer structure"] +impl crate::Writable for PCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCR to value 0"] +impl crate::Resettable for PCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/pcr_ascmode.rs b/src/usic0_ch0/pcr_ascmode.rs index 228fdce2..3b1e6b56 100644 --- a/src/usic0_ch0/pcr_ascmode.rs +++ b/src/usic0_ch0/pcr_ascmode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PCR_ASCMode"] -pub type R = crate::R; -#[doc = "Writer for register PCR_ASCMode"] -pub type W = crate::W; -#[doc = "Register PCR_ASCMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PCR_ASCMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCR_ASCMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCR_ASCMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Sample Mode\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SMD`"] -pub type SMD_R = crate::R; +#[doc = "Field `SMD` reader - Sample Mode"] +pub struct SMD_R(crate::FieldReader); impl SMD_R { + pub(crate) fn new(bits: bool) -> Self { + SMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SMD_A { @@ -38,15 +65,22 @@ impl SMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SMD_A::VALUE1 + **self == SMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SMD_A::VALUE2 + **self == SMD_A::VALUE2 } } -#[doc = "Write proxy for field `SMD`"] +impl core::ops::Deref for SMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SMD` writer - Sample Mode"] pub struct SMD_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Only one sample is taken per bit time. The current input value is sampled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STPB`"] -pub type STPB_R = crate::R; +#[doc = "Field `STPB` reader - Stop Bits"] +pub struct STPB_R(crate::FieldReader); impl STPB_R { + pub(crate) fn new(bits: bool) -> Self { + STPB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STPB_A { @@ -113,15 +148,22 @@ impl STPB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STPB_A::VALUE1 + **self == STPB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STPB_A::VALUE2 + **self == STPB_A::VALUE2 + } +} +impl core::ops::Deref for STPB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STPB`"] +#[doc = "Field `STPB` writer - Stop Bits"] pub struct STPB_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> STPB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STPB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The number of stop bits is 1."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> STPB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `IDM`"] -pub type IDM_R = crate::R; +#[doc = "Field `IDM` reader - Idle Detection Mode"] +pub struct IDM_R(crate::FieldReader); impl IDM_R { + pub(crate) fn new(bits: bool) -> Self { + IDM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> IDM_A { @@ -188,15 +231,22 @@ impl IDM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == IDM_A::VALUE1 + **self == IDM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == IDM_A::VALUE2 + **self == IDM_A::VALUE2 + } +} +impl core::ops::Deref for IDM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `IDM`"] +#[doc = "Field `IDM` writer - Idle Detection Mode"] pub struct IDM_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> IDM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: IDM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The bus idle detection is switched off and bits PSR.TXIDLE and PSR.RXIDLE are set automatically to enable data transfers without checking the inputs before."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> IDM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SBIEN`"] -pub type SBIEN_R = crate::R; +#[doc = "Field `SBIEN` reader - Synchronization Break Interrupt Enable"] +pub struct SBIEN_R(crate::FieldReader); impl SBIEN_R { + pub(crate) fn new(bits: bool) -> Self { + SBIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SBIEN_A { @@ -263,15 +314,22 @@ impl SBIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SBIEN_A::VALUE1 + **self == SBIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SBIEN_A::VALUE2 + **self == SBIEN_A::VALUE2 + } +} +impl core::ops::Deref for SBIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SBIEN`"] +#[doc = "Field `SBIEN` writer - Synchronization Break Interrupt Enable"] pub struct SBIEN_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> SBIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SBIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The interrupt generation is disabled."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> SBIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CDEN`"] -pub type CDEN_R = crate::R; +#[doc = "Field `CDEN` reader - Collision Detection Enable"] +pub struct CDEN_R(crate::FieldReader); impl CDEN_R { + pub(crate) fn new(bits: bool) -> Self { + CDEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CDEN_A { @@ -338,15 +397,22 @@ impl CDEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CDEN_A::VALUE1 + **self == CDEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CDEN_A::VALUE2 + **self == CDEN_A::VALUE2 + } +} +impl core::ops::Deref for CDEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CDEN`"] +#[doc = "Field `CDEN` writer - Collision Detection Enable"] pub struct CDEN_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CDEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CDEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The collision detection is disabled."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CDEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RNIEN`"] -pub type RNIEN_R = crate::R; +#[doc = "Field `RNIEN` reader - Receiver Noise Detection Interrupt Enable"] +pub struct RNIEN_R(crate::FieldReader); impl RNIEN_R { + pub(crate) fn new(bits: bool) -> Self { + RNIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RNIEN_A { @@ -413,15 +480,22 @@ impl RNIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RNIEN_A::VALUE1 + **self == RNIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RNIEN_A::VALUE2 + **self == RNIEN_A::VALUE2 } } -#[doc = "Write proxy for field `RNIEN`"] +impl core::ops::Deref for RNIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RNIEN` writer - Receiver Noise Detection Interrupt Enable"] pub struct RNIEN_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> RNIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RNIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The interrupt generation is disabled."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> RNIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FEIEN`"] -pub type FEIEN_R = crate::R; +#[doc = "Field `FEIEN` reader - Format Error Interrupt Enable"] +pub struct FEIEN_R(crate::FieldReader); impl FEIEN_R { + pub(crate) fn new(bits: bool) -> Self { + FEIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FEIEN_A { @@ -488,15 +563,22 @@ impl FEIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FEIEN_A::VALUE1 + **self == FEIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FEIEN_A::VALUE2 + **self == FEIEN_A::VALUE2 + } +} +impl core::ops::Deref for FEIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FEIEN`"] +#[doc = "Field `FEIEN` writer - Format Error Interrupt Enable"] pub struct FEIEN_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> FEIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FEIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The interrupt generation is disabled."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> FEIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FFIEN`"] -pub type FFIEN_R = crate::R; +#[doc = "Field `FFIEN` reader - Frame Finished Interrupt Enable"] +pub struct FFIEN_R(crate::FieldReader); impl FFIEN_R { + pub(crate) fn new(bits: bool) -> Self { + FFIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FFIEN_A { @@ -563,15 +646,22 @@ impl FFIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FFIEN_A::VALUE1 + **self == FFIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FFIEN_A::VALUE2 + **self == FFIEN_A::VALUE2 } } -#[doc = "Write proxy for field `FFIEN`"] +impl core::ops::Deref for FFIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FFIEN` writer - Frame Finished Interrupt Enable"] pub struct FFIEN_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> FFIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FFIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The interrupt generation is disabled."] #[inline(always)] @@ -606,13 +694,25 @@ impl<'a> FFIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `SP`"] -pub type SP_R = crate::R; -#[doc = "Write proxy for field `SP`"] +#[doc = "Field `SP` reader - Sample Point"] +pub struct SP_R(crate::FieldReader); +impl SP_R { + pub(crate) fn new(bits: u8) -> Self { + SP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SP` writer - Sample Point"] pub struct SP_W<'a> { w: &'a mut W, } @@ -620,7 +720,7 @@ impl<'a> SP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 8)) | (((value as u32) & 0x1f) << 8); + self.w.bits = (self.w.bits & !(0x1f << 8)) | ((value as u32 & 0x1f) << 8); self.w } } @@ -643,43 +743,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PL`"] -pub type PL_R = crate::R; +#[doc = "Field `PL` reader - Pulse Length"] +pub struct PL_R(crate::FieldReader); impl PL_R { + pub(crate) fn new(bits: u8) -> Self { + PL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PL_A::VALUE1), - 1 => Val(PL_A::VALUE2), - 2 => Val(PL_A::VALUE3), - 7 => Val(PL_A::VALUE4), - i => Res(i), + 0 => Some(PL_A::VALUE1), + 1 => Some(PL_A::VALUE2), + 2 => Some(PL_A::VALUE3), + 7 => Some(PL_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PL_A::VALUE1 + **self == PL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PL_A::VALUE2 + **self == PL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == PL_A::VALUE3 + **self == PL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == PL_A::VALUE4 + **self == PL_A::VALUE4 } } -#[doc = "Write proxy for field `PL`"] +impl core::ops::Deref for PL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PL` writer - Pulse Length"] pub struct PL_W<'a> { w: &'a mut W, } @@ -712,7 +821,7 @@ impl<'a> PL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 13)) | (((value as u32) & 0x07) << 13); + self.w.bits = (self.w.bits & !(0x07 << 13)) | ((value as u32 & 0x07) << 13); self.w } } @@ -732,9 +841,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSTEN`"] -pub type RSTEN_R = crate::R; +#[doc = "Field `RSTEN` reader - Receiver Status Enable"] +pub struct RSTEN_R(crate::FieldReader); impl RSTEN_R { + pub(crate) fn new(bits: bool) -> Self { + RSTEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSTEN_A { @@ -746,15 +858,22 @@ impl RSTEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSTEN_A::VALUE1 + **self == RSTEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSTEN_A::VALUE2 + **self == RSTEN_A::VALUE2 } } -#[doc = "Write proxy for field `RSTEN`"] +impl core::ops::Deref for RSTEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSTEN` writer - Receiver Status Enable"] pub struct RSTEN_W<'a> { w: &'a mut W, } @@ -762,9 +881,7 @@ impl<'a> RSTEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSTEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag PSR\\[9\\] is not modified depending on the receiver status."] @@ -791,7 +908,7 @@ is set during the complete reception of a frame."] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -811,9 +928,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSTEN`"] -pub type TSTEN_R = crate::R; +#[doc = "Field `TSTEN` reader - Transmitter Status Enable"] +pub struct TSTEN_R(crate::FieldReader); impl TSTEN_R { + pub(crate) fn new(bits: bool) -> Self { + TSTEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSTEN_A { @@ -825,15 +945,22 @@ impl TSTEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSTEN_A::VALUE1 + **self == TSTEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSTEN_A::VALUE2 + **self == TSTEN_A::VALUE2 + } +} +impl core::ops::Deref for TSTEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSTEN`"] +#[doc = "Field `TSTEN` writer - Transmitter Status Enable"] pub struct TSTEN_W<'a> { w: &'a mut W, } @@ -841,9 +968,7 @@ impl<'a> TSTEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSTEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Flag PSR\\[9\\] is not modified depending on the transmitter status."] @@ -870,7 +995,7 @@ is set during the complete transmission of a frame."] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -888,9 +1013,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCLK`"] -pub type MCLK_R = crate::R; +#[doc = "Field `MCLK` reader - Master Clock Enable"] +pub struct MCLK_R(crate::FieldReader); impl MCLK_R { + pub(crate) fn new(bits: bool) -> Self { + MCLK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCLK_A { @@ -902,15 +1030,22 @@ impl MCLK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCLK_A::VALUE1 + **self == MCLK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCLK_A::VALUE2 + **self == MCLK_A::VALUE2 + } +} +impl core::ops::Deref for MCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MCLK`"] +#[doc = "Field `MCLK` writer - Master Clock Enable"] pub struct MCLK_W<'a> { w: &'a mut W, } @@ -918,9 +1053,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCLK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MCLK generation is disabled and the MCLK signal is 0."] #[inline(always)] @@ -945,7 +1078,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1082,4 +1215,30 @@ impl W { pub fn mclk(&mut self) -> MCLK_W { MCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Control Register \\[ASC Mode\\]\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 [pcr_ascmode](index.html) module"] +pub struct PCR_ASCMODE_SPEC; +impl crate::RegisterSpec for PCR_ASCMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcr_ascmode::R](R) reader structure"] +impl crate::Readable for PCR_ASCMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcr_ascmode::W](W) writer structure"] +impl crate::Writable for PCR_ASCMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCR_ASCMode to value 0"] +impl crate::Resettable for PCR_ASCMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/pcr_iicmode.rs b/src/usic0_ch0/pcr_iicmode.rs index 202821bc..c9799b7f 100644 --- a/src/usic0_ch0/pcr_iicmode.rs +++ b/src/usic0_ch0/pcr_iicmode.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PCR_IICMode"] -pub type R = crate::R; -#[doc = "Writer for register PCR_IICMode"] -pub type W = crate::W; -#[doc = "Register PCR_IICMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PCR_IICMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCR_IICMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCR_IICMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SLAD` reader - Slave Address"] +pub struct SLAD_R(crate::FieldReader); +impl SLAD_R { + pub(crate) fn new(bits: u16) -> Self { + SLAD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `SLAD`"] -pub type SLAD_R = crate::R; -#[doc = "Write proxy for field `SLAD`"] +#[doc = "Field `SLAD` writer - Slave Address"] pub struct SLAD_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> SLAD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ACK00`"] -pub type ACK00_R = crate::R; +#[doc = "Field `ACK00` reader - Acknowledge 00H"] +pub struct ACK00_R(crate::FieldReader); impl ACK00_R { + pub(crate) fn new(bits: bool) -> Self { + ACK00_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ACK00_A { @@ -52,15 +91,22 @@ impl ACK00_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACK00_A::VALUE1 + **self == ACK00_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACK00_A::VALUE2 + **self == ACK00_A::VALUE2 + } +} +impl core::ops::Deref for ACK00_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACK00`"] +#[doc = "Field `ACK00` writer - Acknowledge 00H"] pub struct ACK00_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> ACK00_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ACK00_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The slave device is not sensitive to this address."] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> ACK00_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -113,9 +157,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STIM`"] -pub type STIM_R = crate::R; +#[doc = "Field `STIM` reader - Symbol Timing"] +pub struct STIM_R(crate::FieldReader); impl STIM_R { + pub(crate) fn new(bits: bool) -> Self { + STIM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STIM_A { @@ -127,15 +174,22 @@ impl STIM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STIM_A::VALUE1 + **self == STIM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STIM_A::VALUE2 + **self == STIM_A::VALUE2 + } +} +impl core::ops::Deref for STIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STIM`"] +#[doc = "Field `STIM` writer - Symbol Timing"] pub struct STIM_W<'a> { w: &'a mut W, } @@ -143,9 +197,7 @@ impl<'a> STIM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STIM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A symbol contains 10 time quanta. The timing is adapted for standard mode (100 kBaud)."] #[inline(always)] @@ -170,7 +222,7 @@ impl<'a> STIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -188,9 +240,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCRIEN`"] -pub type SCRIEN_R = crate::R; +#[doc = "Field `SCRIEN` reader - Start Condition Received Interrupt Enable"] +pub struct SCRIEN_R(crate::FieldReader); impl SCRIEN_R { + pub(crate) fn new(bits: bool) -> Self { + SCRIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCRIEN_A { @@ -202,15 +257,22 @@ impl SCRIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCRIEN_A::VALUE1 + **self == SCRIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCRIEN_A::VALUE2 + **self == SCRIEN_A::VALUE2 } } -#[doc = "Write proxy for field `SCRIEN`"] +impl core::ops::Deref for SCRIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCRIEN` writer - Start Condition Received Interrupt Enable"] pub struct SCRIEN_W<'a> { w: &'a mut W, } @@ -218,9 +280,7 @@ impl<'a> SCRIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCRIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The start condition interrupt is disabled."] #[inline(always)] @@ -245,7 +305,7 @@ impl<'a> SCRIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -263,9 +323,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSCRIEN`"] -pub type RSCRIEN_R = crate::R; +#[doc = "Field `RSCRIEN` reader - Repeated Start Condition Received Interrupt Enable"] +pub struct RSCRIEN_R(crate::FieldReader); impl RSCRIEN_R { + pub(crate) fn new(bits: bool) -> Self { + RSCRIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSCRIEN_A { @@ -277,15 +340,22 @@ impl RSCRIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSCRIEN_A::VALUE1 + **self == RSCRIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSCRIEN_A::VALUE2 + **self == RSCRIEN_A::VALUE2 } } -#[doc = "Write proxy for field `RSCRIEN`"] +impl core::ops::Deref for RSCRIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSCRIEN` writer - Repeated Start Condition Received Interrupt Enable"] pub struct RSCRIEN_W<'a> { w: &'a mut W, } @@ -293,9 +363,7 @@ impl<'a> RSCRIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSCRIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The repeated start condition interrupt is disabled."] #[inline(always)] @@ -320,7 +388,7 @@ impl<'a> RSCRIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -338,9 +406,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCRIEN`"] -pub type PCRIEN_R = crate::R; +#[doc = "Field `PCRIEN` reader - Stop Condition Received Interrupt Enable"] +pub struct PCRIEN_R(crate::FieldReader); impl PCRIEN_R { + pub(crate) fn new(bits: bool) -> Self { + PCRIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCRIEN_A { @@ -352,15 +423,22 @@ impl PCRIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCRIEN_A::VALUE1 + **self == PCRIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCRIEN_A::VALUE2 + **self == PCRIEN_A::VALUE2 } } -#[doc = "Write proxy for field `PCRIEN`"] +impl core::ops::Deref for PCRIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCRIEN` writer - Stop Condition Received Interrupt Enable"] pub struct PCRIEN_W<'a> { w: &'a mut W, } @@ -368,9 +446,7 @@ impl<'a> PCRIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCRIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The stop condition interrupt is disabled."] #[inline(always)] @@ -395,7 +471,7 @@ impl<'a> PCRIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -413,9 +489,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NACKIEN`"] -pub type NACKIEN_R = crate::R; +#[doc = "Field `NACKIEN` reader - Non-Acknowledge Interrupt Enable"] +pub struct NACKIEN_R(crate::FieldReader); impl NACKIEN_R { + pub(crate) fn new(bits: bool) -> Self { + NACKIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NACKIEN_A { @@ -427,15 +506,22 @@ impl NACKIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NACKIEN_A::VALUE1 + **self == NACKIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NACKIEN_A::VALUE2 + **self == NACKIEN_A::VALUE2 } } -#[doc = "Write proxy for field `NACKIEN`"] +impl core::ops::Deref for NACKIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NACKIEN` writer - Non-Acknowledge Interrupt Enable"] pub struct NACKIEN_W<'a> { w: &'a mut W, } @@ -443,9 +529,7 @@ impl<'a> NACKIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NACKIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The non-acknowledge interrupt is disabled."] #[inline(always)] @@ -470,7 +554,7 @@ impl<'a> NACKIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -488,9 +572,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ARLIEN`"] -pub type ARLIEN_R = crate::R; +#[doc = "Field `ARLIEN` reader - Arbitration Lost Interrupt Enable"] +pub struct ARLIEN_R(crate::FieldReader); impl ARLIEN_R { + pub(crate) fn new(bits: bool) -> Self { + ARLIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARLIEN_A { @@ -502,15 +589,22 @@ impl ARLIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARLIEN_A::VALUE1 + **self == ARLIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARLIEN_A::VALUE2 + **self == ARLIEN_A::VALUE2 + } +} +impl core::ops::Deref for ARLIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARLIEN`"] +#[doc = "Field `ARLIEN` writer - Arbitration Lost Interrupt Enable"] pub struct ARLIEN_W<'a> { w: &'a mut W, } @@ -518,9 +612,7 @@ impl<'a> ARLIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARLIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The arbitration lost interrupt is disabled."] #[inline(always)] @@ -545,7 +637,7 @@ impl<'a> ARLIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); self.w } } @@ -563,9 +655,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRRIEN`"] -pub type SRRIEN_R = crate::R; +#[doc = "Field `SRRIEN` reader - Slave Read Request Interrupt Enable"] +pub struct SRRIEN_R(crate::FieldReader); impl SRRIEN_R { + pub(crate) fn new(bits: bool) -> Self { + SRRIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRRIEN_A { @@ -577,15 +672,22 @@ impl SRRIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRRIEN_A::VALUE1 + **self == SRRIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRRIEN_A::VALUE2 + **self == SRRIEN_A::VALUE2 + } +} +impl core::ops::Deref for SRRIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRRIEN`"] +#[doc = "Field `SRRIEN` writer - Slave Read Request Interrupt Enable"] pub struct SRRIEN_W<'a> { w: &'a mut W, } @@ -593,9 +695,7 @@ impl<'a> SRRIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRRIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The slave read request interrupt is disabled."] #[inline(always)] @@ -620,7 +720,7 @@ impl<'a> SRRIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -638,9 +738,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERRIEN`"] -pub type ERRIEN_R = crate::R; +#[doc = "Field `ERRIEN` reader - Error Interrupt Enable"] +pub struct ERRIEN_R(crate::FieldReader); impl ERRIEN_R { + pub(crate) fn new(bits: bool) -> Self { + ERRIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERRIEN_A { @@ -652,15 +755,22 @@ impl ERRIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERRIEN_A::VALUE1 + **self == ERRIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERRIEN_A::VALUE2 + **self == ERRIEN_A::VALUE2 + } +} +impl core::ops::Deref for ERRIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ERRIEN`"] +#[doc = "Field `ERRIEN` writer - Error Interrupt Enable"] pub struct ERRIEN_W<'a> { w: &'a mut W, } @@ -668,9 +778,7 @@ impl<'a> ERRIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERRIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The error interrupt is disabled."] #[inline(always)] @@ -695,7 +803,7 @@ impl<'a> ERRIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -713,9 +821,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SACKDIS`"] -pub type SACKDIS_R = crate::R; +#[doc = "Field `SACKDIS` reader - Slave Acknowledge Disable"] +pub struct SACKDIS_R(crate::FieldReader); impl SACKDIS_R { + pub(crate) fn new(bits: bool) -> Self { + SACKDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SACKDIS_A { @@ -727,15 +838,22 @@ impl SACKDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SACKDIS_A::VALUE1 + **self == SACKDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SACKDIS_A::VALUE2 + **self == SACKDIS_A::VALUE2 } } -#[doc = "Write proxy for field `SACKDIS`"] +impl core::ops::Deref for SACKDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SACKDIS` writer - Slave Acknowledge Disable"] pub struct SACKDIS_W<'a> { w: &'a mut W, } @@ -743,9 +861,7 @@ impl<'a> SACKDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SACKDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The generation of an active slave acknowledge is enabled (slave acknowledge with 0 level = more bytes can be received)."] #[inline(always)] @@ -770,13 +886,25 @@ impl<'a> SACKDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } -#[doc = "Reader of field `HDEL`"] -pub type HDEL_R = crate::R; -#[doc = "Write proxy for field `HDEL`"] +#[doc = "Field `HDEL` reader - Hardware Delay"] +pub struct HDEL_R(crate::FieldReader); +impl HDEL_R { + pub(crate) fn new(bits: u8) -> Self { + HDEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HDEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HDEL` writer - Hardware Delay"] pub struct HDEL_W<'a> { w: &'a mut W, } @@ -784,7 +912,7 @@ impl<'a> HDEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 26)) | (((value as u32) & 0x0f) << 26); + self.w.bits = (self.w.bits & !(0x0f << 26)) | ((value as u32 & 0x0f) << 26); self.w } } @@ -802,9 +930,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ACKIEN`"] -pub type ACKIEN_R = crate::R; +#[doc = "Field `ACKIEN` reader - Acknowledge Interrupt Enable"] +pub struct ACKIEN_R(crate::FieldReader); impl ACKIEN_R { + pub(crate) fn new(bits: bool) -> Self { + ACKIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ACKIEN_A { @@ -816,15 +947,22 @@ impl ACKIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACKIEN_A::VALUE1 + **self == ACKIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACKIEN_A::VALUE2 + **self == ACKIEN_A::VALUE2 + } +} +impl core::ops::Deref for ACKIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACKIEN`"] +#[doc = "Field `ACKIEN` writer - Acknowledge Interrupt Enable"] pub struct ACKIEN_W<'a> { w: &'a mut W, } @@ -832,9 +970,7 @@ impl<'a> ACKIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ACKIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The acknowledge interrupt is disabled."] #[inline(always)] @@ -859,7 +995,7 @@ impl<'a> ACKIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -877,9 +1013,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCLK`"] -pub type MCLK_R = crate::R; +#[doc = "Field `MCLK` reader - Master Clock Enable"] +pub struct MCLK_R(crate::FieldReader); impl MCLK_R { + pub(crate) fn new(bits: bool) -> Self { + MCLK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCLK_A { @@ -891,15 +1030,22 @@ impl MCLK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCLK_A::VALUE1 + **self == MCLK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCLK_A::VALUE2 + **self == MCLK_A::VALUE2 } } -#[doc = "Write proxy for field `MCLK`"] +impl core::ops::Deref for MCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCLK` writer - Master Clock Enable"] pub struct MCLK_W<'a> { w: &'a mut W, } @@ -907,9 +1053,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCLK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] @@ -934,7 +1078,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1081,4 +1225,30 @@ impl W { pub fn mclk(&mut self) -> MCLK_W { MCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Control Register \\[IIC Mode\\]\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 [pcr_iicmode](index.html) module"] +pub struct PCR_IICMODE_SPEC; +impl crate::RegisterSpec for PCR_IICMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcr_iicmode::R](R) reader structure"] +impl crate::Readable for PCR_IICMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcr_iicmode::W](W) writer structure"] +impl crate::Writable for PCR_IICMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCR_IICMode to value 0"] +impl crate::Resettable for PCR_IICMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/pcr_iismode.rs b/src/usic0_ch0/pcr_iismode.rs index b58b7558..0e6b6408 100644 --- a/src/usic0_ch0/pcr_iismode.rs +++ b/src/usic0_ch0/pcr_iismode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PCR_IISMode"] -pub type R = crate::R; -#[doc = "Writer for register PCR_IISMode"] -pub type W = crate::W; -#[doc = "Register PCR_IISMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PCR_IISMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCR_IISMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCR_IISMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WA Generation Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WAGEN`"] -pub type WAGEN_R = crate::R; +#[doc = "Field `WAGEN` reader - WA Generation Enable"] +pub struct WAGEN_R(crate::FieldReader); impl WAGEN_R { + pub(crate) fn new(bits: bool) -> Self { + WAGEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAGEN_A { @@ -38,15 +65,22 @@ impl WAGEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WAGEN_A::VALUE1 + **self == WAGEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WAGEN_A::VALUE2 + **self == WAGEN_A::VALUE2 + } +} +impl core::ops::Deref for WAGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WAGEN`"] +#[doc = "Field `WAGEN` writer - WA Generation Enable"] pub struct WAGEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> WAGEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WAGEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The IIS can be used as slave. The generation of the word address signal is disabled. The output signal WA is 0. The MCLKO signal generation depends on PCR.MCLK."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> WAGEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DTEN`"] -pub type DTEN_R = crate::R; +#[doc = "Field `DTEN` reader - Data Transfers Enable"] +pub struct DTEN_R(crate::FieldReader); impl DTEN_R { + pub(crate) fn new(bits: bool) -> Self { + DTEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DTEN_A { @@ -113,15 +148,22 @@ impl DTEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DTEN_A::VALUE1 + **self == DTEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DTEN_A::VALUE2 + **self == DTEN_A::VALUE2 } } -#[doc = "Write proxy for field `DTEN`"] +impl core::ops::Deref for DTEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTEN` writer - Data Transfers Enable"] pub struct DTEN_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> DTEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DTEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The changes of the WA input signal are ignored and no transfers take place."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> DTEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELINV`"] -pub type SELINV_R = crate::R; +#[doc = "Field `SELINV` reader - Select Inversion"] +pub struct SELINV_R(crate::FieldReader); impl SELINV_R { + pub(crate) fn new(bits: bool) -> Self { + SELINV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELINV_A { @@ -188,15 +231,22 @@ impl SELINV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELINV_A::VALUE1 + **self == SELINV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELINV_A::VALUE2 + **self == SELINV_A::VALUE2 } } -#[doc = "Write proxy for field `SELINV`"] +impl core::ops::Deref for SELINV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SELINV` writer - Select Inversion"] pub struct SELINV_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> SELINV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELINV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The SELOx outputs have the same polarity as the WA signal."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> SELINV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WAFEIEN`"] -pub type WAFEIEN_R = crate::R; +#[doc = "Field `WAFEIEN` reader - WA Falling Edge Interrupt Enable"] +pub struct WAFEIEN_R(crate::FieldReader); impl WAFEIEN_R { + pub(crate) fn new(bits: bool) -> Self { + WAFEIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAFEIEN_A { @@ -263,15 +314,22 @@ impl WAFEIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WAFEIEN_A::VALUE1 + **self == WAFEIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WAFEIEN_A::VALUE2 + **self == WAFEIEN_A::VALUE2 } } -#[doc = "Write proxy for field `WAFEIEN`"] +impl core::ops::Deref for WAFEIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WAFEIEN` writer - WA Falling Edge Interrupt Enable"] pub struct WAFEIEN_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> WAFEIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WAFEIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not activated if a falling edge of WA is generated."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> WAFEIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WAREIEN`"] -pub type WAREIEN_R = crate::R; +#[doc = "Field `WAREIEN` reader - WA Rising Edge Interrupt Enable"] +pub struct WAREIEN_R(crate::FieldReader); impl WAREIEN_R { + pub(crate) fn new(bits: bool) -> Self { + WAREIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAREIEN_A { @@ -338,15 +397,22 @@ impl WAREIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WAREIEN_A::VALUE1 + **self == WAREIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WAREIEN_A::VALUE2 + **self == WAREIEN_A::VALUE2 } } -#[doc = "Write proxy for field `WAREIEN`"] +impl core::ops::Deref for WAREIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WAREIEN` writer - WA Rising Edge Interrupt Enable"] pub struct WAREIEN_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> WAREIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WAREIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not activated if a rising edge of WA is generated."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> WAREIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENDIEN`"] -pub type ENDIEN_R = crate::R; +#[doc = "Field `ENDIEN` reader - END Interrupt Enable"] +pub struct ENDIEN_R(crate::FieldReader); impl ENDIEN_R { + pub(crate) fn new(bits: bool) -> Self { + ENDIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENDIEN_A { @@ -413,15 +480,22 @@ impl ENDIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENDIEN_A::VALUE1 + **self == ENDIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENDIEN_A::VALUE2 + **self == ENDIEN_A::VALUE2 + } +} +impl core::ops::Deref for ENDIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENDIEN`"] +#[doc = "Field `ENDIEN` writer - END Interrupt Enable"] pub struct ENDIEN_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> ENDIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENDIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not activated."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> ENDIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2TIEN`"] -pub type DX2TIEN_R = crate::R; +#[doc = "Field `DX2TIEN` reader - DX2T Interrupt Enable"] +pub struct DX2TIEN_R(crate::FieldReader); impl DX2TIEN_R { + pub(crate) fn new(bits: bool) -> Self { + DX2TIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2TIEN_A { @@ -488,15 +563,22 @@ impl DX2TIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2TIEN_A::VALUE1 + **self == DX2TIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2TIEN_A::VALUE2 + **self == DX2TIEN_A::VALUE2 + } +} +impl core::ops::Deref for DX2TIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DX2TIEN`"] +#[doc = "Field `DX2TIEN` writer - DX2T Interrupt Enable"] pub struct DX2TIEN_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> DX2TIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2TIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not generated if DX2T is active."] #[inline(always)] @@ -531,13 +611,25 @@ impl<'a> DX2TIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `TDEL`"] -pub type TDEL_R = crate::R; -#[doc = "Write proxy for field `TDEL`"] +#[doc = "Field `TDEL` reader - Transfer Delay"] +pub struct TDEL_R(crate::FieldReader); +impl TDEL_R { + pub(crate) fn new(bits: u8) -> Self { + TDEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TDEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TDEL` writer - Transfer Delay"] pub struct TDEL_W<'a> { w: &'a mut W, } @@ -545,7 +637,7 @@ impl<'a> TDEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 16)) | (((value as u32) & 0x3f) << 16); + self.w.bits = (self.w.bits & !(0x3f << 16)) | ((value as u32 & 0x3f) << 16); self.w } } @@ -563,9 +655,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCLK`"] -pub type MCLK_R = crate::R; +#[doc = "Field `MCLK` reader - Master Clock Enable"] +pub struct MCLK_R(crate::FieldReader); impl MCLK_R { + pub(crate) fn new(bits: bool) -> Self { + MCLK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCLK_A { @@ -577,15 +672,22 @@ impl MCLK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCLK_A::VALUE1 + **self == MCLK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCLK_A::VALUE2 + **self == MCLK_A::VALUE2 } } -#[doc = "Write proxy for field `MCLK`"] +impl core::ops::Deref for MCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCLK` writer - Master Clock Enable"] pub struct MCLK_W<'a> { w: &'a mut W, } @@ -593,9 +695,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCLK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] @@ -620,7 +720,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -717,4 +817,30 @@ impl W { pub fn mclk(&mut self) -> MCLK_W { MCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Control Register \\[IIS Mode\\]\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 [pcr_iismode](index.html) module"] +pub struct PCR_IISMODE_SPEC; +impl crate::RegisterSpec for PCR_IISMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcr_iismode::R](R) reader structure"] +impl crate::Readable for PCR_IISMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcr_iismode::W](W) writer structure"] +impl crate::Writable for PCR_IISMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCR_IISMode to value 0"] +impl crate::Resettable for PCR_IISMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/pcr_sscmode.rs b/src/usic0_ch0/pcr_sscmode.rs index 9c7c844d..b7577583 100644 --- a/src/usic0_ch0/pcr_sscmode.rs +++ b/src/usic0_ch0/pcr_sscmode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PCR_SSCMode"] -pub type R = crate::R; -#[doc = "Writer for register PCR_SSCMode"] -pub type W = crate::W; -#[doc = "Register PCR_SSCMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PCR_SSCMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PCR_SSCMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCR_SSCMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "MSLS Enable\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSLSEN`"] -pub type MSLSEN_R = crate::R; +#[doc = "Field `MSLSEN` reader - MSLS Enable"] +pub struct MSLSEN_R(crate::FieldReader); impl MSLSEN_R { + pub(crate) fn new(bits: bool) -> Self { + MSLSEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSLSEN_A { @@ -38,15 +65,22 @@ impl MSLSEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSLSEN_A::VALUE1 + **self == MSLSEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSLSEN_A::VALUE2 + **self == MSLSEN_A::VALUE2 + } +} +impl core::ops::Deref for MSLSEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSLSEN`"] +#[doc = "Field `MSLSEN` writer - MSLS Enable"] pub struct MSLSEN_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> MSLSEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSLSEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MSLS generation is disabled (MSLS = 0). This is the setting for SSC slave mode."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> MSLSEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELCTR`"] -pub type SELCTR_R = crate::R; +#[doc = "Field `SELCTR` reader - Select Control"] +pub struct SELCTR_R(crate::FieldReader); impl SELCTR_R { + pub(crate) fn new(bits: bool) -> Self { + SELCTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELCTR_A { @@ -113,15 +148,22 @@ impl SELCTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELCTR_A::VALUE1 + **self == SELCTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELCTR_A::VALUE2 + **self == SELCTR_A::VALUE2 + } +} +impl core::ops::Deref for SELCTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SELCTR`"] +#[doc = "Field `SELCTR` writer - Select Control"] pub struct SELCTR_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SELCTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELCTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The coded select mode is enabled."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SELCTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELINV`"] -pub type SELINV_R = crate::R; +#[doc = "Field `SELINV` reader - Select Inversion"] +pub struct SELINV_R(crate::FieldReader); impl SELINV_R { + pub(crate) fn new(bits: bool) -> Self { + SELINV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELINV_A { @@ -188,15 +231,22 @@ impl SELINV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELINV_A::VALUE1 + **self == SELINV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELINV_A::VALUE2 + **self == SELINV_A::VALUE2 + } +} +impl core::ops::Deref for SELINV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SELINV`"] +#[doc = "Field `SELINV` writer - Select Inversion"] pub struct SELINV_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> SELINV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELINV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The SELO outputs have the same polarity as the MSLS signal (active high)."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> SELINV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FEM`"] -pub type FEM_R = crate::R; +#[doc = "Field `FEM` reader - Frame End Mode"] +pub struct FEM_R(crate::FieldReader); impl FEM_R { + pub(crate) fn new(bits: bool) -> Self { + FEM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FEM_A { @@ -263,15 +314,22 @@ impl FEM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FEM_A::VALUE1 + **self == FEM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FEM_A::VALUE2 + **self == FEM_A::VALUE2 + } +} +impl core::ops::Deref for FEM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FEM`"] +#[doc = "Field `FEM` writer - Frame End Mode"] pub struct FEM_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> FEM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FEM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The current data frame is considered as finished when the last bit of a data word has been sent out and the transmit buffer TBUF does not contain new data (TDV = 0)."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> FEM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -329,9 +385,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CTQSEL1`"] -pub type CTQSEL1_R = crate::R; +#[doc = "Field `CTQSEL1` reader - Input Frequency Selection"] +pub struct CTQSEL1_R(crate::FieldReader); impl CTQSEL1_R { + pub(crate) fn new(bits: u8) -> Self { + CTQSEL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CTQSEL1_A { @@ -346,25 +405,32 @@ impl CTQSEL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CTQSEL1_A::VALUE1 + **self == CTQSEL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CTQSEL1_A::VALUE2 + **self == CTQSEL1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CTQSEL1_A::VALUE3 + **self == CTQSEL1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CTQSEL1_A::VALUE4 + **self == CTQSEL1_A::VALUE4 } } -#[doc = "Write proxy for field `CTQSEL1`"] +impl core::ops::Deref for CTQSEL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTQSEL1` writer - Input Frequency Selection"] pub struct CTQSEL1_W<'a> { w: &'a mut W, } @@ -372,9 +438,7 @@ impl<'a> CTQSEL1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTQSEL1_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "fCTQIN = fPDIV"] #[inline(always)] @@ -399,13 +463,25 @@ impl<'a> CTQSEL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } -#[doc = "Reader of field `PCTQ1`"] -pub type PCTQ1_R = crate::R; -#[doc = "Write proxy for field `PCTQ1`"] +#[doc = "Field `PCTQ1` reader - Divider Factor PCTQ1 for Tiw and Tnf"] +pub struct PCTQ1_R(crate::FieldReader); +impl PCTQ1_R { + pub(crate) fn new(bits: u8) -> Self { + PCTQ1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PCTQ1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PCTQ1` writer - Divider Factor PCTQ1 for Tiw and Tnf"] pub struct PCTQ1_W<'a> { w: &'a mut W, } @@ -413,13 +489,25 @@ impl<'a> PCTQ1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } -#[doc = "Reader of field `DCTQ1`"] -pub type DCTQ1_R = crate::R; -#[doc = "Write proxy for field `DCTQ1`"] +#[doc = "Field `DCTQ1` reader - Divider Factor DCTQ1 for Tiw and Tnf"] +pub struct DCTQ1_R(crate::FieldReader); +impl DCTQ1_R { + pub(crate) fn new(bits: u8) -> Self { + DCTQ1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DCTQ1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCTQ1` writer - Divider Factor DCTQ1 for Tiw and Tnf"] pub struct DCTQ1_W<'a> { w: &'a mut W, } @@ -427,7 +515,7 @@ impl<'a> DCTQ1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 8)) | (((value as u32) & 0x1f) << 8); + self.w.bits = (self.w.bits & !(0x1f << 8)) | ((value as u32 & 0x1f) << 8); self.w } } @@ -445,9 +533,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PARIEN`"] -pub type PARIEN_R = crate::R; +#[doc = "Field `PARIEN` reader - Parity Error Interrupt Enable"] +pub struct PARIEN_R(crate::FieldReader); impl PARIEN_R { + pub(crate) fn new(bits: bool) -> Self { + PARIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PARIEN_A { @@ -459,15 +550,22 @@ impl PARIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PARIEN_A::VALUE1 + **self == PARIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PARIEN_A::VALUE2 + **self == PARIEN_A::VALUE2 + } +} +impl core::ops::Deref for PARIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PARIEN`"] +#[doc = "Field `PARIEN` writer - Parity Error Interrupt Enable"] pub struct PARIEN_W<'a> { w: &'a mut W, } @@ -475,9 +573,7 @@ impl<'a> PARIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PARIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not generated with the detection of a parity error."] #[inline(always)] @@ -502,7 +598,7 @@ impl<'a> PARIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -520,9 +616,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSLSIEN`"] -pub type MSLSIEN_R = crate::R; +#[doc = "Field `MSLSIEN` reader - MSLS Interrupt Enable"] +pub struct MSLSIEN_R(crate::FieldReader); impl MSLSIEN_R { + pub(crate) fn new(bits: bool) -> Self { + MSLSIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSLSIEN_A { @@ -534,15 +633,22 @@ impl MSLSIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSLSIEN_A::VALUE1 + **self == MSLSIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSLSIEN_A::VALUE2 + **self == MSLSIEN_A::VALUE2 + } +} +impl core::ops::Deref for MSLSIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSLSIEN`"] +#[doc = "Field `MSLSIEN` writer - MSLS Interrupt Enable"] pub struct MSLSIEN_W<'a> { w: &'a mut W, } @@ -550,9 +656,7 @@ impl<'a> MSLSIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSLSIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not generated if a change of signal MSLS is detected."] #[inline(always)] @@ -577,7 +681,7 @@ impl<'a> MSLSIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -595,9 +699,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2TIEN`"] -pub type DX2TIEN_R = crate::R; +#[doc = "Field `DX2TIEN` reader - DX2T Interrupt Enable"] +pub struct DX2TIEN_R(crate::FieldReader); impl DX2TIEN_R { + pub(crate) fn new(bits: bool) -> Self { + DX2TIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2TIEN_A { @@ -609,15 +716,22 @@ impl DX2TIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2TIEN_A::VALUE1 + **self == DX2TIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2TIEN_A::VALUE2 + **self == DX2TIEN_A::VALUE2 + } +} +impl core::ops::Deref for DX2TIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DX2TIEN`"] +#[doc = "Field `DX2TIEN` writer - DX2T Interrupt Enable"] pub struct DX2TIEN_W<'a> { w: &'a mut W, } @@ -625,9 +739,7 @@ impl<'a> DX2TIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2TIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A protocol interrupt is not generated if DX2T is activated."] #[inline(always)] @@ -652,7 +764,7 @@ impl<'a> DX2TIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -671,31 +783,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SELO`"] -pub type SELO_R = crate::R; +#[doc = "Field `SELO` reader - Select Output"] +pub struct SELO_R(crate::FieldReader); impl SELO_R { + pub(crate) fn new(bits: u8) -> Self { + SELO_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SELO_A::VALUE1), - 1 => Val(SELO_A::VALUE2), - i => Res(i), + 0 => Some(SELO_A::VALUE1), + 1 => Some(SELO_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELO_A::VALUE1 + **self == SELO_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELO_A::VALUE2 + **self == SELO_A::VALUE2 } } -#[doc = "Write proxy for field `SELO`"] +impl core::ops::Deref for SELO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SELO` writer - Select Output"] pub struct SELO_W<'a> { w: &'a mut W, } @@ -718,7 +839,7 @@ impl<'a> SELO_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); self.w } } @@ -736,9 +857,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TIWEN`"] -pub type TIWEN_R = crate::R; +#[doc = "Field `TIWEN` reader - Enable Inter-Word Delay Tiw"] +pub struct TIWEN_R(crate::FieldReader); impl TIWEN_R { + pub(crate) fn new(bits: bool) -> Self { + TIWEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TIWEN_A { @@ -750,15 +874,22 @@ impl TIWEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TIWEN_A::VALUE1 + **self == TIWEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TIWEN_A::VALUE2 + **self == TIWEN_A::VALUE2 } } -#[doc = "Write proxy for field `TIWEN`"] +impl core::ops::Deref for TIWEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TIWEN` writer - Enable Inter-Word Delay Tiw"] pub struct TIWEN_W<'a> { w: &'a mut W, } @@ -766,9 +897,7 @@ impl<'a> TIWEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TIWEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No delay between data words of the same frame."] #[inline(always)] @@ -793,7 +922,7 @@ impl<'a> TIWEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -811,9 +940,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLPHSEL`"] -pub type SLPHSEL_R = crate::R; +#[doc = "Field `SLPHSEL` reader - Slave Mode Clock Phase Select"] +pub struct SLPHSEL_R(crate::FieldReader); impl SLPHSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SLPHSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLPHSEL_A { @@ -825,15 +957,22 @@ impl SLPHSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLPHSEL_A::VALUE1 + **self == SLPHSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLPHSEL_A::VALUE2 + **self == SLPHSEL_A::VALUE2 + } +} +impl core::ops::Deref for SLPHSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SLPHSEL`"] +#[doc = "Field `SLPHSEL` writer - Slave Mode Clock Phase Select"] pub struct SLPHSEL_W<'a> { w: &'a mut W, } @@ -841,9 +980,7 @@ impl<'a> SLPHSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLPHSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Data bits are shifted out with the leading edge of the shift clock signal and latched in with the trailing edge."] #[inline(always)] @@ -868,7 +1005,7 @@ impl<'a> SLPHSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -886,9 +1023,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MCLK`"] -pub type MCLK_R = crate::R; +#[doc = "Field `MCLK` reader - Master Clock Enable"] +pub struct MCLK_R(crate::FieldReader); impl MCLK_R { + pub(crate) fn new(bits: bool) -> Self { + MCLK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MCLK_A { @@ -900,15 +1040,22 @@ impl MCLK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MCLK_A::VALUE1 + **self == MCLK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MCLK_A::VALUE2 + **self == MCLK_A::VALUE2 } } -#[doc = "Write proxy for field `MCLK`"] +impl core::ops::Deref for MCLK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCLK` writer - Master Clock Enable"] pub struct MCLK_W<'a> { w: &'a mut W, } @@ -916,9 +1063,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MCLK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MCLK generation is disabled and output MCLK = 0."] #[inline(always)] @@ -943,7 +1088,7 @@ impl<'a> MCLK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1090,4 +1235,30 @@ impl W { pub fn mclk(&mut self) -> MCLK_W { MCLK_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Control Register \\[SSC Mode\\]\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 [pcr_sscmode](index.html) module"] +pub struct PCR_SSCMODE_SPEC; +impl crate::RegisterSpec for PCR_SSCMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcr_sscmode::R](R) reader structure"] +impl crate::Readable for PCR_SSCMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcr_sscmode::W](W) writer structure"] +impl crate::Writable for PCR_SSCMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCR_SSCMode to value 0"] +impl crate::Resettable for PCR_SSCMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/pscr.rs b/src/usic0_ch0/pscr.rs index ea5233e2..a53dd8a6 100644 --- a/src/usic0_ch0/pscr.rs +++ b/src/usic0_ch0/pscr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register PSCR"] -pub type W = crate::W; -#[doc = "Register PSCR `reset()`'s with value 0"] -impl crate::ResetValue for super::PSCR { - type Type = u32; +#[doc = "Register `PSCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Status Flag 0 in PSR\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST0`"] +#[doc = "Field `CST0` writer - Clear Status Flag 0 in PSR"] pub struct CST0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CST0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CST0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST1`"] +#[doc = "Field `CST1` writer - Clear Status Flag 1 in PSR"] pub struct CST1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CST1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CST1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST2`"] +#[doc = "Field `CST2` writer - Clear Status Flag 2 in PSR"] pub struct CST2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CST2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CST2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST3`"] +#[doc = "Field `CST3` writer - Clear Status Flag 3 in PSR"] pub struct CST3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CST3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CST3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST4`"] +#[doc = "Field `CST4` writer - Clear Status Flag 4 in PSR"] pub struct CST4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CST4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CST4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST5`"] +#[doc = "Field `CST5` writer - Clear Status Flag 5 in PSR"] pub struct CST5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CST5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CST5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST6`"] +#[doc = "Field `CST6` writer - Clear Status Flag 6 in PSR"] pub struct CST6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CST6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CST6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST7`"] +#[doc = "Field `CST7` writer - Clear Status Flag 7 in PSR"] pub struct CST7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CST7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CST7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST8`"] +#[doc = "Field `CST8` writer - Clear Status Flag 8 in PSR"] pub struct CST8_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> CST8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST8_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> CST8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CST9`"] +#[doc = "Field `CST9` writer - Clear Status Flag 9 in PSR"] pub struct CST9_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> CST9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CST9_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> CST9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -552,7 +543,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CRSIF`"] +#[doc = "Field `CRSIF` writer - Clear Receiver Start Indication Flag"] pub struct CRSIF_W<'a> { w: &'a mut W, } @@ -560,9 +551,7 @@ impl<'a> CRSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRSIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -587,7 +576,7 @@ impl<'a> CRSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -605,7 +594,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CDLIF`"] +#[doc = "Field `CDLIF` writer - Clear Data Lost Indication Flag"] pub struct CDLIF_W<'a> { w: &'a mut W, } @@ -613,9 +602,7 @@ impl<'a> CDLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CDLIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -640,7 +627,7 @@ impl<'a> CDLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -658,7 +645,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTSIF`"] +#[doc = "Field `CTSIF` writer - Clear Transmit Shift Indication Flag"] pub struct CTSIF_W<'a> { w: &'a mut W, } @@ -666,9 +653,7 @@ impl<'a> CTSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTSIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -693,7 +678,7 @@ impl<'a> CTSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -711,7 +696,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTBIF`"] +#[doc = "Field `CTBIF` writer - Clear Transmit Buffer Indication Flag"] pub struct CTBIF_W<'a> { w: &'a mut W, } @@ -719,9 +704,7 @@ impl<'a> CTBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTBIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -746,7 +729,7 @@ impl<'a> CTBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -764,7 +747,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CRIF`"] +#[doc = "Field `CRIF` writer - Clear Receive Indication Flag"] pub struct CRIF_W<'a> { w: &'a mut W, } @@ -772,9 +755,7 @@ impl<'a> CRIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -799,7 +780,7 @@ impl<'a> CRIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -817,7 +798,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CAIF`"] +#[doc = "Field `CAIF` writer - Clear Alternative Receive Indication Flag"] pub struct CAIF_W<'a> { w: &'a mut W, } @@ -825,9 +806,7 @@ impl<'a> CAIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CAIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -852,7 +831,7 @@ impl<'a> CAIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -870,7 +849,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CBRGIF`"] +#[doc = "Field `CBRGIF` writer - Clear Baud Rate Generator Indication Flag"] pub struct CBRGIF_W<'a> { w: &'a mut W, } @@ -878,9 +857,7 @@ impl<'a> CBRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CBRGIF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -905,7 +882,7 @@ impl<'a> CBRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -995,4 +972,26 @@ impl W { pub fn cbrgif(&mut self) -> CBRGIF_W { CBRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pscr](index.html) module"] +pub struct PSCR_SPEC; +impl crate::RegisterSpec for PSCR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [pscr::W](W) writer structure"] +impl crate::Writable for PSCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSCR to value 0"] +impl crate::Resettable for PSCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/psr.rs b/src/usic0_ch0/psr.rs index 8a0a6551..73ad854d 100644 --- a/src/usic0_ch0/psr.rs +++ b/src/usic0_ch0/psr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register PSR"] -pub type R = crate::R; -#[doc = "Writer for register PSR"] -pub type W = crate::W; -#[doc = "Register PSR `reset()`'s with value 0"] -impl crate::ResetValue for super::PSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `ST0`"] -pub type ST0_R = crate::R; -#[doc = "Write proxy for field `ST0`"] +#[doc = "Field `ST0` reader - Protocol Status Flag 0"] +pub struct ST0_R(crate::FieldReader); +impl ST0_R { + pub(crate) fn new(bits: bool) -> Self { + ST0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST0` writer - Protocol Status Flag 0"] pub struct ST0_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ST0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `ST1`"] -pub type ST1_R = crate::R; -#[doc = "Write proxy for field `ST1`"] +#[doc = "Field `ST1` reader - Protocol Status Flag 1"] +pub struct ST1_R(crate::FieldReader); +impl ST1_R { + pub(crate) fn new(bits: bool) -> Self { + ST1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST1` writer - Protocol Status Flag 1"] pub struct ST1_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> ST1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `ST2`"] -pub type ST2_R = crate::R; -#[doc = "Write proxy for field `ST2`"] +#[doc = "Field `ST2` reader - Protocol Status Flag 2"] +pub struct ST2_R(crate::FieldReader); +impl ST2_R { + pub(crate) fn new(bits: bool) -> Self { + ST2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST2` writer - Protocol Status Flag 2"] pub struct ST2_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> ST2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Reader of field `ST3`"] -pub type ST3_R = crate::R; -#[doc = "Write proxy for field `ST3`"] +#[doc = "Field `ST3` reader - Protocol Status Flag 3"] +pub struct ST3_R(crate::FieldReader); +impl ST3_R { + pub(crate) fn new(bits: bool) -> Self { + ST3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST3` writer - Protocol Status Flag 3"] pub struct ST3_W<'a> { w: &'a mut W, } @@ -102,13 +174,25 @@ impl<'a> ST3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } -#[doc = "Reader of field `ST4`"] -pub type ST4_R = crate::R; -#[doc = "Write proxy for field `ST4`"] +#[doc = "Field `ST4` reader - Protocol Status Flag 4"] +pub struct ST4_R(crate::FieldReader); +impl ST4_R { + pub(crate) fn new(bits: bool) -> Self { + ST4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST4` writer - Protocol Status Flag 4"] pub struct ST4_W<'a> { w: &'a mut W, } @@ -126,13 +210,25 @@ impl<'a> ST4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `ST5`"] -pub type ST5_R = crate::R; -#[doc = "Write proxy for field `ST5`"] +#[doc = "Field `ST5` reader - Protocol Status Flag 5"] +pub struct ST5_R(crate::FieldReader); +impl ST5_R { + pub(crate) fn new(bits: bool) -> Self { + ST5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST5` writer - Protocol Status Flag 5"] pub struct ST5_W<'a> { w: &'a mut W, } @@ -150,13 +246,25 @@ impl<'a> ST5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } -#[doc = "Reader of field `ST6`"] -pub type ST6_R = crate::R; -#[doc = "Write proxy for field `ST6`"] +#[doc = "Field `ST6` reader - Protocol Status Flag 6"] +pub struct ST6_R(crate::FieldReader); +impl ST6_R { + pub(crate) fn new(bits: bool) -> Self { + ST6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST6` writer - Protocol Status Flag 6"] pub struct ST6_W<'a> { w: &'a mut W, } @@ -174,13 +282,25 @@ impl<'a> ST6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } -#[doc = "Reader of field `ST7`"] -pub type ST7_R = crate::R; -#[doc = "Write proxy for field `ST7`"] +#[doc = "Field `ST7` reader - Protocol Status Flag 7"] +pub struct ST7_R(crate::FieldReader); +impl ST7_R { + pub(crate) fn new(bits: bool) -> Self { + ST7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST7` writer - Protocol Status Flag 7"] pub struct ST7_W<'a> { w: &'a mut W, } @@ -198,13 +318,25 @@ impl<'a> ST7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } -#[doc = "Reader of field `ST8`"] -pub type ST8_R = crate::R; -#[doc = "Write proxy for field `ST8`"] +#[doc = "Field `ST8` reader - Protocol Status Flag 8"] +pub struct ST8_R(crate::FieldReader); +impl ST8_R { + pub(crate) fn new(bits: bool) -> Self { + ST8_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST8` writer - Protocol Status Flag 8"] pub struct ST8_W<'a> { w: &'a mut W, } @@ -222,13 +354,25 @@ impl<'a> ST8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } -#[doc = "Reader of field `ST9`"] -pub type ST9_R = crate::R; -#[doc = "Write proxy for field `ST9`"] +#[doc = "Field `ST9` reader - Protocol Status Flag 9"] +pub struct ST9_R(crate::FieldReader); +impl ST9_R { + pub(crate) fn new(bits: bool) -> Self { + ST9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ST9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ST9` writer - Protocol Status Flag 9"] pub struct ST9_W<'a> { w: &'a mut W, } @@ -246,7 +390,7 @@ impl<'a> ST9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -264,9 +408,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIF`"] -pub type RSIF_R = crate::R; +#[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] +pub struct RSIF_R(crate::FieldReader); impl RSIF_R { + pub(crate) fn new(bits: bool) -> Self { + RSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIF_A { @@ -278,15 +425,22 @@ impl RSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIF_A::VALUE1 + **self == RSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIF_A::VALUE2 + **self == RSIF_A::VALUE2 + } +} +impl core::ops::Deref for RSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RSIF`"] +#[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] pub struct RSIF_W<'a> { w: &'a mut W, } @@ -294,9 +448,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receiver start event has not occurred."] #[inline(always)] @@ -321,7 +473,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -339,9 +491,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIF`"] -pub type DLIF_R = crate::R; +#[doc = "Field `DLIF` reader - Data Lost Indication Flag"] +pub struct DLIF_R(crate::FieldReader); impl DLIF_R { + pub(crate) fn new(bits: bool) -> Self { + DLIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIF_A { @@ -353,15 +508,22 @@ impl DLIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIF_A::VALUE1 + **self == DLIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIF_A::VALUE2 + **self == DLIF_A::VALUE2 } } -#[doc = "Write proxy for field `DLIF`"] +impl core::ops::Deref for DLIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLIF` writer - Data Lost Indication Flag"] pub struct DLIF_W<'a> { w: &'a mut W, } @@ -369,9 +531,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A data lost event has not occurred."] #[inline(always)] @@ -396,7 +556,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -414,9 +574,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIF`"] -pub type TSIF_R = crate::R; +#[doc = "Field `TSIF` reader - Transmit Shift Indication Flag"] +pub struct TSIF_R(crate::FieldReader); impl TSIF_R { + pub(crate) fn new(bits: bool) -> Self { + TSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIF_A { @@ -428,15 +591,22 @@ impl TSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIF_A::VALUE1 + **self == TSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIF_A::VALUE2 + **self == TSIF_A::VALUE2 } } -#[doc = "Write proxy for field `TSIF`"] +impl core::ops::Deref for TSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] pub struct TSIF_W<'a> { w: &'a mut W, } @@ -444,9 +614,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit shift event has not occurred."] #[inline(always)] @@ -471,7 +639,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -489,9 +657,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIF`"] -pub type TBIF_R = crate::R; +#[doc = "Field `TBIF` reader - Transmit Buffer Indication Flag"] +pub struct TBIF_R(crate::FieldReader); impl TBIF_R { + pub(crate) fn new(bits: bool) -> Self { + TBIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIF_A { @@ -503,15 +674,22 @@ impl TBIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIF_A::VALUE1 + **self == TBIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIF_A::VALUE2 + **self == TBIF_A::VALUE2 + } +} +impl core::ops::Deref for TBIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TBIF`"] +#[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] pub struct TBIF_W<'a> { w: &'a mut W, } @@ -519,9 +697,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer event has not occurred."] #[inline(always)] @@ -546,7 +722,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -564,9 +740,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIF`"] -pub type RIF_R = crate::R; +#[doc = "Field `RIF` reader - Receive Indication Flag"] +pub struct RIF_R(crate::FieldReader); impl RIF_R { + pub(crate) fn new(bits: bool) -> Self { + RIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIF_A { @@ -578,15 +757,22 @@ impl RIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIF_A::VALUE1 + **self == RIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIF_A::VALUE2 + **self == RIF_A::VALUE2 + } +} +impl core::ops::Deref for RIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RIF`"] +#[doc = "Field `RIF` writer - Receive Indication Flag"] pub struct RIF_W<'a> { w: &'a mut W, } @@ -594,9 +780,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive event has not occurred."] #[inline(always)] @@ -621,7 +805,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -639,9 +823,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIF`"] -pub type AIF_R = crate::R; +#[doc = "Field `AIF` reader - Alternative Receive Indication Flag"] +pub struct AIF_R(crate::FieldReader); impl AIF_R { + pub(crate) fn new(bits: bool) -> Self { + AIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIF_A { @@ -653,15 +840,22 @@ impl AIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIF_A::VALUE1 + **self == AIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIF_A::VALUE2 + **self == AIF_A::VALUE2 } } -#[doc = "Write proxy for field `AIF`"] +impl core::ops::Deref for AIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] pub struct AIF_W<'a> { w: &'a mut W, } @@ -669,9 +863,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive event has not occurred."] #[inline(always)] @@ -696,7 +888,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -714,9 +906,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIF`"] -pub type BRGIF_R = crate::R; +#[doc = "Field `BRGIF` reader - Baud Rate Generator Indication Flag"] +pub struct BRGIF_R(crate::FieldReader); impl BRGIF_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIF_A { @@ -728,15 +923,22 @@ impl BRGIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIF_A::VALUE1 + **self == BRGIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIF_A::VALUE2 + **self == BRGIF_A::VALUE2 } } -#[doc = "Write proxy for field `BRGIF`"] +impl core::ops::Deref for BRGIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] pub struct BRGIF_W<'a> { w: &'a mut W, } @@ -744,9 +946,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A baud rate generator event has not occurred."] #[inline(always)] @@ -771,7 +971,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -948,4 +1148,30 @@ impl W { pub fn brgif(&mut self) -> BRGIF_W { BRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Register\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 [psr](index.html) module"] +pub struct PSR_SPEC; +impl crate::RegisterSpec for PSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psr::R](R) reader structure"] +impl crate::Readable for PSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psr::W](W) writer structure"] +impl crate::Writable for PSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSR to value 0"] +impl crate::Resettable for PSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/psr_ascmode.rs b/src/usic0_ch0/psr_ascmode.rs index afe9f6aa..758876b9 100644 --- a/src/usic0_ch0/psr_ascmode.rs +++ b/src/usic0_ch0/psr_ascmode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSR_ASCMode"] -pub type R = crate::R; -#[doc = "Writer for register PSR_ASCMode"] -pub type W = crate::W; -#[doc = "Register PSR_ASCMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PSR_ASCMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSR_ASCMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSR_ASCMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Transmission Idle\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TXIDLE`"] -pub type TXIDLE_R = crate::R; +#[doc = "Field `TXIDLE` reader - Transmission Idle"] +pub struct TXIDLE_R(crate::FieldReader); impl TXIDLE_R { + pub(crate) fn new(bits: bool) -> Self { + TXIDLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TXIDLE_A { @@ -38,15 +65,22 @@ impl TXIDLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TXIDLE_A::VALUE1 + **self == TXIDLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TXIDLE_A::VALUE2 + **self == TXIDLE_A::VALUE2 + } +} +impl core::ops::Deref for TXIDLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TXIDLE`"] +#[doc = "Field `TXIDLE` writer - Transmission Idle"] pub struct TXIDLE_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> TXIDLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TXIDLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmitter line has not yet been idle."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> TXIDLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RXIDLE`"] -pub type RXIDLE_R = crate::R; +#[doc = "Field `RXIDLE` reader - Reception Idle"] +pub struct RXIDLE_R(crate::FieldReader); impl RXIDLE_R { + pub(crate) fn new(bits: bool) -> Self { + RXIDLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RXIDLE_A { @@ -113,15 +148,22 @@ impl RXIDLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RXIDLE_A::VALUE1 + **self == RXIDLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RXIDLE_A::VALUE2 + **self == RXIDLE_A::VALUE2 } } -#[doc = "Write proxy for field `RXIDLE`"] +impl core::ops::Deref for RXIDLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXIDLE` writer - Reception Idle"] pub struct RXIDLE_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> RXIDLE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RXIDLE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The receiver line has not yet been idle."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> RXIDLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SBD`"] -pub type SBD_R = crate::R; +#[doc = "Field `SBD` reader - Synchronization Break Detected"] +pub struct SBD_R(crate::FieldReader); impl SBD_R { + pub(crate) fn new(bits: bool) -> Self { + SBD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SBD_A { @@ -188,15 +231,22 @@ impl SBD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SBD_A::VALUE1 + **self == SBD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SBD_A::VALUE2 + **self == SBD_A::VALUE2 + } +} +impl core::ops::Deref for SBD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SBD`"] +#[doc = "Field `SBD` writer - Synchronization Break Detected"] pub struct SBD_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> SBD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SBD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A synchronization break has not yet been detected."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> SBD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `COL`"] -pub type COL_R = crate::R; +#[doc = "Field `COL` reader - Collision Detected"] +pub struct COL_R(crate::FieldReader); impl COL_R { + pub(crate) fn new(bits: bool) -> Self { + COL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> COL_A { @@ -263,15 +314,22 @@ impl COL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == COL_A::VALUE1 + **self == COL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == COL_A::VALUE2 + **self == COL_A::VALUE2 } } -#[doc = "Write proxy for field `COL`"] +impl core::ops::Deref for COL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COL` writer - Collision Detected"] pub struct COL_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> COL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: COL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A collision has not yet been detected and frame transmission is possible."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> COL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RNS`"] -pub type RNS_R = crate::R; +#[doc = "Field `RNS` reader - Receiver Noise Detected"] +pub struct RNS_R(crate::FieldReader); impl RNS_R { + pub(crate) fn new(bits: bool) -> Self { + RNS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RNS_A { @@ -338,15 +397,22 @@ impl RNS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RNS_A::VALUE1 + **self == RNS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RNS_A::VALUE2 + **self == RNS_A::VALUE2 + } +} +impl core::ops::Deref for RNS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RNS`"] +#[doc = "Field `RNS` writer - Receiver Noise Detected"] pub struct RNS_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> RNS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RNS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Receiver noise has not been detected."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> RNS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FER0`"] -pub type FER0_R = crate::R; +#[doc = "Field `FER0` reader - Format Error in Stop Bit 0"] +pub struct FER0_R(crate::FieldReader); impl FER0_R { + pub(crate) fn new(bits: bool) -> Self { + FER0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FER0_A { @@ -413,15 +480,22 @@ impl FER0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FER0_A::VALUE1 + **self == FER0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FER0_A::VALUE2 + **self == FER0_A::VALUE2 } } -#[doc = "Write proxy for field `FER0`"] +impl core::ops::Deref for FER0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FER0` writer - Format Error in Stop Bit 0"] pub struct FER0_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> FER0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FER0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A format error 0 has not been detected."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> FER0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FER1`"] -pub type FER1_R = crate::R; +#[doc = "Field `FER1` reader - Format Error in Stop Bit 1"] +pub struct FER1_R(crate::FieldReader); impl FER1_R { + pub(crate) fn new(bits: bool) -> Self { + FER1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FER1_A { @@ -488,15 +563,22 @@ impl FER1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FER1_A::VALUE1 + **self == FER1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FER1_A::VALUE2 + **self == FER1_A::VALUE2 + } +} +impl core::ops::Deref for FER1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `FER1`"] +#[doc = "Field `FER1` writer - Format Error in Stop Bit 1"] pub struct FER1_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> FER1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FER1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A format error 1 has not been detected."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> FER1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RFF`"] -pub type RFF_R = crate::R; +#[doc = "Field `RFF` reader - Receive Frame Finished"] +pub struct RFF_R(crate::FieldReader); impl RFF_R { + pub(crate) fn new(bits: bool) -> Self { + RFF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RFF_A { @@ -563,15 +646,22 @@ impl RFF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RFF_A::VALUE1 + **self == RFF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RFF_A::VALUE2 + **self == RFF_A::VALUE2 + } +} +impl core::ops::Deref for RFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RFF`"] +#[doc = "Field `RFF` writer - Receive Frame Finished"] pub struct RFF_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> RFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RFF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The received frame is not yet finished."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> RFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TFF`"] -pub type TFF_R = crate::R; +#[doc = "Field `TFF` reader - Transmitter Frame Finished"] +pub struct TFF_R(crate::FieldReader); impl TFF_R { + pub(crate) fn new(bits: bool) -> Self { + TFF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TFF_A { @@ -638,15 +729,22 @@ impl TFF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TFF_A::VALUE1 + **self == TFF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TFF_A::VALUE2 + **self == TFF_A::VALUE2 + } +} +impl core::ops::Deref for TFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TFF`"] +#[doc = "Field `TFF` writer - Transmitter Frame Finished"] pub struct TFF_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> TFF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TFF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmitter frame is not yet finished."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> TFF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BUSY`"] -pub type BUSY_R = crate::R; +#[doc = "Field `BUSY` reader - Transfer Status BUSY"] +pub struct BUSY_R(crate::FieldReader); impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BUSY_A { @@ -713,12 +812,19 @@ impl BUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BUSY_A::VALUE1 + **self == BUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BUSY_A::VALUE2 + **self == BUSY_A::VALUE2 + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receiver Start Indication Flag\n\nValue on reset: 0"] @@ -735,9 +841,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIF`"] -pub type RSIF_R = crate::R; +#[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] +pub struct RSIF_R(crate::FieldReader); impl RSIF_R { + pub(crate) fn new(bits: bool) -> Self { + RSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIF_A { @@ -749,15 +858,22 @@ impl RSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIF_A::VALUE1 + **self == RSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIF_A::VALUE2 + **self == RSIF_A::VALUE2 } } -#[doc = "Write proxy for field `RSIF`"] +impl core::ops::Deref for RSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] pub struct RSIF_W<'a> { w: &'a mut W, } @@ -765,9 +881,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receiver start event has not occurred."] #[inline(always)] @@ -792,7 +906,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -810,9 +924,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIF`"] -pub type DLIF_R = crate::R; +#[doc = "Field `DLIF` reader - Data Lost Indication Flag"] +pub struct DLIF_R(crate::FieldReader); impl DLIF_R { + pub(crate) fn new(bits: bool) -> Self { + DLIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIF_A { @@ -824,15 +941,22 @@ impl DLIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIF_A::VALUE1 + **self == DLIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIF_A::VALUE2 + **self == DLIF_A::VALUE2 + } +} +impl core::ops::Deref for DLIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DLIF`"] +#[doc = "Field `DLIF` writer - Data Lost Indication Flag"] pub struct DLIF_W<'a> { w: &'a mut W, } @@ -840,9 +964,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A data lost event has not occurred."] #[inline(always)] @@ -867,7 +989,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -885,9 +1007,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIF`"] -pub type TSIF_R = crate::R; +#[doc = "Field `TSIF` reader - Transmit Shift Indication Flag"] +pub struct TSIF_R(crate::FieldReader); impl TSIF_R { + pub(crate) fn new(bits: bool) -> Self { + TSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIF_A { @@ -899,15 +1024,22 @@ impl TSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIF_A::VALUE1 + **self == TSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIF_A::VALUE2 + **self == TSIF_A::VALUE2 } } -#[doc = "Write proxy for field `TSIF`"] +impl core::ops::Deref for TSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] pub struct TSIF_W<'a> { w: &'a mut W, } @@ -915,9 +1047,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit shift event has not occurred."] #[inline(always)] @@ -942,7 +1072,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -960,9 +1090,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIF`"] -pub type TBIF_R = crate::R; +#[doc = "Field `TBIF` reader - Transmit Buffer Indication Flag"] +pub struct TBIF_R(crate::FieldReader); impl TBIF_R { + pub(crate) fn new(bits: bool) -> Self { + TBIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIF_A { @@ -974,15 +1107,22 @@ impl TBIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIF_A::VALUE1 + **self == TBIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIF_A::VALUE2 + **self == TBIF_A::VALUE2 } } -#[doc = "Write proxy for field `TBIF`"] +impl core::ops::Deref for TBIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] pub struct TBIF_W<'a> { w: &'a mut W, } @@ -990,9 +1130,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer event has not occurred."] #[inline(always)] @@ -1017,7 +1155,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1035,9 +1173,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIF`"] -pub type RIF_R = crate::R; +#[doc = "Field `RIF` reader - Receive Indication Flag"] +pub struct RIF_R(crate::FieldReader); impl RIF_R { + pub(crate) fn new(bits: bool) -> Self { + RIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIF_A { @@ -1049,15 +1190,22 @@ impl RIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIF_A::VALUE1 + **self == RIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIF_A::VALUE2 + **self == RIF_A::VALUE2 } } -#[doc = "Write proxy for field `RIF`"] +impl core::ops::Deref for RIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RIF` writer - Receive Indication Flag"] pub struct RIF_W<'a> { w: &'a mut W, } @@ -1065,9 +1213,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive event has not occurred."] #[inline(always)] @@ -1092,7 +1238,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1110,9 +1256,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIF`"] -pub type AIF_R = crate::R; +#[doc = "Field `AIF` reader - Alternative Receive Indication Flag"] +pub struct AIF_R(crate::FieldReader); impl AIF_R { + pub(crate) fn new(bits: bool) -> Self { + AIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIF_A { @@ -1124,15 +1273,22 @@ impl AIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIF_A::VALUE1 + **self == AIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIF_A::VALUE2 + **self == AIF_A::VALUE2 + } +} +impl core::ops::Deref for AIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `AIF`"] +#[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] pub struct AIF_W<'a> { w: &'a mut W, } @@ -1140,9 +1296,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive event has not occurred."] #[inline(always)] @@ -1167,7 +1321,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1185,9 +1339,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIF`"] -pub type BRGIF_R = crate::R; +#[doc = "Field `BRGIF` reader - Baud Rate Generator Indication Flag"] +pub struct BRGIF_R(crate::FieldReader); impl BRGIF_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIF_A { @@ -1199,15 +1356,22 @@ impl BRGIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIF_A::VALUE1 + **self == BRGIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIF_A::VALUE2 + **self == BRGIF_A::VALUE2 } } -#[doc = "Write proxy for field `BRGIF`"] +impl core::ops::Deref for BRGIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] pub struct BRGIF_W<'a> { w: &'a mut W, } @@ -1215,9 +1379,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A baud rate generator event has not occurred."] #[inline(always)] @@ -1242,7 +1404,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1414,4 +1576,30 @@ impl W { pub fn brgif(&mut self) -> BRGIF_W { BRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Register \\[ASC Mode\\]\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 [psr_ascmode](index.html) module"] +pub struct PSR_ASCMODE_SPEC; +impl crate::RegisterSpec for PSR_ASCMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psr_ascmode::R](R) reader structure"] +impl crate::Readable for PSR_ASCMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psr_ascmode::W](W) writer structure"] +impl crate::Writable for PSR_ASCMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSR_ASCMode to value 0"] +impl crate::Resettable for PSR_ASCMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/psr_iicmode.rs b/src/usic0_ch0/psr_iicmode.rs index 8b3f57eb..72cbc52d 100644 --- a/src/usic0_ch0/psr_iicmode.rs +++ b/src/usic0_ch0/psr_iicmode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSR_IICMode"] -pub type R = crate::R; -#[doc = "Writer for register PSR_IICMode"] -pub type W = crate::W; -#[doc = "Register PSR_IICMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PSR_IICMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSR_IICMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSR_IICMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Slave Select\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SLSEL`"] -pub type SLSEL_R = crate::R; +#[doc = "Field `SLSEL` reader - Slave Select"] +pub struct SLSEL_R(crate::FieldReader); impl SLSEL_R { + pub(crate) fn new(bits: bool) -> Self { + SLSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SLSEL_A { @@ -38,15 +65,22 @@ impl SLSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SLSEL_A::VALUE1 + **self == SLSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SLSEL_A::VALUE2 + **self == SLSEL_A::VALUE2 + } +} +impl core::ops::Deref for SLSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SLSEL`"] +#[doc = "Field `SLSEL` writer - Slave Select"] pub struct SLSEL_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SLSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SLSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The device is not selected as slave."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SLSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WTDF`"] -pub type WTDF_R = crate::R; +#[doc = "Field `WTDF` reader - Wrong TDF Code Found"] +pub struct WTDF_R(crate::FieldReader); impl WTDF_R { + pub(crate) fn new(bits: bool) -> Self { + WTDF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WTDF_A { @@ -113,15 +148,22 @@ impl WTDF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WTDF_A::VALUE1 + **self == WTDF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WTDF_A::VALUE2 + **self == WTDF_A::VALUE2 } } -#[doc = "Write proxy for field `WTDF`"] +impl core::ops::Deref for WTDF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WTDF` writer - Wrong TDF Code Found"] pub struct WTDF_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> WTDF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WTDF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A wrong TDF code has not been found."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> WTDF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCR`"] -pub type SCR_R = crate::R; +#[doc = "Field `SCR` reader - Start Condition Received"] +pub struct SCR_R(crate::FieldReader); impl SCR_R { + pub(crate) fn new(bits: bool) -> Self { + SCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCR_A { @@ -188,15 +231,22 @@ impl SCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCR_A::VALUE1 + **self == SCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCR_A::VALUE2 + **self == SCR_A::VALUE2 + } +} +impl core::ops::Deref for SCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SCR`"] +#[doc = "Field `SCR` writer - Start Condition Received"] pub struct SCR_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> SCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A start condition has not yet been detected."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> SCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSCR`"] -pub type RSCR_R = crate::R; +#[doc = "Field `RSCR` reader - Repeated Start Condition Received"] +pub struct RSCR_R(crate::FieldReader); impl RSCR_R { + pub(crate) fn new(bits: bool) -> Self { + RSCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSCR_A { @@ -263,15 +314,22 @@ impl RSCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSCR_A::VALUE1 + **self == RSCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSCR_A::VALUE2 + **self == RSCR_A::VALUE2 } } -#[doc = "Write proxy for field `RSCR`"] +impl core::ops::Deref for RSCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSCR` writer - Repeated Start Condition Received"] pub struct RSCR_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> RSCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A repeated start condition has not yet been detected."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> RSCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PCR`"] -pub type PCR_R = crate::R; +#[doc = "Field `PCR` reader - Stop Condition Received"] +pub struct PCR_R(crate::FieldReader); impl PCR_R { + pub(crate) fn new(bits: bool) -> Self { + PCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PCR_A { @@ -338,15 +397,22 @@ impl PCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PCR_A::VALUE1 + **self == PCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PCR_A::VALUE2 + **self == PCR_A::VALUE2 + } +} +impl core::ops::Deref for PCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PCR`"] +#[doc = "Field `PCR` writer - Stop Condition Received"] pub struct PCR_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PCR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PCR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A stop condition has not yet been detected."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `NACK`"] -pub type NACK_R = crate::R; +#[doc = "Field `NACK` reader - Non-Acknowledge Received"] +pub struct NACK_R(crate::FieldReader); impl NACK_R { + pub(crate) fn new(bits: bool) -> Self { + NACK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NACK_A { @@ -413,15 +480,22 @@ impl NACK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == NACK_A::VALUE1 + **self == NACK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == NACK_A::VALUE2 + **self == NACK_A::VALUE2 } } -#[doc = "Write proxy for field `NACK`"] +impl core::ops::Deref for NACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NACK` writer - Non-Acknowledge Received"] pub struct NACK_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> NACK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NACK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A non-acknowledge has not been received."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> NACK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ARL`"] -pub type ARL_R = crate::R; +#[doc = "Field `ARL` reader - Arbitration Lost"] +pub struct ARL_R(crate::FieldReader); impl ARL_R { + pub(crate) fn new(bits: bool) -> Self { + ARL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARL_A { @@ -488,15 +563,22 @@ impl ARL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARL_A::VALUE1 + **self == ARL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARL_A::VALUE2 + **self == ARL_A::VALUE2 + } +} +impl core::ops::Deref for ARL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARL`"] +#[doc = "Field `ARL` writer - Arbitration Lost"] pub struct ARL_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> ARL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An arbitration has not been lost."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> ARL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRR`"] -pub type SRR_R = crate::R; +#[doc = "Field `SRR` reader - Slave Read Request"] +pub struct SRR_R(crate::FieldReader); impl SRR_R { + pub(crate) fn new(bits: bool) -> Self { + SRR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRR_A { @@ -563,15 +646,22 @@ impl SRR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRR_A::VALUE1 + **self == SRR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRR_A::VALUE2 + **self == SRR_A::VALUE2 + } +} +impl core::ops::Deref for SRR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRR`"] +#[doc = "Field `SRR` writer - Slave Read Request"] pub struct SRR_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> SRR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A slave read request has not been detected."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> SRR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ERR`"] -pub type ERR_R = crate::R; +#[doc = "Field `ERR` reader - Error"] +pub struct ERR_R(crate::FieldReader); impl ERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ERR_A { @@ -638,15 +729,22 @@ impl ERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ERR_A::VALUE1 + **self == ERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ERR_A::VALUE2 + **self == ERR_A::VALUE2 + } +} +impl core::ops::Deref for ERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ERR`"] +#[doc = "Field `ERR` writer - Error"] pub struct ERR_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> ERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An IIC error has not been detected."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> ERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ACK`"] -pub type ACK_R = crate::R; +#[doc = "Field `ACK` reader - Acknowledge Received"] +pub struct ACK_R(crate::FieldReader); impl ACK_R { + pub(crate) fn new(bits: bool) -> Self { + ACK_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ACK_A { @@ -713,15 +812,22 @@ impl ACK_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ACK_A::VALUE1 + **self == ACK_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ACK_A::VALUE2 + **self == ACK_A::VALUE2 + } +} +impl core::ops::Deref for ACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ACK`"] +#[doc = "Field `ACK` writer - Acknowledge Received"] pub struct ACK_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> ACK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ACK_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An acknowledge has not been received."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> ACK_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIF`"] -pub type RSIF_R = crate::R; +#[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] +pub struct RSIF_R(crate::FieldReader); impl RSIF_R { + pub(crate) fn new(bits: bool) -> Self { + RSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIF_A { @@ -788,15 +895,22 @@ impl RSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIF_A::VALUE1 + **self == RSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIF_A::VALUE2 + **self == RSIF_A::VALUE2 + } +} +impl core::ops::Deref for RSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RSIF`"] +#[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] pub struct RSIF_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receiver start event has not occurred."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIF`"] -pub type DLIF_R = crate::R; +#[doc = "Field `DLIF` reader - Data Lost Indication Flag"] +pub struct DLIF_R(crate::FieldReader); impl DLIF_R { + pub(crate) fn new(bits: bool) -> Self { + DLIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIF_A { @@ -863,15 +978,22 @@ impl DLIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIF_A::VALUE1 + **self == DLIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIF_A::VALUE2 + **self == DLIF_A::VALUE2 } } -#[doc = "Write proxy for field `DLIF`"] +impl core::ops::Deref for DLIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLIF` writer - Data Lost Indication Flag"] pub struct DLIF_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A data lost event has not occurred."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIF`"] -pub type TSIF_R = crate::R; +#[doc = "Field `TSIF` reader - Transmit Shift Indication Flag"] +pub struct TSIF_R(crate::FieldReader); impl TSIF_R { + pub(crate) fn new(bits: bool) -> Self { + TSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIF_A { @@ -938,15 +1061,22 @@ impl TSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIF_A::VALUE1 + **self == TSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIF_A::VALUE2 + **self == TSIF_A::VALUE2 } } -#[doc = "Write proxy for field `TSIF`"] +impl core::ops::Deref for TSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] pub struct TSIF_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit shift event has not occurred."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIF`"] -pub type TBIF_R = crate::R; +#[doc = "Field `TBIF` reader - Transmit Buffer Indication Flag"] +pub struct TBIF_R(crate::FieldReader); impl TBIF_R { + pub(crate) fn new(bits: bool) -> Self { + TBIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIF_A { @@ -1013,15 +1144,22 @@ impl TBIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIF_A::VALUE1 + **self == TBIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIF_A::VALUE2 + **self == TBIF_A::VALUE2 + } +} +impl core::ops::Deref for TBIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TBIF`"] +#[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] pub struct TBIF_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer event has not occurred."] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIF`"] -pub type RIF_R = crate::R; +#[doc = "Field `RIF` reader - Receive Indication Flag"] +pub struct RIF_R(crate::FieldReader); impl RIF_R { + pub(crate) fn new(bits: bool) -> Self { + RIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIF_A { @@ -1088,15 +1227,22 @@ impl RIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIF_A::VALUE1 + **self == RIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIF_A::VALUE2 + **self == RIF_A::VALUE2 + } +} +impl core::ops::Deref for RIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RIF`"] +#[doc = "Field `RIF` writer - Receive Indication Flag"] pub struct RIF_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive event has not occurred."] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIF`"] -pub type AIF_R = crate::R; +#[doc = "Field `AIF` reader - Alternative Receive Indication Flag"] +pub struct AIF_R(crate::FieldReader); impl AIF_R { + pub(crate) fn new(bits: bool) -> Self { + AIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIF_A { @@ -1163,15 +1310,22 @@ impl AIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIF_A::VALUE1 + **self == AIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIF_A::VALUE2 + **self == AIF_A::VALUE2 } } -#[doc = "Write proxy for field `AIF`"] +impl core::ops::Deref for AIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] pub struct AIF_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive event has not occurred."] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1224,9 +1376,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIF`"] -pub type BRGIF_R = crate::R; +#[doc = "Field `BRGIF` reader - Baud Rate Generator Indication Flag"] +pub struct BRGIF_R(crate::FieldReader); impl BRGIF_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIF_A { @@ -1238,15 +1393,22 @@ impl BRGIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIF_A::VALUE1 + **self == BRGIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIF_A::VALUE2 + **self == BRGIF_A::VALUE2 } } -#[doc = "Write proxy for field `BRGIF`"] +impl core::ops::Deref for BRGIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] pub struct BRGIF_W<'a> { w: &'a mut W, } @@ -1254,9 +1416,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A baud rate generator event has not occurred."] #[inline(always)] @@ -1281,7 +1441,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1458,4 +1618,30 @@ impl W { pub fn brgif(&mut self) -> BRGIF_W { BRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Register \\[IIC Mode\\]\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 [psr_iicmode](index.html) module"] +pub struct PSR_IICMODE_SPEC; +impl crate::RegisterSpec for PSR_IICMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psr_iicmode::R](R) reader structure"] +impl crate::Readable for PSR_IICMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psr_iicmode::W](W) writer structure"] +impl crate::Writable for PSR_IICMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSR_IICMode to value 0"] +impl crate::Resettable for PSR_IICMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/psr_iismode.rs b/src/usic0_ch0/psr_iismode.rs index 4e26d3f3..eca51d44 100644 --- a/src/usic0_ch0/psr_iismode.rs +++ b/src/usic0_ch0/psr_iismode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSR_IISMode"] -pub type R = crate::R; -#[doc = "Writer for register PSR_IISMode"] -pub type W = crate::W; -#[doc = "Register PSR_IISMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PSR_IISMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSR_IISMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSR_IISMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Word Address\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WA`"] -pub type WA_R = crate::R; +#[doc = "Field `WA` reader - Word Address"] +pub struct WA_R(crate::FieldReader); impl WA_R { + pub(crate) fn new(bits: bool) -> Self { + WA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WA_A { @@ -38,15 +65,22 @@ impl WA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WA_A::VALUE1 + **self == WA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WA_A::VALUE2 + **self == WA_A::VALUE2 } } -#[doc = "Write proxy for field `WA`"] +impl core::ops::Deref for WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WA` writer - Word Address"] pub struct WA_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> WA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "WA has been sampled 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> WA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2S`"] -pub type DX2S_R = crate::R; +#[doc = "Field `DX2S` reader - DX2S Status"] +pub struct DX2S_R(crate::FieldReader); impl DX2S_R { + pub(crate) fn new(bits: bool) -> Self { + DX2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2S_A { @@ -113,15 +148,22 @@ impl DX2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2S_A::VALUE1 + **self == DX2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2S_A::VALUE2 + **self == DX2S_A::VALUE2 + } +} +impl core::ops::Deref for DX2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DX2S`"] +#[doc = "Field `DX2S` writer - DX2S Status"] pub struct DX2S_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> DX2S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2S_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DX2S is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> DX2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2TEV`"] -pub type DX2TEV_R = crate::R; +#[doc = "Field `DX2TEV` reader - DX2T Event Detected"] +pub struct DX2TEV_R(crate::FieldReader); impl DX2TEV_R { + pub(crate) fn new(bits: bool) -> Self { + DX2TEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2TEV_A { @@ -188,15 +231,22 @@ impl DX2TEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2TEV_A::VALUE1 + **self == DX2TEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2TEV_A::VALUE2 + **self == DX2TEV_A::VALUE2 + } +} +impl core::ops::Deref for DX2TEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DX2TEV`"] +#[doc = "Field `DX2TEV` writer - DX2T Event Detected"] pub struct DX2TEV_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> DX2TEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2TEV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The DX2T signal has not been activated."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> DX2TEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WAFE`"] -pub type WAFE_R = crate::R; +#[doc = "Field `WAFE` reader - WA Falling Edge Event"] +pub struct WAFE_R(crate::FieldReader); impl WAFE_R { + pub(crate) fn new(bits: bool) -> Self { + WAFE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAFE_A { @@ -263,15 +314,22 @@ impl WAFE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WAFE_A::VALUE1 + **self == WAFE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WAFE_A::VALUE2 + **self == WAFE_A::VALUE2 + } +} +impl core::ops::Deref for WAFE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WAFE`"] +#[doc = "Field `WAFE` writer - WA Falling Edge Event"] pub struct WAFE_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> WAFE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WAFE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A WA falling edge has not been generated."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> WAFE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WARE`"] -pub type WARE_R = crate::R; +#[doc = "Field `WARE` reader - WA Rising Edge Event"] +pub struct WARE_R(crate::FieldReader); impl WARE_R { + pub(crate) fn new(bits: bool) -> Self { + WARE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WARE_A { @@ -338,15 +397,22 @@ impl WARE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WARE_A::VALUE1 + **self == WARE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WARE_A::VALUE2 + **self == WARE_A::VALUE2 + } +} +impl core::ops::Deref for WARE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WARE`"] +#[doc = "Field `WARE` writer - WA Rising Edge Event"] pub struct WARE_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> WARE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WARE_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A WA rising edge has not been generated."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> WARE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `END`"] -pub type END_R = crate::R; +#[doc = "Field `END` reader - WA Generation End"] +pub struct END_R(crate::FieldReader); impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> END_A { @@ -413,15 +480,22 @@ impl END_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == END_A::VALUE1 + **self == END_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == END_A::VALUE2 + **self == END_A::VALUE2 } } -#[doc = "Write proxy for field `END`"] +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END` writer - WA Generation End"] pub struct END_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> END_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: END_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The WA generation has not yet ended (if it is running and WAGEN has been cleared)."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> END_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIF`"] -pub type RSIF_R = crate::R; +#[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] +pub struct RSIF_R(crate::FieldReader); impl RSIF_R { + pub(crate) fn new(bits: bool) -> Self { + RSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIF_A { @@ -488,15 +563,22 @@ impl RSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIF_A::VALUE1 + **self == RSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIF_A::VALUE2 + **self == RSIF_A::VALUE2 + } +} +impl core::ops::Deref for RSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RSIF`"] +#[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] pub struct RSIF_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receiver start event has not occurred."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIF`"] -pub type DLIF_R = crate::R; +#[doc = "Field `DLIF` reader - Data Lost Indication Flag"] +pub struct DLIF_R(crate::FieldReader); impl DLIF_R { + pub(crate) fn new(bits: bool) -> Self { + DLIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIF_A { @@ -563,15 +646,22 @@ impl DLIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIF_A::VALUE1 + **self == DLIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIF_A::VALUE2 + **self == DLIF_A::VALUE2 } } -#[doc = "Write proxy for field `DLIF`"] +impl core::ops::Deref for DLIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DLIF` writer - Data Lost Indication Flag"] pub struct DLIF_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A data lost event has not occurred."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIF`"] -pub type TSIF_R = crate::R; +#[doc = "Field `TSIF` reader - Transmit Shift Indication Flag"] +pub struct TSIF_R(crate::FieldReader); impl TSIF_R { + pub(crate) fn new(bits: bool) -> Self { + TSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIF_A { @@ -638,15 +729,22 @@ impl TSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIF_A::VALUE1 + **self == TSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIF_A::VALUE2 + **self == TSIF_A::VALUE2 } } -#[doc = "Write proxy for field `TSIF`"] +impl core::ops::Deref for TSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] pub struct TSIF_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit shift event has not occurred."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIF`"] -pub type TBIF_R = crate::R; +#[doc = "Field `TBIF` reader - Transmit Buffer Indication Flag"] +pub struct TBIF_R(crate::FieldReader); impl TBIF_R { + pub(crate) fn new(bits: bool) -> Self { + TBIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIF_A { @@ -713,15 +812,22 @@ impl TBIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIF_A::VALUE1 + **self == TBIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIF_A::VALUE2 + **self == TBIF_A::VALUE2 } } -#[doc = "Write proxy for field `TBIF`"] +impl core::ops::Deref for TBIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] pub struct TBIF_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer event has not occurred."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIF`"] -pub type RIF_R = crate::R; +#[doc = "Field `RIF` reader - Receive Indication Flag"] +pub struct RIF_R(crate::FieldReader); impl RIF_R { + pub(crate) fn new(bits: bool) -> Self { + RIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIF_A { @@ -788,15 +895,22 @@ impl RIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIF_A::VALUE1 + **self == RIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIF_A::VALUE2 + **self == RIF_A::VALUE2 + } +} +impl core::ops::Deref for RIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RIF`"] +#[doc = "Field `RIF` writer - Receive Indication Flag"] pub struct RIF_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive event has not occurred."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIF`"] -pub type AIF_R = crate::R; +#[doc = "Field `AIF` reader - Alternative Receive Indication Flag"] +pub struct AIF_R(crate::FieldReader); impl AIF_R { + pub(crate) fn new(bits: bool) -> Self { + AIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIF_A { @@ -863,15 +978,22 @@ impl AIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIF_A::VALUE1 + **self == AIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIF_A::VALUE2 + **self == AIF_A::VALUE2 } } -#[doc = "Write proxy for field `AIF`"] +impl core::ops::Deref for AIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] pub struct AIF_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive event has not occurred."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIF`"] -pub type BRGIF_R = crate::R; +#[doc = "Field `BRGIF` reader - Baud Rate Generator Indication Flag"] +pub struct BRGIF_R(crate::FieldReader); impl BRGIF_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIF_A { @@ -938,15 +1061,22 @@ impl BRGIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIF_A::VALUE1 + **self == BRGIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIF_A::VALUE2 + **self == BRGIF_A::VALUE2 + } +} +impl core::ops::Deref for BRGIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BRGIF`"] +#[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] pub struct BRGIF_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A baud rate generator event has not occurred."] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1118,4 +1246,30 @@ impl W { pub fn brgif(&mut self) -> BRGIF_W { BRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Register \\[IIS Mode\\]\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 [psr_iismode](index.html) module"] +pub struct PSR_IISMODE_SPEC; +impl crate::RegisterSpec for PSR_IISMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psr_iismode::R](R) reader structure"] +impl crate::Readable for PSR_IISMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psr_iismode::W](W) writer structure"] +impl crate::Writable for PSR_IISMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSR_IISMode to value 0"] +impl crate::Resettable for PSR_IISMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/psr_sscmode.rs b/src/usic0_ch0/psr_sscmode.rs index e6d95397..b38b81db 100644 --- a/src/usic0_ch0/psr_sscmode.rs +++ b/src/usic0_ch0/psr_sscmode.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register PSR_SSCMode"] -pub type R = crate::R; -#[doc = "Writer for register PSR_SSCMode"] -pub type W = crate::W; -#[doc = "Register PSR_SSCMode `reset()`'s with value 0"] -impl crate::ResetValue for super::PSR_SSCMODE { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `PSR_SSCMode` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSR_SSCMode` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "MSLS Status\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSLS`"] -pub type MSLS_R = crate::R; +#[doc = "Field `MSLS` reader - MSLS Status"] +pub struct MSLS_R(crate::FieldReader); impl MSLS_R { + pub(crate) fn new(bits: bool) -> Self { + MSLS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSLS_A { @@ -38,15 +65,22 @@ impl MSLS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSLS_A::VALUE1 + **self == MSLS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSLS_A::VALUE2 + **self == MSLS_A::VALUE2 + } +} +impl core::ops::Deref for MSLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `MSLS`"] +#[doc = "Field `MSLS` writer - MSLS Status"] pub struct MSLS_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> MSLS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSLS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The internal signal MSLS is inactive (0)."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> MSLS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2S`"] -pub type DX2S_R = crate::R; +#[doc = "Field `DX2S` reader - DX2S Status"] +pub struct DX2S_R(crate::FieldReader); impl DX2S_R { + pub(crate) fn new(bits: bool) -> Self { + DX2S_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2S_A { @@ -113,15 +148,22 @@ impl DX2S_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2S_A::VALUE1 + **self == DX2S_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2S_A::VALUE2 + **self == DX2S_A::VALUE2 + } +} +impl core::ops::Deref for DX2S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DX2S`"] +#[doc = "Field `DX2S` writer - DX2S Status"] pub struct DX2S_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> DX2S_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2S_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "DX2S is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> DX2S_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `MSLSEV`"] -pub type MSLSEV_R = crate::R; +#[doc = "Field `MSLSEV` reader - MSLS Event Detected"] +pub struct MSLSEV_R(crate::FieldReader); impl MSLSEV_R { + pub(crate) fn new(bits: bool) -> Self { + MSLSEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> MSLSEV_A { @@ -188,15 +231,22 @@ impl MSLSEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == MSLSEV_A::VALUE1 + **self == MSLSEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == MSLSEV_A::VALUE2 + **self == MSLSEV_A::VALUE2 } } -#[doc = "Write proxy for field `MSLSEV`"] +impl core::ops::Deref for MSLSEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSLSEV` writer - MSLS Event Detected"] pub struct MSLSEV_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> MSLSEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MSLSEV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The MSLS signal has not changed its state."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> MSLSEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DX2TEV`"] -pub type DX2TEV_R = crate::R; +#[doc = "Field `DX2TEV` reader - DX2T Event Detected"] +pub struct DX2TEV_R(crate::FieldReader); impl DX2TEV_R { + pub(crate) fn new(bits: bool) -> Self { + DX2TEV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DX2TEV_A { @@ -263,15 +314,22 @@ impl DX2TEV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DX2TEV_A::VALUE1 + **self == DX2TEV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DX2TEV_A::VALUE2 + **self == DX2TEV_A::VALUE2 } } -#[doc = "Write proxy for field `DX2TEV`"] +impl core::ops::Deref for DX2TEV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DX2TEV` writer - DX2T Event Detected"] pub struct DX2TEV_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> DX2TEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DX2TEV_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The DX2T signal has not been activated."] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> DX2TEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PARERR`"] -pub type PARERR_R = crate::R; +#[doc = "Field `PARERR` reader - Parity Error Event Detected"] +pub struct PARERR_R(crate::FieldReader); impl PARERR_R { + pub(crate) fn new(bits: bool) -> Self { + PARERR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PARERR_A { @@ -338,15 +397,22 @@ impl PARERR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PARERR_A::VALUE1 + **self == PARERR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PARERR_A::VALUE2 + **self == PARERR_A::VALUE2 + } +} +impl core::ops::Deref for PARERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PARERR`"] +#[doc = "Field `PARERR` writer - Parity Error Event Detected"] pub struct PARERR_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> PARERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PARERR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A parity error event has not been activated."] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> PARERR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RSIF`"] -pub type RSIF_R = crate::R; +#[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] +pub struct RSIF_R(crate::FieldReader); impl RSIF_R { + pub(crate) fn new(bits: bool) -> Self { + RSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RSIF_A { @@ -413,15 +480,22 @@ impl RSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RSIF_A::VALUE1 + **self == RSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RSIF_A::VALUE2 + **self == RSIF_A::VALUE2 } } -#[doc = "Write proxy for field `RSIF`"] +impl core::ops::Deref for RSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] pub struct RSIF_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receiver start event has not occurred."] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> RSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DLIF`"] -pub type DLIF_R = crate::R; +#[doc = "Field `DLIF` reader - Data Lost Indication Flag"] +pub struct DLIF_R(crate::FieldReader); impl DLIF_R { + pub(crate) fn new(bits: bool) -> Self { + DLIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DLIF_A { @@ -488,15 +563,22 @@ impl DLIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DLIF_A::VALUE1 + **self == DLIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DLIF_A::VALUE2 + **self == DLIF_A::VALUE2 + } +} +impl core::ops::Deref for DLIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DLIF`"] +#[doc = "Field `DLIF` writer - Data Lost Indication Flag"] pub struct DLIF_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DLIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A data lost event has not occurred."] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> DLIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSIF`"] -pub type TSIF_R = crate::R; +#[doc = "Field `TSIF` reader - Transmit Shift Indication Flag"] +pub struct TSIF_R(crate::FieldReader); impl TSIF_R { + pub(crate) fn new(bits: bool) -> Self { + TSIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSIF_A { @@ -563,15 +646,22 @@ impl TSIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSIF_A::VALUE1 + **self == TSIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSIF_A::VALUE2 + **self == TSIF_A::VALUE2 + } +} +impl core::ops::Deref for TSIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TSIF`"] +#[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] pub struct TSIF_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TSIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit shift event has not occurred."] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> TSIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBIF`"] -pub type TBIF_R = crate::R; +#[doc = "Field `TBIF` reader - Transmit Buffer Indication Flag"] +pub struct TBIF_R(crate::FieldReader); impl TBIF_R { + pub(crate) fn new(bits: bool) -> Self { + TBIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBIF_A { @@ -638,15 +729,22 @@ impl TBIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBIF_A::VALUE1 + **self == TBIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBIF_A::VALUE2 + **self == TBIF_A::VALUE2 + } +} +impl core::ops::Deref for TBIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TBIF`"] +#[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] pub struct TBIF_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer event has not occurred."] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> TBIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RIF`"] -pub type RIF_R = crate::R; +#[doc = "Field `RIF` reader - Receive Indication Flag"] +pub struct RIF_R(crate::FieldReader); impl RIF_R { + pub(crate) fn new(bits: bool) -> Self { + RIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RIF_A { @@ -713,15 +812,22 @@ impl RIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RIF_A::VALUE1 + **self == RIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RIF_A::VALUE2 + **self == RIF_A::VALUE2 + } +} +impl core::ops::Deref for RIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RIF`"] +#[doc = "Field `RIF` writer - Receive Indication Flag"] pub struct RIF_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive event has not occurred."] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> RIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `AIF`"] -pub type AIF_R = crate::R; +#[doc = "Field `AIF` reader - Alternative Receive Indication Flag"] +pub struct AIF_R(crate::FieldReader); impl AIF_R { + pub(crate) fn new(bits: bool) -> Self { + AIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AIF_A { @@ -788,15 +895,22 @@ impl AIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == AIF_A::VALUE1 + **self == AIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == AIF_A::VALUE2 + **self == AIF_A::VALUE2 + } +} +impl core::ops::Deref for AIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `AIF`"] +#[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] pub struct AIF_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive event has not occurred."] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> AIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BRGIF`"] -pub type BRGIF_R = crate::R; +#[doc = "Field `BRGIF` reader - Baud Rate Generator Indication Flag"] +pub struct BRGIF_R(crate::FieldReader); impl BRGIF_R { + pub(crate) fn new(bits: bool) -> Self { + BRGIF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BRGIF_A { @@ -863,15 +978,22 @@ impl BRGIF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BRGIF_A::VALUE1 + **self == BRGIF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BRGIF_A::VALUE2 + **self == BRGIF_A::VALUE2 + } +} +impl core::ops::Deref for BRGIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BRGIF`"] +#[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] pub struct BRGIF_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BRGIF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A baud rate generator event has not occurred."] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> BRGIF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -1033,4 +1153,30 @@ impl W { pub fn brgif(&mut self) -> BRGIF_W { BRGIF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Protocol Status Register \\[SSC Mode\\]\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 [psr_sscmode](index.html) module"] +pub struct PSR_SSCMODE_SPEC; +impl crate::RegisterSpec for PSR_SSCMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psr_sscmode::R](R) reader structure"] +impl crate::Readable for PSR_SSCMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psr_sscmode::W](W) writer structure"] +impl crate::Writable for PSR_SSCMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSR_SSCMode to value 0"] +impl crate::Resettable for PSR_SSCMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/rbctr.rs b/src/usic0_ch0/rbctr.rs index 4fd48f70..3b643733 100644 --- a/src/usic0_ch0/rbctr.rs +++ b/src/usic0_ch0/rbctr.rs @@ -1,16 +1,40 @@ -#[doc = "Reader of register RBCTR"] -pub type R = crate::R; -#[doc = "Writer for register RBCTR"] -pub type W = crate::W; -#[doc = "Register RBCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::RBCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RBCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RBCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `DPTR`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DPTR` writer - Data Pointer"] pub struct DPTR_W<'a> { w: &'a mut W, } @@ -18,13 +42,25 @@ impl<'a> DPTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `LIMIT`"] -pub type LIMIT_R = crate::R; -#[doc = "Write proxy for field `LIMIT`"] +#[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"] +pub struct LIMIT_R(crate::FieldReader); +impl LIMIT_R { + pub(crate) fn new(bits: u8) -> Self { + LIMIT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LIMIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"] pub struct LIMIT_W<'a> { w: &'a mut W, } @@ -32,7 +68,7 @@ impl<'a> LIMIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } @@ -50,9 +86,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRBTM`"] -pub type SRBTM_R = crate::R; +#[doc = "Field `SRBTM` reader - Standard Receive Buffer Trigger Mode"] +pub struct SRBTM_R(crate::FieldReader); impl SRBTM_R { + pub(crate) fn new(bits: bool) -> Self { + SRBTM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRBTM_A { @@ -64,15 +103,22 @@ impl SRBTM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBTM_A::VALUE1 + **self == SRBTM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBTM_A::VALUE2 + **self == SRBTM_A::VALUE2 } } -#[doc = "Write proxy for field `SRBTM`"] +impl core::ops::Deref for SRBTM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRBTM` writer - Standard Receive Buffer Trigger Mode"] pub struct SRBTM_W<'a> { w: &'a mut W, } @@ -80,9 +126,7 @@ impl<'a> SRBTM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRBTM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trigger mode 0: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=RBCTR.LIMIT."] #[inline(always)] @@ -107,7 +151,7 @@ impl<'a> SRBTM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -125,9 +169,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRBTEN`"] -pub type SRBTEN_R = crate::R; +#[doc = "Field `SRBTEN` reader - Standard Receive Buffer Trigger Enable"] +pub struct SRBTEN_R(crate::FieldReader); impl SRBTEN_R { + pub(crate) fn new(bits: bool) -> Self { + SRBTEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRBTEN_A { @@ -139,15 +186,22 @@ impl SRBTEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBTEN_A::VALUE1 + **self == SRBTEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBTEN_A::VALUE2 + **self == SRBTEN_A::VALUE2 } } -#[doc = "Write proxy for field `SRBTEN`"] +impl core::ops::Deref for SRBTEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRBTEN` writer - Standard Receive Buffer Trigger Enable"] pub struct SRBTEN_W<'a> { w: &'a mut W, } @@ -155,9 +209,7 @@ impl<'a> SRBTEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRBTEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."] #[inline(always)] @@ -182,7 +234,7 @@ impl<'a> SRBTEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -209,55 +261,64 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRBINP`"] -pub type SRBINP_R = crate::R; +#[doc = "Field `SRBINP` reader - Standard Receive Buffer Interrupt Node Pointer"] +pub struct SRBINP_R(crate::FieldReader); impl SRBINP_R { + pub(crate) fn new(bits: u8) -> Self { + SRBINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRBINP_A::VALUE1), - 1 => Val(SRBINP_A::VALUE2), - 2 => Val(SRBINP_A::VALUE3), - 3 => Val(SRBINP_A::VALUE4), - 4 => Val(SRBINP_A::VALUE5), - 5 => Val(SRBINP_A::VALUE6), - i => Res(i), + 0 => Some(SRBINP_A::VALUE1), + 1 => Some(SRBINP_A::VALUE2), + 2 => Some(SRBINP_A::VALUE3), + 3 => Some(SRBINP_A::VALUE4), + 4 => Some(SRBINP_A::VALUE5), + 5 => Some(SRBINP_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBINP_A::VALUE1 + **self == SRBINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBINP_A::VALUE2 + **self == SRBINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SRBINP_A::VALUE3 + **self == SRBINP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SRBINP_A::VALUE4 + **self == SRBINP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SRBINP_A::VALUE5 + **self == SRBINP_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SRBINP_A::VALUE6 + **self == SRBINP_A::VALUE6 } } -#[doc = "Write proxy for field `SRBINP`"] +impl core::ops::Deref for SRBINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRBINP` writer - Standard Receive Buffer Interrupt Node Pointer"] pub struct SRBINP_W<'a> { w: &'a mut W, } @@ -300,7 +361,7 @@ impl<'a> SRBINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -327,55 +388,64 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ARBINP`"] -pub type ARBINP_R = crate::R; +#[doc = "Field `ARBINP` reader - Alternative Receive Buffer Interrupt Node Pointer"] +pub struct ARBINP_R(crate::FieldReader); impl ARBINP_R { + pub(crate) fn new(bits: u8) -> Self { + ARBINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ARBINP_A::VALUE1), - 1 => Val(ARBINP_A::VALUE2), - 2 => Val(ARBINP_A::VALUE3), - 3 => Val(ARBINP_A::VALUE4), - 4 => Val(ARBINP_A::VALUE5), - 5 => Val(ARBINP_A::VALUE6), - i => Res(i), + 0 => Some(ARBINP_A::VALUE1), + 1 => Some(ARBINP_A::VALUE2), + 2 => Some(ARBINP_A::VALUE3), + 3 => Some(ARBINP_A::VALUE4), + 4 => Some(ARBINP_A::VALUE5), + 5 => Some(ARBINP_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARBINP_A::VALUE1 + **self == ARBINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARBINP_A::VALUE2 + **self == ARBINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ARBINP_A::VALUE3 + **self == ARBINP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ARBINP_A::VALUE4 + **self == ARBINP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == ARBINP_A::VALUE5 + **self == ARBINP_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == ARBINP_A::VALUE6 + **self == ARBINP_A::VALUE6 + } +} +impl core::ops::Deref for ARBINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARBINP`"] +#[doc = "Field `ARBINP` writer - Alternative Receive Buffer Interrupt Node Pointer"] pub struct ARBINP_W<'a> { w: &'a mut W, } @@ -418,7 +488,7 @@ impl<'a> ARBINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } @@ -451,9 +521,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `RCIM`"] -pub type RCIM_R = crate::R; +#[doc = "Field `RCIM` reader - Receiver Control Information Mode"] +pub struct RCIM_R(crate::FieldReader); impl RCIM_R { + pub(crate) fn new(bits: u8) -> Self { + RCIM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RCIM_A { @@ -468,25 +541,32 @@ impl RCIM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RCIM_A::VALUE1 + **self == RCIM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RCIM_A::VALUE2 + **self == RCIM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == RCIM_A::VALUE3 + **self == RCIM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == RCIM_A::VALUE4 + **self == RCIM_A::VALUE4 + } +} +impl core::ops::Deref for RCIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RCIM`"] +#[doc = "Field `RCIM` writer - Receiver Control Information Mode"] pub struct RCIM_W<'a> { w: &'a mut W, } @@ -494,9 +574,7 @@ impl<'a> RCIM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RCIM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "RCI\\[4\\] = PERR, RCI\\[3:0\\] @@ -531,7 +609,7 @@ impl<'a> RCIM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22); + self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22); self.w } } @@ -560,61 +638,70 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; +#[doc = "Field `SIZE` reader - Buffer Size"] +pub struct SIZE_R(crate::FieldReader); impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SIZE_A::VALUE1), - 1 => Val(SIZE_A::VALUE2), - 2 => Val(SIZE_A::VALUE3), - 3 => Val(SIZE_A::VALUE4), - 4 => Val(SIZE_A::VALUE5), - 5 => Val(SIZE_A::VALUE6), - 6 => Val(SIZE_A::VALUE7), - i => Res(i), + 0 => Some(SIZE_A::VALUE1), + 1 => Some(SIZE_A::VALUE2), + 2 => Some(SIZE_A::VALUE3), + 3 => Some(SIZE_A::VALUE4), + 4 => Some(SIZE_A::VALUE5), + 5 => Some(SIZE_A::VALUE6), + 6 => Some(SIZE_A::VALUE7), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIZE_A::VALUE1 + **self == SIZE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIZE_A::VALUE2 + **self == SIZE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SIZE_A::VALUE3 + **self == SIZE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SIZE_A::VALUE4 + **self == SIZE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SIZE_A::VALUE5 + **self == SIZE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SIZE_A::VALUE6 + **self == SIZE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SIZE_A::VALUE7 + **self == SIZE_A::VALUE7 + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` writer - Buffer Size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -662,7 +749,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -682,9 +769,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RNM`"] -pub type RNM_R = crate::R; +#[doc = "Field `RNM` reader - Receiver Notification Mode"] +pub struct RNM_R(crate::FieldReader); impl RNM_R { + pub(crate) fn new(bits: bool) -> Self { + RNM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RNM_A { @@ -696,15 +786,22 @@ impl RNM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RNM_A::VALUE1 + **self == RNM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RNM_A::VALUE2 + **self == RNM_A::VALUE2 + } +} +impl core::ops::Deref for RNM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RNM`"] +#[doc = "Field `RNM` writer - Receiver Notification Mode"] pub struct RNM_W<'a> { w: &'a mut W, } @@ -712,9 +809,7 @@ impl<'a> RNM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RNM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Filling level mode: A standard receive buffer event occurs when the filling level equals the limit value and changes, either due to a read access from OUTR (LOF = 0) or due to a new received data word (LOF = 1)."] #[inline(always)] @@ -741,7 +836,7 @@ impl<'a> RNM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27); + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); self.w } } @@ -759,9 +854,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LOF`"] -pub type LOF_R = crate::R; +#[doc = "Field `LOF` reader - Buffer Event on Limit Overflow"] +pub struct LOF_R(crate::FieldReader); impl LOF_R { + pub(crate) fn new(bits: bool) -> Self { + LOF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOF_A { @@ -773,15 +871,22 @@ impl LOF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOF_A::VALUE1 + **self == LOF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOF_A::VALUE2 + **self == LOF_A::VALUE2 + } +} +impl core::ops::Deref for LOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOF`"] +#[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"] pub struct LOF_W<'a> { w: &'a mut W, } @@ -789,9 +894,7 @@ impl<'a> LOF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LOF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets lower due to a read access from OUTR."] #[inline(always)] @@ -816,7 +919,7 @@ impl<'a> LOF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -834,9 +937,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ARBIEN`"] -pub type ARBIEN_R = crate::R; +#[doc = "Field `ARBIEN` reader - Alternative Receive Buffer Interrupt Enable"] +pub struct ARBIEN_R(crate::FieldReader); impl ARBIEN_R { + pub(crate) fn new(bits: bool) -> Self { + ARBIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARBIEN_A { @@ -848,15 +954,22 @@ impl ARBIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARBIEN_A::VALUE1 + **self == ARBIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARBIEN_A::VALUE2 + **self == ARBIEN_A::VALUE2 + } +} +impl core::ops::Deref for ARBIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARBIEN`"] +#[doc = "Field `ARBIEN` writer - Alternative Receive Buffer Interrupt Enable"] pub struct ARBIEN_W<'a> { w: &'a mut W, } @@ -864,9 +977,7 @@ impl<'a> ARBIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARBIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The alternative receive buffer interrupt generation is disabled."] #[inline(always)] @@ -891,7 +1002,7 @@ impl<'a> ARBIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -909,9 +1020,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRBIEN`"] -pub type SRBIEN_R = crate::R; +#[doc = "Field `SRBIEN` reader - Standard Receive Buffer Interrupt Enable"] +pub struct SRBIEN_R(crate::FieldReader); impl SRBIEN_R { + pub(crate) fn new(bits: bool) -> Self { + SRBIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRBIEN_A { @@ -923,15 +1037,22 @@ impl SRBIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBIEN_A::VALUE1 + **self == SRBIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBIEN_A::VALUE2 + **self == SRBIEN_A::VALUE2 + } +} +impl core::ops::Deref for SRBIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRBIEN`"] +#[doc = "Field `SRBIEN` writer - Standard Receive Buffer Interrupt Enable"] pub struct SRBIEN_W<'a> { w: &'a mut W, } @@ -939,9 +1060,7 @@ impl<'a> SRBIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRBIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The standard receive buffer interrupt generation is disabled."] #[inline(always)] @@ -966,7 +1085,7 @@ impl<'a> SRBIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -984,9 +1103,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RBERIEN`"] -pub type RBERIEN_R = crate::R; +#[doc = "Field `RBERIEN` reader - Receive Buffer Error Interrupt Enable"] +pub struct RBERIEN_R(crate::FieldReader); impl RBERIEN_R { + pub(crate) fn new(bits: bool) -> Self { + RBERIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RBERIEN_A { @@ -998,15 +1120,22 @@ impl RBERIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RBERIEN_A::VALUE1 + **self == RBERIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RBERIEN_A::VALUE2 + **self == RBERIEN_A::VALUE2 + } +} +impl core::ops::Deref for RBERIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RBERIEN`"] +#[doc = "Field `RBERIEN` writer - Receive Buffer Error Interrupt Enable"] pub struct RBERIEN_W<'a> { w: &'a mut W, } @@ -1014,9 +1143,7 @@ impl<'a> RBERIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RBERIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The receive buffer error interrupt generation is disabled."] #[inline(always)] @@ -1041,7 +1168,7 @@ impl<'a> RBERIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -1173,4 +1300,30 @@ impl W { pub fn rberien(&mut self) -> RBERIEN_W { RBERIEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receiver Buffer Control Register\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 [rbctr](index.html) module"] +pub struct RBCTR_SPEC; +impl crate::RegisterSpec for RBCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbctr::R](R) reader structure"] +impl crate::Readable for RBCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rbctr::W](W) writer structure"] +impl crate::Writable for RBCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RBCTR to value 0"] +impl crate::Resettable for RBCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/rbuf.rs b/src/usic0_ch0/rbuf.rs index b69259d2..0a8295d1 100644 --- a/src/usic0_ch0/rbuf.rs +++ b/src/usic0_ch0/rbuf.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RBUF"] -pub type R = crate::R; -#[doc = "Reader of field `DSR`"] -pub type DSR_R = crate::R; +#[doc = "Register `RBUF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR` reader - Received Data"] +pub struct DSR_R(crate::FieldReader); +impl DSR_R { + pub(crate) fn new(bits: u16) -> Self { + DSR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Received Data"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DSR_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Receiver Buffer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf](index.html) module"] +pub struct RBUF_SPEC; +impl crate::RegisterSpec for RBUF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbuf::R](R) reader structure"] +impl crate::Readable for RBUF_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUF to value 0"] +impl crate::Resettable for RBUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/rbuf0.rs b/src/usic0_ch0/rbuf0.rs index aa2c97f9..cd30e7de 100644 --- a/src/usic0_ch0/rbuf0.rs +++ b/src/usic0_ch0/rbuf0.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RBUF0"] -pub type R = crate::R; -#[doc = "Reader of field `DSR0`"] -pub type DSR0_R = crate::R; +#[doc = "Register `RBUF0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR0` reader - Data of Shift Registers 0\\[3:0\\]"] +pub struct DSR0_R(crate::FieldReader); +impl DSR0_R { + pub(crate) fn new(bits: u16) -> Self { + DSR0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Data of Shift Registers 0\\[3:0\\]"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DSR0_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Receiver Buffer Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf0](index.html) module"] +pub struct RBUF0_SPEC; +impl crate::RegisterSpec for RBUF0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbuf0::R](R) reader structure"] +impl crate::Readable for RBUF0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUF0 to value 0"] +impl crate::Resettable for RBUF0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/rbuf01sr.rs b/src/usic0_ch0/rbuf01sr.rs index 0c63ff91..a8c43444 100644 --- a/src/usic0_ch0/rbuf01sr.rs +++ b/src/usic0_ch0/rbuf01sr.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RBUF01SR"] -pub type R = crate::R; -#[doc = "Reader of field `WLEN0`"] -pub type WLEN0_R = crate::R; +#[doc = "Register `RBUF01SR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `WLEN0` reader - Received Data Word Length in RBUF0"] +pub struct WLEN0_R(crate::FieldReader); +impl WLEN0_R { + pub(crate) fn new(bits: u8) -> Self { + WLEN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WLEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Start of Frame in RBUF0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SOF0_A { @@ -16,9 +41,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOF0`"] -pub type SOF0_R = crate::R; +#[doc = "Field `SOF0` reader - Start of Frame in RBUF0"] +pub struct SOF0_R(crate::FieldReader); impl SOF0_R { + pub(crate) fn new(bits: bool) -> Self { + SOF0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOF0_A { @@ -30,16 +58,35 @@ impl SOF0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOF0_A::VALUE1 + **self == SOF0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOF0_A::VALUE2 + **self == SOF0_A::VALUE2 + } +} +impl core::ops::Deref for SOF0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAR0` reader - Protocol-Related Argument in RBUF0"] +pub struct PAR0_R(crate::FieldReader); +impl PAR0_R { + pub(crate) fn new(bits: bool) -> Self { + PAR0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PAR0`"] -pub type PAR0_R = crate::R; #[doc = "Protocol-related Error in RBUF0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PERR0_A { @@ -54,9 +101,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PERR0`"] -pub type PERR0_R = crate::R; +#[doc = "Field `PERR0` reader - Protocol-related Error in RBUF0"] +pub struct PERR0_R(crate::FieldReader); impl PERR0_R { + pub(crate) fn new(bits: bool) -> Self { + PERR0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PERR0_A { @@ -68,12 +118,19 @@ impl PERR0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PERR0_A::VALUE1 + **self == PERR0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PERR0_A::VALUE2 + **self == PERR0_A::VALUE2 + } +} +impl core::ops::Deref for PERR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Data Valid in RBUF0\n\nValue on reset: 0"] @@ -90,9 +147,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDV00`"] -pub type RDV00_R = crate::R; +#[doc = "Field `RDV00` reader - Receive Data Valid in RBUF0"] +pub struct RDV00_R(crate::FieldReader); impl RDV00_R { + pub(crate) fn new(bits: bool) -> Self { + RDV00_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDV00_A { @@ -104,12 +164,19 @@ impl RDV00_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDV00_A::VALUE1 + **self == RDV00_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDV00_A::VALUE2 + **self == RDV00_A::VALUE2 + } +} +impl core::ops::Deref for RDV00_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Data Valid in RBUF1\n\nValue on reset: 0"] @@ -126,9 +193,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDV01`"] -pub type RDV01_R = crate::R; +#[doc = "Field `RDV01` reader - Receive Data Valid in RBUF1"] +pub struct RDV01_R(crate::FieldReader); impl RDV01_R { + pub(crate) fn new(bits: bool) -> Self { + RDV01_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDV01_A { @@ -140,12 +210,19 @@ impl RDV01_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDV01_A::VALUE1 + **self == RDV01_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDV01_A::VALUE2 + **self == RDV01_A::VALUE2 + } +} +impl core::ops::Deref for RDV01_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Data Source\n\nValue on reset: 0"] @@ -162,9 +239,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DS0`"] -pub type DS0_R = crate::R; +#[doc = "Field `DS0` reader - Data Source"] +pub struct DS0_R(crate::FieldReader); impl DS0_R { + pub(crate) fn new(bits: bool) -> Self { + DS0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DS0_A { @@ -176,12 +256,19 @@ impl DS0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DS0_A::VALUE1 + **self == DS0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DS0_A::VALUE2 + **self == DS0_A::VALUE2 + } +} +impl core::ops::Deref for DS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Received Data Word Length in RBUF1\n\nValue on reset: 0"] @@ -199,28 +286,37 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `WLEN1`"] -pub type WLEN1_R = crate::R; +#[doc = "Field `WLEN1` reader - Received Data Word Length in RBUF1"] +pub struct WLEN1_R(crate::FieldReader); impl WLEN1_R { + pub(crate) fn new(bits: u8) -> Self { + WLEN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(WLEN1_A::VALUE1), - 15 => Val(WLEN1_A::VALUE2), - i => Res(i), + 0 => Some(WLEN1_A::VALUE1), + 15 => Some(WLEN1_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WLEN1_A::VALUE1 + **self == WLEN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WLEN1_A::VALUE2 + **self == WLEN1_A::VALUE2 + } +} +impl core::ops::Deref for WLEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Start of Frame in RBUF1\n\nValue on reset: 0"] @@ -237,9 +333,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOF1`"] -pub type SOF1_R = crate::R; +#[doc = "Field `SOF1` reader - Start of Frame in RBUF1"] +pub struct SOF1_R(crate::FieldReader); impl SOF1_R { + pub(crate) fn new(bits: bool) -> Self { + SOF1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOF1_A { @@ -251,16 +350,35 @@ impl SOF1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOF1_A::VALUE1 + **self == SOF1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOF1_A::VALUE2 + **self == SOF1_A::VALUE2 + } +} +impl core::ops::Deref for SOF1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAR1` reader - Protocol-Related Argument in RBUF1"] +pub struct PAR1_R(crate::FieldReader); +impl PAR1_R { + pub(crate) fn new(bits: bool) -> Self { + PAR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `PAR1`"] -pub type PAR1_R = crate::R; #[doc = "Protocol-related Error in RBUF1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PERR1_A { @@ -275,9 +393,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PERR1`"] -pub type PERR1_R = crate::R; +#[doc = "Field `PERR1` reader - Protocol-related Error in RBUF1"] +pub struct PERR1_R(crate::FieldReader); impl PERR1_R { + pub(crate) fn new(bits: bool) -> Self { + PERR1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PERR1_A { @@ -289,12 +410,19 @@ impl PERR1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PERR1_A::VALUE1 + **self == PERR1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PERR1_A::VALUE2 + **self == PERR1_A::VALUE2 + } +} +impl core::ops::Deref for PERR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Data Valid in RBUF0\n\nValue on reset: 0"] @@ -311,9 +439,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDV10`"] -pub type RDV10_R = crate::R; +#[doc = "Field `RDV10` reader - Receive Data Valid in RBUF0"] +pub struct RDV10_R(crate::FieldReader); impl RDV10_R { + pub(crate) fn new(bits: bool) -> Self { + RDV10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDV10_A { @@ -325,12 +456,19 @@ impl RDV10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDV10_A::VALUE1 + **self == RDV10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDV10_A::VALUE2 + **self == RDV10_A::VALUE2 + } +} +impl core::ops::Deref for RDV10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Data Valid in RBUF1\n\nValue on reset: 0"] @@ -347,9 +485,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RDV11`"] -pub type RDV11_R = crate::R; +#[doc = "Field `RDV11` reader - Receive Data Valid in RBUF1"] +pub struct RDV11_R(crate::FieldReader); impl RDV11_R { + pub(crate) fn new(bits: bool) -> Self { + RDV11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDV11_A { @@ -361,12 +502,19 @@ impl RDV11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RDV11_A::VALUE1 + **self == RDV11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RDV11_A::VALUE2 + **self == RDV11_A::VALUE2 + } +} +impl core::ops::Deref for RDV11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Data Source\n\nValue on reset: 0"] @@ -383,9 +531,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DS1`"] -pub type DS1_R = crate::R; +#[doc = "Field `DS1` reader - Data Source"] +pub struct DS1_R(crate::FieldReader); impl DS1_R { + pub(crate) fn new(bits: bool) -> Self { + DS1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DS1_A { @@ -397,12 +548,19 @@ impl DS1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DS1_A::VALUE1 + **self == DS1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DS1_A::VALUE2 + **self == DS1_A::VALUE2 + } +} +impl core::ops::Deref for DS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -477,3 +635,19 @@ impl R { DS1_R::new(((self.bits >> 31) & 0x01) != 0) } } +#[doc = "Receiver Buffer 01 Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf01sr](index.html) module"] +pub struct RBUF01SR_SPEC; +impl crate::RegisterSpec for RBUF01SR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbuf01sr::R](R) reader structure"] +impl crate::Readable for RBUF01SR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUF01SR to value 0"] +impl crate::Resettable for RBUF01SR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/rbuf1.rs b/src/usic0_ch0/rbuf1.rs index e98d7302..4550aae1 100644 --- a/src/usic0_ch0/rbuf1.rs +++ b/src/usic0_ch0/rbuf1.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RBUF1"] -pub type R = crate::R; -#[doc = "Reader of field `DSR1`"] -pub type DSR1_R = crate::R; +#[doc = "Register `RBUF1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR1` reader - Data of Shift Registers 1\\[3:0\\]"] +pub struct DSR1_R(crate::FieldReader); +impl DSR1_R { + pub(crate) fn new(bits: u16) -> Self { + DSR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Data of Shift Registers 1\\[3:0\\]"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DSR1_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Receiver Buffer Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbuf1](index.html) module"] +pub struct RBUF1_SPEC; +impl crate::RegisterSpec for RBUF1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbuf1::R](R) reader structure"] +impl crate::Readable for RBUF1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUF1 to value 0"] +impl crate::Resettable for RBUF1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/rbufd.rs b/src/usic0_ch0/rbufd.rs index 117ecb09..11ecfbf8 100644 --- a/src/usic0_ch0/rbufd.rs +++ b/src/usic0_ch0/rbufd.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register RBUFD"] -pub type R = crate::R; -#[doc = "Reader of field `DSR`"] -pub type DSR_R = crate::R; +#[doc = "Register `RBUFD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DSR` reader - Data from Shift Register"] +pub struct DSR_R(crate::FieldReader); +impl DSR_R { + pub(crate) fn new(bits: u16) -> Self { + DSR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:15 - Data from Shift Register"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { DSR_R::new((self.bits & 0xffff) as u16) } } +#[doc = "Receiver Buffer Register for Debugger\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbufd](index.html) module"] +pub struct RBUFD_SPEC; +impl crate::RegisterSpec for RBUFD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbufd::R](R) reader structure"] +impl crate::Readable for RBUFD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUFD to value 0"] +impl crate::Resettable for RBUFD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/rbufsr.rs b/src/usic0_ch0/rbufsr.rs index df5c7500..28d5e097 100644 --- a/src/usic0_ch0/rbufsr.rs +++ b/src/usic0_ch0/rbufsr.rs @@ -1,19 +1,116 @@ -#[doc = "Reader of register RBUFSR"] -pub type R = crate::R; -#[doc = "Reader of field `WLEN`"] -pub type WLEN_R = crate::R; -#[doc = "Reader of field `SOF`"] -pub type SOF_R = crate::R; -#[doc = "Reader of field `PAR`"] -pub type PAR_R = crate::R; -#[doc = "Reader of field `PERR`"] -pub type PERR_R = crate::R; -#[doc = "Reader of field `RDV0`"] -pub type RDV0_R = crate::R; -#[doc = "Reader of field `RDV1`"] -pub type RDV1_R = crate::R; -#[doc = "Reader of field `DS`"] -pub type DS_R = crate::R; +#[doc = "Register `RBUFSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `WLEN` reader - Received Data Word Length in RBUF or RBUFD"] +pub struct WLEN_R(crate::FieldReader); +impl WLEN_R { + pub(crate) fn new(bits: u8) -> Self { + WLEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SOF` reader - Start of Frame in RBUF or RBUFD"] +pub struct SOF_R(crate::FieldReader); +impl SOF_R { + pub(crate) fn new(bits: bool) -> Self { + SOF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PAR` reader - Protocol-Related Argument in RBUF or RBUFD"] +pub struct PAR_R(crate::FieldReader); +impl PAR_R { + pub(crate) fn new(bits: bool) -> Self { + PAR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERR` reader - Protocol-related Error in RBUF or RBUFD"] +pub struct PERR_R(crate::FieldReader); +impl PERR_R { + pub(crate) fn new(bits: bool) -> Self { + PERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RDV0` reader - Receive Data Valid in RBUF or RBUFD"] +pub struct RDV0_R(crate::FieldReader); +impl RDV0_R { + pub(crate) fn new(bits: bool) -> Self { + RDV0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RDV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RDV1` reader - Receive Data Valid in RBUF or RBUFD"] +pub struct RDV1_R(crate::FieldReader); +impl RDV1_R { + pub(crate) fn new(bits: bool) -> Self { + RDV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RDV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DS` reader - Data Source of RBUF or RBUFD"] +pub struct DS_R(crate::FieldReader); +impl DS_R { + pub(crate) fn new(bits: bool) -> Self { + DS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:3 - Received Data Word Length in RBUF or RBUFD"] #[inline(always)] @@ -51,3 +148,19 @@ impl R { DS_R::new(((self.bits >> 15) & 0x01) != 0) } } +#[doc = "Receiver Buffer Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rbufsr](index.html) module"] +pub struct RBUFSR_SPEC; +impl crate::RegisterSpec for RBUFSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rbufsr::R](R) reader structure"] +impl crate::Readable for RBUFSR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RBUFSR to value 0"] +impl crate::Resettable for RBUFSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/sctr.rs b/src/usic0_ch0/sctr.rs index 00f6450d..477ce772 100644 --- a/src/usic0_ch0/sctr.rs +++ b/src/usic0_ch0/sctr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SCTR"] -pub type R = crate::R; -#[doc = "Writer for register SCTR"] -pub type W = crate::W; -#[doc = "Register SCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::SCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Shift Direction\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SDIR`"] -pub type SDIR_R = crate::R; +#[doc = "Field `SDIR` reader - Shift Direction"] +pub struct SDIR_R(crate::FieldReader); impl SDIR_R { + pub(crate) fn new(bits: bool) -> Self { + SDIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SDIR_A { @@ -38,15 +65,22 @@ impl SDIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SDIR_A::VALUE1 + **self == SDIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SDIR_A::VALUE2 + **self == SDIR_A::VALUE2 } } -#[doc = "Write proxy for field `SDIR`"] +impl core::ops::Deref for SDIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SDIR` writer - Shift Direction"] pub struct SDIR_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SDIR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SDIR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Shift LSB first. The first data bit of a data word is located at bit position 0."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDL`"] -pub type PDL_R = crate::R; +#[doc = "Field `PDL` reader - Passive Data Level"] +pub struct PDL_R(crate::FieldReader); impl PDL_R { + pub(crate) fn new(bits: bool) -> Self { + PDL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDL_A { @@ -113,15 +148,22 @@ impl PDL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDL_A::VALUE1 + **self == PDL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDL_A::VALUE2 + **self == PDL_A::VALUE2 + } +} +impl core::ops::Deref for PDL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDL`"] +#[doc = "Field `PDL` writer - Passive Data Level"] pub struct PDL_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> PDL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The passive data level is 0."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> PDL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -179,37 +219,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DSM`"] -pub type DSM_R = crate::R; +#[doc = "Field `DSM` reader - Data Shift Mode"] +pub struct DSM_R(crate::FieldReader); impl DSM_R { + pub(crate) fn new(bits: u8) -> Self { + DSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DSM_A::VALUE1), - 2 => Val(DSM_A::VALUE3), - 3 => Val(DSM_A::VALUE4), - i => Res(i), + 0 => Some(DSM_A::VALUE1), + 2 => Some(DSM_A::VALUE3), + 3 => Some(DSM_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DSM_A::VALUE1 + **self == DSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DSM_A::VALUE3 + **self == DSM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DSM_A::VALUE4 + **self == DSM_A::VALUE4 } } -#[doc = "Write proxy for field `DSM`"] +impl core::ops::Deref for DSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSM` writer - Data Shift Mode"] pub struct DSM_W<'a> { w: &'a mut W, } @@ -239,7 +288,7 @@ respectively."] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); self.w } } @@ -257,9 +306,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HPCDIR`"] -pub type HPCDIR_R = crate::R; +#[doc = "Field `HPCDIR` reader - Port Control Direction"] +pub struct HPCDIR_R(crate::FieldReader); impl HPCDIR_R { + pub(crate) fn new(bits: bool) -> Self { + HPCDIR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HPCDIR_A { @@ -271,15 +323,22 @@ impl HPCDIR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HPCDIR_A::VALUE1 + **self == HPCDIR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HPCDIR_A::VALUE2 + **self == HPCDIR_A::VALUE2 + } +} +impl core::ops::Deref for HPCDIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HPCDIR`"] +#[doc = "Field `HPCDIR` writer - Port Control Direction"] pub struct HPCDIR_W<'a> { w: &'a mut W, } @@ -287,9 +346,7 @@ impl<'a> HPCDIR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HPCDIR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The pin(s) with hardware pin control enabled are selected to be in input mode."] #[inline(always)] @@ -314,7 +371,7 @@ impl<'a> HPCDIR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -333,31 +390,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DOCFG`"] -pub type DOCFG_R = crate::R; +#[doc = "Field `DOCFG` reader - Data Output Configuration"] +pub struct DOCFG_R(crate::FieldReader); impl DOCFG_R { + pub(crate) fn new(bits: u8) -> Self { + DOCFG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DOCFG_A::VALUE1), - 1 => Val(DOCFG_A::VALUE2), - i => Res(i), + 0 => Some(DOCFG_A::VALUE1), + 1 => Some(DOCFG_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DOCFG_A::VALUE1 + **self == DOCFG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DOCFG_A::VALUE2 + **self == DOCFG_A::VALUE2 } } -#[doc = "Write proxy for field `DOCFG`"] +impl core::ops::Deref for DOCFG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DOCFG` writer - Data Output Configuration"] pub struct DOCFG_W<'a> { w: &'a mut W, } @@ -380,7 +446,7 @@ impl<'a> DOCFG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -403,9 +469,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TRM`"] -pub type TRM_R = crate::R; +#[doc = "Field `TRM` reader - Transmission Mode"] +pub struct TRM_R(crate::FieldReader); impl TRM_R { + pub(crate) fn new(bits: u8) -> Self { + TRM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRM_A { @@ -420,25 +489,32 @@ impl TRM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TRM_A::VALUE1 + **self == TRM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TRM_A::VALUE2 + **self == TRM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TRM_A::VALUE3 + **self == TRM_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TRM_A::VALUE4 + **self == TRM_A::VALUE4 } } -#[doc = "Write proxy for field `TRM`"] +impl core::ops::Deref for TRM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRM` writer - Transmission Mode"] pub struct TRM_W<'a> { w: &'a mut W, } @@ -446,9 +522,7 @@ impl<'a> TRM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRM_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "The shift control signal is considered as inactive and data frame transfers are not possible."] #[inline(always)] @@ -473,13 +547,25 @@ impl<'a> TRM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } -#[doc = "Reader of field `FLE`"] -pub type FLE_R = crate::R; -#[doc = "Write proxy for field `FLE`"] +#[doc = "Field `FLE` reader - Frame Length"] +pub struct FLE_R(crate::FieldReader); +impl FLE_R { + pub(crate) fn new(bits: u8) -> Self { + FLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FLE` writer - Frame Length"] pub struct FLE_W<'a> { w: &'a mut W, } @@ -487,7 +573,7 @@ impl<'a> FLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 16)) | (((value as u32) & 0x3f) << 16); + self.w.bits = (self.w.bits & !(0x3f << 16)) | ((value as u32 & 0x3f) << 16); self.w } } @@ -510,43 +596,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `WLE`"] -pub type WLE_R = crate::R; +#[doc = "Field `WLE` reader - Word Length"] +pub struct WLE_R(crate::FieldReader); impl WLE_R { + pub(crate) fn new(bits: u8) -> Self { + WLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(WLE_A::VALUE1), - 1 => Val(WLE_A::VALUE2), - 14 => Val(WLE_A::VALUE3), - 15 => Val(WLE_A::VALUE4), - i => Res(i), + 0 => Some(WLE_A::VALUE1), + 1 => Some(WLE_A::VALUE2), + 14 => Some(WLE_A::VALUE3), + 15 => Some(WLE_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WLE_A::VALUE1 + **self == WLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WLE_A::VALUE2 + **self == WLE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == WLE_A::VALUE3 + **self == WLE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == WLE_A::VALUE4 + **self == WLE_A::VALUE4 + } +} +impl core::ops::Deref for WLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WLE`"] +#[doc = "Field `WLE` writer - Word Length"] pub struct WLE_W<'a> { w: &'a mut W, } @@ -579,7 +674,7 @@ impl<'a> WLE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -666,4 +761,30 @@ impl W { pub fn wle(&mut self) -> WLE_W { WLE_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shift Control Register\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 [sctr](index.html) module"] +pub struct SCTR_SPEC; +impl crate::RegisterSpec for SCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sctr::R](R) reader structure"] +impl crate::Readable for SCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sctr::W](W) writer structure"] +impl crate::Writable for SCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCTR to value 0"] +impl crate::Resettable for SCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/tbctr.rs b/src/usic0_ch0/tbctr.rs index e7b5ca07..a5f772a4 100644 --- a/src/usic0_ch0/tbctr.rs +++ b/src/usic0_ch0/tbctr.rs @@ -1,16 +1,40 @@ -#[doc = "Reader of register TBCTR"] -pub type R = crate::R; -#[doc = "Writer for register TBCTR"] -pub type W = crate::W; -#[doc = "Register TBCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::TBCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TBCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) } } -#[doc = "Write proxy for field `DPTR`"] +#[doc = "Register `TBCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DPTR` writer - Data Pointer"] pub struct DPTR_W<'a> { w: &'a mut W, } @@ -18,13 +42,25 @@ impl<'a> DPTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f); + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); self.w } } -#[doc = "Reader of field `LIMIT`"] -pub type LIMIT_R = crate::R; -#[doc = "Write proxy for field `LIMIT`"] +#[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"] +pub struct LIMIT_R(crate::FieldReader); +impl LIMIT_R { + pub(crate) fn new(bits: u8) -> Self { + LIMIT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LIMIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"] pub struct LIMIT_W<'a> { w: &'a mut W, } @@ -32,7 +68,7 @@ impl<'a> LIMIT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); self.w } } @@ -50,9 +86,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STBTM`"] -pub type STBTM_R = crate::R; +#[doc = "Field `STBTM` reader - Standard Transmit Buffer Trigger Mode"] +pub struct STBTM_R(crate::FieldReader); impl STBTM_R { + pub(crate) fn new(bits: bool) -> Self { + STBTM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STBTM_A { @@ -64,15 +103,22 @@ impl STBTM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBTM_A::VALUE1 + **self == STBTM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBTM_A::VALUE2 + **self == STBTM_A::VALUE2 + } +} +impl core::ops::Deref for STBTM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STBTM`"] +#[doc = "Field `STBTM` writer - Standard Transmit Buffer Trigger Mode"] pub struct STBTM_W<'a> { w: &'a mut W, } @@ -80,9 +126,7 @@ impl<'a> STBTM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STBTM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trigger mode 0: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.LIMIT."] #[inline(always)] @@ -107,7 +151,7 @@ impl<'a> STBTM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -125,9 +169,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STBTEN`"] -pub type STBTEN_R = crate::R; +#[doc = "Field `STBTEN` reader - Standard Transmit Buffer Trigger Enable"] +pub struct STBTEN_R(crate::FieldReader); impl STBTEN_R { + pub(crate) fn new(bits: bool) -> Self { + STBTEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STBTEN_A { @@ -139,15 +186,22 @@ impl STBTEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBTEN_A::VALUE1 + **self == STBTEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBTEN_A::VALUE2 + **self == STBTEN_A::VALUE2 } } -#[doc = "Write proxy for field `STBTEN`"] +impl core::ops::Deref for STBTEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STBTEN` writer - Standard Transmit Buffer Trigger Enable"] pub struct STBTEN_W<'a> { w: &'a mut W, } @@ -155,9 +209,7 @@ impl<'a> STBTEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STBTEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."] #[inline(always)] @@ -182,7 +234,7 @@ impl<'a> STBTEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -209,55 +261,64 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STBINP`"] -pub type STBINP_R = crate::R; +#[doc = "Field `STBINP` reader - Standard Transmit Buffer Interrupt Node Pointer"] +pub struct STBINP_R(crate::FieldReader); impl STBINP_R { + pub(crate) fn new(bits: u8) -> Self { + STBINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(STBINP_A::VALUE1), - 1 => Val(STBINP_A::VALUE2), - 2 => Val(STBINP_A::VALUE3), - 3 => Val(STBINP_A::VALUE4), - 4 => Val(STBINP_A::VALUE5), - 5 => Val(STBINP_A::VALUE6), - i => Res(i), + 0 => Some(STBINP_A::VALUE1), + 1 => Some(STBINP_A::VALUE2), + 2 => Some(STBINP_A::VALUE3), + 3 => Some(STBINP_A::VALUE4), + 4 => Some(STBINP_A::VALUE5), + 5 => Some(STBINP_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBINP_A::VALUE1 + **self == STBINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBINP_A::VALUE2 + **self == STBINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STBINP_A::VALUE3 + **self == STBINP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STBINP_A::VALUE4 + **self == STBINP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == STBINP_A::VALUE5 + **self == STBINP_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == STBINP_A::VALUE6 + **self == STBINP_A::VALUE6 + } +} +impl core::ops::Deref for STBINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STBINP`"] +#[doc = "Field `STBINP` writer - Standard Transmit Buffer Interrupt Node Pointer"] pub struct STBINP_W<'a> { w: &'a mut W, } @@ -300,7 +361,7 @@ impl<'a> STBINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16); + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); self.w } } @@ -327,55 +388,64 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ATBINP`"] -pub type ATBINP_R = crate::R; +#[doc = "Field `ATBINP` reader - Alternative Transmit Buffer Interrupt Node Pointer"] +pub struct ATBINP_R(crate::FieldReader); impl ATBINP_R { + pub(crate) fn new(bits: u8) -> Self { + ATBINP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ATBINP_A::VALUE1), - 1 => Val(ATBINP_A::VALUE2), - 2 => Val(ATBINP_A::VALUE3), - 3 => Val(ATBINP_A::VALUE4), - 4 => Val(ATBINP_A::VALUE5), - 5 => Val(ATBINP_A::VALUE6), - i => Res(i), + 0 => Some(ATBINP_A::VALUE1), + 1 => Some(ATBINP_A::VALUE2), + 2 => Some(ATBINP_A::VALUE3), + 3 => Some(ATBINP_A::VALUE4), + 4 => Some(ATBINP_A::VALUE5), + 5 => Some(ATBINP_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ATBINP_A::VALUE1 + **self == ATBINP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ATBINP_A::VALUE2 + **self == ATBINP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ATBINP_A::VALUE3 + **self == ATBINP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ATBINP_A::VALUE4 + **self == ATBINP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == ATBINP_A::VALUE5 + **self == ATBINP_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == ATBINP_A::VALUE6 + **self == ATBINP_A::VALUE6 + } +} +impl core::ops::Deref for ATBINP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ATBINP`"] +#[doc = "Field `ATBINP` writer - Alternative Transmit Buffer Interrupt Node Pointer"] pub struct ATBINP_W<'a> { w: &'a mut W, } @@ -418,7 +488,7 @@ impl<'a> ATBINP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19); + self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19); self.w } } @@ -447,61 +517,70 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SIZE`"] -pub type SIZE_R = crate::R; +#[doc = "Field `SIZE` reader - Buffer Size"] +pub struct SIZE_R(crate::FieldReader); impl SIZE_R { + pub(crate) fn new(bits: u8) -> Self { + SIZE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SIZE_A::VALUE1), - 1 => Val(SIZE_A::VALUE2), - 2 => Val(SIZE_A::VALUE3), - 3 => Val(SIZE_A::VALUE4), - 4 => Val(SIZE_A::VALUE5), - 5 => Val(SIZE_A::VALUE6), - 6 => Val(SIZE_A::VALUE7), - i => Res(i), + 0 => Some(SIZE_A::VALUE1), + 1 => Some(SIZE_A::VALUE2), + 2 => Some(SIZE_A::VALUE3), + 3 => Some(SIZE_A::VALUE4), + 4 => Some(SIZE_A::VALUE5), + 5 => Some(SIZE_A::VALUE6), + 6 => Some(SIZE_A::VALUE7), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SIZE_A::VALUE1 + **self == SIZE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SIZE_A::VALUE2 + **self == SIZE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SIZE_A::VALUE3 + **self == SIZE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SIZE_A::VALUE4 + **self == SIZE_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == SIZE_A::VALUE5 + **self == SIZE_A::VALUE5 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == SIZE_A::VALUE6 + **self == SIZE_A::VALUE6 } #[doc = "Checks if the value of the field is `VALUE7`"] #[inline(always)] pub fn is_value7(&self) -> bool { - *self == SIZE_A::VALUE7 + **self == SIZE_A::VALUE7 + } +} +impl core::ops::Deref for SIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SIZE`"] +#[doc = "Field `SIZE` writer - Buffer Size"] pub struct SIZE_W<'a> { w: &'a mut W, } @@ -549,7 +628,7 @@ impl<'a> SIZE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -567,9 +646,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LOF`"] -pub type LOF_R = crate::R; +#[doc = "Field `LOF` reader - Buffer Event on Limit Overflow"] +pub struct LOF_R(crate::FieldReader); impl LOF_R { + pub(crate) fn new(bits: bool) -> Self { + LOF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOF_A { @@ -581,15 +663,22 @@ impl LOF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LOF_A::VALUE1 + **self == LOF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LOF_A::VALUE2 + **self == LOF_A::VALUE2 + } +} +impl core::ops::Deref for LOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LOF`"] +#[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"] pub struct LOF_W<'a> { w: &'a mut W, } @@ -597,9 +686,7 @@ impl<'a> LOF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LOF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A standard transmit buffer event occurs when the filling level equals the limit value and gets lower due to transmission of a data word."] #[inline(always)] @@ -624,7 +711,7 @@ impl<'a> LOF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -642,9 +729,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STBIEN`"] -pub type STBIEN_R = crate::R; +#[doc = "Field `STBIEN` reader - Standard Transmit Buffer Interrupt Enable"] +pub struct STBIEN_R(crate::FieldReader); impl STBIEN_R { + pub(crate) fn new(bits: bool) -> Self { + STBIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STBIEN_A { @@ -656,15 +746,22 @@ impl STBIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBIEN_A::VALUE1 + **self == STBIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBIEN_A::VALUE2 + **self == STBIEN_A::VALUE2 + } +} +impl core::ops::Deref for STBIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STBIEN`"] +#[doc = "Field `STBIEN` writer - Standard Transmit Buffer Interrupt Enable"] pub struct STBIEN_W<'a> { w: &'a mut W, } @@ -672,9 +769,7 @@ impl<'a> STBIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STBIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The standard transmit buffer interrupt generation is disabled."] #[inline(always)] @@ -699,7 +794,7 @@ impl<'a> STBIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -717,9 +812,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBERIEN`"] -pub type TBERIEN_R = crate::R; +#[doc = "Field `TBERIEN` reader - Transmit Buffer Error Interrupt Enable"] +pub struct TBERIEN_R(crate::FieldReader); impl TBERIEN_R { + pub(crate) fn new(bits: bool) -> Self { + TBERIEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBERIEN_A { @@ -731,15 +829,22 @@ impl TBERIEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBERIEN_A::VALUE1 + **self == TBERIEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBERIEN_A::VALUE2 + **self == TBERIEN_A::VALUE2 + } +} +impl core::ops::Deref for TBERIEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TBERIEN`"] +#[doc = "Field `TBERIEN` writer - Transmit Buffer Error Interrupt Enable"] pub struct TBERIEN_W<'a> { w: &'a mut W, } @@ -747,9 +852,7 @@ impl<'a> TBERIEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBERIEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The transmit buffer error interrupt generation is disabled."] #[inline(always)] @@ -774,7 +877,7 @@ impl<'a> TBERIEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -876,4 +979,30 @@ impl W { pub fn tberien(&mut self) -> TBERIEN_W { TBERIEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmitter Buffer Control Register\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 [tbctr](index.html) module"] +pub struct TBCTR_SPEC; +impl crate::RegisterSpec for TBCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tbctr::R](R) reader structure"] +impl crate::Readable for TBCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tbctr::W](W) writer structure"] +impl crate::Writable for TBCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TBCTR to value 0"] +impl crate::Resettable for TBCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/tbuf.rs b/src/usic0_ch0/tbuf.rs index e00e9f4c..4fc9a763 100644 --- a/src/usic0_ch0/tbuf.rs +++ b/src/usic0_ch0/tbuf.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register TBUF[%s]"] -pub type R = crate::R; -#[doc = "Writer for register TBUF[%s]"] -pub type W = crate::W; -#[doc = "Register TBUF[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::TBUF { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TBUF[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TBUF[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `TDATA`"] -pub type TDATA_R = crate::R; -#[doc = "Write proxy for field `TDATA`"] +#[doc = "Field `TDATA` reader - Transmit Data"] +pub struct TDATA_R(crate::FieldReader); +impl TDATA_R { + pub(crate) fn new(bits: u16) -> Self { + TDATA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TDATA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TDATA` writer - Transmit Data"] pub struct TDATA_W<'a> { w: &'a mut W, } @@ -21,7 +56,7 @@ impl<'a> TDATA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } @@ -38,4 +73,31 @@ impl W { pub fn tdata(&mut self) -> TDATA_W { TDATA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit Buffer\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 [tbuf](index.html) module"] +pub struct TBUF_SPEC; +impl crate::RegisterSpec for TBUF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tbuf::R](R) reader structure"] +impl crate::Readable for TBUF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tbuf::W](W) writer structure"] +impl crate::Writable for TBUF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TBUF[%s] +to value 0"] +impl crate::Resettable for TBUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/tcsr.rs b/src/usic0_ch0/tcsr.rs index 91298210..e05627a6 100644 --- a/src/usic0_ch0/tcsr.rs +++ b/src/usic0_ch0/tcsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TCSR"] -pub type R = crate::R; -#[doc = "Writer for register TCSR"] -pub type W = crate::W; -#[doc = "Register TCSR `reset()`'s with value 0"] -impl crate::ResetValue for super::TCSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `TCSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TCSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "WLE Mode\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WLEMD`"] -pub type WLEMD_R = crate::R; +#[doc = "Field `WLEMD` reader - WLE Mode"] +pub struct WLEMD_R(crate::FieldReader); impl WLEMD_R { + pub(crate) fn new(bits: bool) -> Self { + WLEMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WLEMD_A { @@ -38,15 +65,22 @@ impl WLEMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WLEMD_A::VALUE1 + **self == WLEMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WLEMD_A::VALUE2 + **self == WLEMD_A::VALUE2 + } +} +impl core::ops::Deref for WLEMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WLEMD`"] +#[doc = "Field `WLEMD` writer - WLE Mode"] pub struct WLEMD_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> WLEMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WLEMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The automatic update of SCTR.WLE and TCSR.EOF is disabled."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> WLEMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -101,9 +133,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SELMD`"] -pub type SELMD_R = crate::R; +#[doc = "Field `SELMD` reader - Select Mode"] +pub struct SELMD_R(crate::FieldReader); impl SELMD_R { + pub(crate) fn new(bits: bool) -> Self { + SELMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SELMD_A { @@ -115,15 +150,22 @@ impl SELMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SELMD_A::VALUE1 + **self == SELMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SELMD_A::VALUE2 + **self == SELMD_A::VALUE2 + } +} +impl core::ops::Deref for SELMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SELMD`"] +#[doc = "Field `SELMD` writer - Select Mode"] pub struct SELMD_W<'a> { w: &'a mut W, } @@ -131,9 +173,7 @@ impl<'a> SELMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SELMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The automatic update of PCR.CTR\\[23:16\\] is disabled."] @@ -160,7 +200,7 @@ is disabled."] #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -178,9 +218,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FLEMD`"] -pub type FLEMD_R = crate::R; +#[doc = "Field `FLEMD` reader - FLE Mode"] +pub struct FLEMD_R(crate::FieldReader); impl FLEMD_R { + pub(crate) fn new(bits: bool) -> Self { + FLEMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FLEMD_A { @@ -192,15 +235,22 @@ impl FLEMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FLEMD_A::VALUE1 + **self == FLEMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FLEMD_A::VALUE2 + **self == FLEMD_A::VALUE2 } } -#[doc = "Write proxy for field `FLEMD`"] +impl core::ops::Deref for FLEMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FLEMD` writer - FLE Mode"] pub struct FLEMD_W<'a> { w: &'a mut W, } @@ -208,9 +258,7 @@ impl<'a> FLEMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLEMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The automatic update of FLE is disabled."] #[inline(always)] @@ -235,7 +283,7 @@ impl<'a> FLEMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -253,9 +301,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WAMD`"] -pub type WAMD_R = crate::R; +#[doc = "Field `WAMD` reader - WA Mode"] +pub struct WAMD_R(crate::FieldReader); impl WAMD_R { + pub(crate) fn new(bits: bool) -> Self { + WAMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAMD_A { @@ -267,15 +318,22 @@ impl WAMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WAMD_A::VALUE1 + **self == WAMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WAMD_A::VALUE2 + **self == WAMD_A::VALUE2 + } +} +impl core::ops::Deref for WAMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WAMD`"] +#[doc = "Field `WAMD` writer - WA Mode"] pub struct WAMD_W<'a> { w: &'a mut W, } @@ -283,9 +341,7 @@ impl<'a> WAMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WAMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The automatic update of bit WA is disabled."] #[inline(always)] @@ -310,7 +366,7 @@ impl<'a> WAMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -328,9 +384,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `HPCMD`"] -pub type HPCMD_R = crate::R; +#[doc = "Field `HPCMD` reader - Hardware Port Control Mode"] +pub struct HPCMD_R(crate::FieldReader); impl HPCMD_R { + pub(crate) fn new(bits: bool) -> Self { + HPCMD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HPCMD_A { @@ -342,15 +401,22 @@ impl HPCMD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == HPCMD_A::VALUE1 + **self == HPCMD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == HPCMD_A::VALUE2 + **self == HPCMD_A::VALUE2 + } +} +impl core::ops::Deref for HPCMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `HPCMD`"] +#[doc = "Field `HPCMD` writer - Hardware Port Control Mode"] pub struct HPCMD_W<'a> { w: &'a mut W, } @@ -358,9 +424,7 @@ impl<'a> HPCMD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HPCMD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The automatic update of bits SCTR.DSM and SCTR.HPCDIR is disabled."] #[inline(always)] @@ -385,7 +449,7 @@ impl<'a> HPCMD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -403,9 +467,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SOF`"] -pub type SOF_R = crate::R; +#[doc = "Field `SOF` reader - Start Of Frame"] +pub struct SOF_R(crate::FieldReader); impl SOF_R { + pub(crate) fn new(bits: bool) -> Self { + SOF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOF_A { @@ -417,15 +484,22 @@ impl SOF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SOF_A::VALUE1 + **self == SOF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SOF_A::VALUE2 + **self == SOF_A::VALUE2 + } +} +impl core::ops::Deref for SOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SOF`"] +#[doc = "Field `SOF` writer - Start Of Frame"] pub struct SOF_W<'a> { w: &'a mut W, } @@ -433,9 +507,7 @@ impl<'a> SOF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SOF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The data word in TBUF is not considered as first word of a frame."] #[inline(always)] @@ -460,7 +532,7 @@ impl<'a> SOF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -478,9 +550,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EOF`"] -pub type EOF_R = crate::R; +#[doc = "Field `EOF` reader - End Of Frame"] +pub struct EOF_R(crate::FieldReader); impl EOF_R { + pub(crate) fn new(bits: bool) -> Self { + EOF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOF_A { @@ -492,15 +567,22 @@ impl EOF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EOF_A::VALUE1 + **self == EOF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EOF_A::VALUE2 + **self == EOF_A::VALUE2 + } +} +impl core::ops::Deref for EOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EOF`"] +#[doc = "Field `EOF` writer - End Of Frame"] pub struct EOF_W<'a> { w: &'a mut W, } @@ -508,9 +590,7 @@ impl<'a> EOF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The data word in TBUF is not considered as last word of an SSC frame."] #[inline(always)] @@ -535,7 +615,7 @@ impl<'a> EOF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -553,9 +633,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TDV`"] -pub type TDV_R = crate::R; +#[doc = "Field `TDV` reader - Transmit Data Valid"] +pub struct TDV_R(crate::FieldReader); impl TDV_R { + pub(crate) fn new(bits: bool) -> Self { + TDV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TDV_A { @@ -567,12 +650,19 @@ impl TDV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TDV_A::VALUE1 + **self == TDV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TDV_A::VALUE2 + **self == TDV_A::VALUE2 + } +} +impl core::ops::Deref for TDV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "TBUF Data Single Shot Mode\n\nValue on reset: 0"] @@ -589,9 +679,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TDSSM`"] -pub type TDSSM_R = crate::R; +#[doc = "Field `TDSSM` reader - TBUF Data Single Shot Mode"] +pub struct TDSSM_R(crate::FieldReader); impl TDSSM_R { + pub(crate) fn new(bits: bool) -> Self { + TDSSM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TDSSM_A { @@ -603,15 +696,22 @@ impl TDSSM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TDSSM_A::VALUE1 + **self == TDSSM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TDSSM_A::VALUE2 + **self == TDSSM_A::VALUE2 } } -#[doc = "Write proxy for field `TDSSM`"] +impl core::ops::Deref for TDSSM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TDSSM` writer - TBUF Data Single Shot Mode"] pub struct TDSSM_W<'a> { w: &'a mut W, } @@ -619,9 +719,7 @@ impl<'a> TDSSM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TDSSM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The data word in TBUF is not considered as invalid after it has been loaded into the transmit shift register. The loading of the TBUF data into the shift register does not clear TDV."] #[inline(always)] @@ -646,7 +744,7 @@ impl<'a> TDSSM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -669,9 +767,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TDEN`"] -pub type TDEN_R = crate::R; +#[doc = "Field `TDEN` reader - TBUF Data Enable"] +pub struct TDEN_R(crate::FieldReader); impl TDEN_R { + pub(crate) fn new(bits: u8) -> Self { + TDEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TDEN_A { @@ -686,25 +787,32 @@ impl TDEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TDEN_A::VALUE1 + **self == TDEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TDEN_A::VALUE2 + **self == TDEN_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == TDEN_A::VALUE3 + **self == TDEN_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == TDEN_A::VALUE4 + **self == TDEN_A::VALUE4 + } +} +impl core::ops::Deref for TDEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TDEN`"] +#[doc = "Field `TDEN` writer - TBUF Data Enable"] pub struct TDEN_W<'a> { w: &'a mut W, } @@ -712,9 +820,7 @@ impl<'a> TDEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TDEN_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "A transmission start of the data word in TBUF is disabled. If a transmission is started, the passive data level is sent out."] #[inline(always)] @@ -739,7 +845,7 @@ impl<'a> TDEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); self.w } } @@ -757,9 +863,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TDVTR`"] -pub type TDVTR_R = crate::R; +#[doc = "Field `TDVTR` reader - TBUF Data Valid Trigger"] +pub struct TDVTR_R(crate::FieldReader); impl TDVTR_R { + pub(crate) fn new(bits: bool) -> Self { + TDVTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TDVTR_A { @@ -771,15 +880,22 @@ impl TDVTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TDVTR_A::VALUE1 + **self == TDVTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TDVTR_A::VALUE2 + **self == TDVTR_A::VALUE2 + } +} +impl core::ops::Deref for TDVTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TDVTR`"] +#[doc = "Field `TDVTR` writer - TBUF Data Valid Trigger"] pub struct TDVTR_W<'a> { w: &'a mut W, } @@ -787,9 +903,7 @@ impl<'a> TDVTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TDVTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Bit TCSR.TE is permanently set."] #[inline(always)] @@ -814,7 +928,7 @@ impl<'a> TDVTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -832,9 +946,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WA`"] -pub type WA_R = crate::R; +#[doc = "Field `WA` reader - Word Address"] +pub struct WA_R(crate::FieldReader); impl WA_R { + pub(crate) fn new(bits: bool) -> Self { + WA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WA_A { @@ -846,15 +963,22 @@ impl WA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WA_A::VALUE1 + **self == WA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WA_A::VALUE2 + **self == WA_A::VALUE2 + } +} +impl core::ops::Deref for WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WA`"] +#[doc = "Field `WA` writer - Word Address"] pub struct WA_W<'a> { w: &'a mut W, } @@ -862,9 +986,7 @@ impl<'a> WA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WA_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The data word in TBUF will be transmitted after a falling edge of WA has been detected (referring to PSR.WA)."] #[inline(always)] @@ -889,7 +1011,7 @@ impl<'a> WA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -907,9 +1029,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TSOF`"] -pub type TSOF_R = crate::R; +#[doc = "Field `TSOF` reader - Transmitted Start Of Frame"] +pub struct TSOF_R(crate::FieldReader); impl TSOF_R { + pub(crate) fn new(bits: bool) -> Self { + TSOF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TSOF_A { @@ -921,12 +1046,19 @@ impl TSOF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TSOF_A::VALUE1 + **self == TSOF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TSOF_A::VALUE2 + **self == TSOF_A::VALUE2 + } +} +impl core::ops::Deref for TSOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmission Valid\n\nValue on reset: 0"] @@ -943,9 +1075,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TV`"] -pub type TV_R = crate::R; +#[doc = "Field `TV` reader - Transmission Valid"] +pub struct TV_R(crate::FieldReader); impl TV_R { + pub(crate) fn new(bits: bool) -> Self { + TV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TV_A { @@ -957,12 +1092,19 @@ impl TV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TV_A::VALUE1 + **self == TV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TV_A::VALUE2 + **self == TV_A::VALUE2 + } +} +impl core::ops::Deref for TV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmission Valid Cumulated\n\nValue on reset: 0"] @@ -979,9 +1121,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TVC`"] -pub type TVC_R = crate::R; +#[doc = "Field `TVC` reader - Transmission Valid Cumulated"] +pub struct TVC_R(crate::FieldReader); impl TVC_R { + pub(crate) fn new(bits: bool) -> Self { + TVC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TVC_A { @@ -993,12 +1138,19 @@ impl TVC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TVC_A::VALUE1 + **self == TVC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TVC_A::VALUE2 + **self == TVC_A::VALUE2 + } +} +impl core::ops::Deref for TVC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Trigger Event\n\nValue on reset: 0"] @@ -1015,9 +1167,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TE`"] -pub type TE_R = crate::R; +#[doc = "Field `TE` reader - Trigger Event"] +pub struct TE_R(crate::FieldReader); impl TE_R { + pub(crate) fn new(bits: bool) -> Self { + TE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TE_A { @@ -1029,12 +1184,19 @@ impl TE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TE_A::VALUE1 + **self == TE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TE_A::VALUE2 + **self == TE_A::VALUE2 + } +} +impl core::ops::Deref for TE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -1175,4 +1337,30 @@ impl W { pub fn wa(&mut self) -> WA_W { WA_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit Control/Status Register\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 [tcsr](index.html) module"] +pub struct TCSR_SPEC; +impl crate::RegisterSpec for TCSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tcsr::R](R) reader structure"] +impl crate::Readable for TCSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tcsr::W](W) writer structure"] +impl crate::Writable for TCSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TCSR to value 0"] +impl crate::Resettable for TCSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/trbptr.rs b/src/usic0_ch0/trbptr.rs index 081f37d6..2a8b15ee 100644 --- a/src/usic0_ch0/trbptr.rs +++ b/src/usic0_ch0/trbptr.rs @@ -1,13 +1,74 @@ -#[doc = "Reader of register TRBPTR"] -pub type R = crate::R; -#[doc = "Reader of field `TDIPTR`"] -pub type TDIPTR_R = crate::R; -#[doc = "Reader of field `TDOPTR`"] -pub type TDOPTR_R = crate::R; -#[doc = "Reader of field `RDIPTR`"] -pub type RDIPTR_R = crate::R; -#[doc = "Reader of field `RDOPTR`"] -pub type RDOPTR_R = crate::R; +#[doc = "Register `TRBPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `TDIPTR` reader - Transmitter Data Input Pointer"] +pub struct TDIPTR_R(crate::FieldReader); +impl TDIPTR_R { + pub(crate) fn new(bits: u8) -> Self { + TDIPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TDIPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TDOPTR` reader - Transmitter Data Output Pointer"] +pub struct TDOPTR_R(crate::FieldReader); +impl TDOPTR_R { + pub(crate) fn new(bits: u8) -> Self { + TDOPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TDOPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RDIPTR` reader - Receiver Data Input Pointer"] +pub struct RDIPTR_R(crate::FieldReader); +impl RDIPTR_R { + pub(crate) fn new(bits: u8) -> Self { + RDIPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RDIPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RDOPTR` reader - Receiver Data Output Pointer"] +pub struct RDOPTR_R(crate::FieldReader); +impl RDOPTR_R { + pub(crate) fn new(bits: u8) -> Self { + RDOPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RDOPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:5 - Transmitter Data Input Pointer"] #[inline(always)] @@ -30,3 +91,19 @@ impl R { RDOPTR_R::new(((self.bits >> 24) & 0x3f) as u8) } } +#[doc = "Transmit/Receive Buffer Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trbptr](index.html) module"] +pub struct TRBPTR_SPEC; +impl crate::RegisterSpec for TRBPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [trbptr::R](R) reader structure"] +impl crate::Readable for TRBPTR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TRBPTR to value 0"] +impl crate::Resettable for TRBPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/usic0_ch0/trbscr.rs b/src/usic0_ch0/trbscr.rs index f531b67e..82a5e9a0 100644 --- a/src/usic0_ch0/trbscr.rs +++ b/src/usic0_ch0/trbscr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register TRBSCR"] -pub type W = crate::W; -#[doc = "Register TRBSCR `reset()`'s with value 0"] -impl crate::ResetValue for super::TRBSCR { - type Type = u32; +#[doc = "Register `TRBSCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Standard Receive Buffer Event\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CSRBI`"] +#[doc = "Field `CSRBI` writer - Clear Standard Receive Buffer Event"] pub struct CSRBI_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CSRBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSRBI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CSRBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CRBERI`"] +#[doc = "Field `CRBERI` writer - Clear Receive Buffer Error Event"] pub struct CRBERI_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CRBERI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRBERI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CRBERI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CARBI`"] +#[doc = "Field `CARBI` writer - Clear Alternative Receive Buffer Event"] pub struct CARBI_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CARBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CARBI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CARBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CSTBI`"] +#[doc = "Field `CSTBI` writer - Clear Standard Transmit Buffer Event"] pub struct CSTBI_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CSTBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSTBI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CSTBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CTBERI`"] +#[doc = "Field `CTBERI` writer - Clear Transmit Buffer Error Event"] pub struct CTBERI_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CTBERI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CTBERI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CTBERI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CBDV`"] +#[doc = "Field `CBDV` writer - Clear Bypass Data Valid"] pub struct CBDV_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CBDV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CBDV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CBDV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLUSHRB`"] +#[doc = "Field `FLUSHRB` writer - Flush Receive Buffer"] pub struct FLUSHRB_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> FLUSHRB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLUSHRB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> FLUSHRB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLUSHTB`"] +#[doc = "Field `FLUSHTB` writer - Flush Transmit Buffer"] pub struct FLUSHTB_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> FLUSHTB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLUSHTB_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No effect."] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> FLUSHTB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn flushtb(&mut self) -> FLUSHTB_W { FLUSHTB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit/Receive Buffer Status Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [trbscr](index.html) module"] +pub struct TRBSCR_SPEC; +impl crate::RegisterSpec for TRBSCR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [trbscr::W](W) writer structure"] +impl crate::Writable for TRBSCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRBSCR to value 0"] +impl crate::Resettable for TRBSCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/usic0_ch0/trbsr.rs b/src/usic0_ch0/trbsr.rs index a721c11f..aee82758 100644 --- a/src/usic0_ch0/trbsr.rs +++ b/src/usic0_ch0/trbsr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register TRBSR"] -pub type R = crate::R; -#[doc = "Writer for register TRBSR"] -pub type W = crate::W; -#[doc = "Register TRBSR `reset()`'s with value 0x0808"] -impl crate::ResetValue for super::TRBSR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0808 +#[doc = "Register `TRBSR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TRBSR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Standard Receive Buffer Event\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRBI`"] -pub type SRBI_R = crate::R; +#[doc = "Field `SRBI` reader - Standard Receive Buffer Event"] +pub struct SRBI_R(crate::FieldReader); impl SRBI_R { + pub(crate) fn new(bits: bool) -> Self { + SRBI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRBI_A { @@ -38,15 +65,22 @@ impl SRBI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBI_A::VALUE1 + **self == SRBI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBI_A::VALUE2 + **self == SRBI_A::VALUE2 + } +} +impl core::ops::Deref for SRBI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRBI`"] +#[doc = "Field `SRBI` writer - Standard Receive Buffer Event"] pub struct SRBI_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SRBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRBI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A standard receive buffer event has not been detected."] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SRBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RBERI`"] -pub type RBERI_R = crate::R; +#[doc = "Field `RBERI` reader - Receive Buffer Error Event"] +pub struct RBERI_R(crate::FieldReader); impl RBERI_R { + pub(crate) fn new(bits: bool) -> Self { + RBERI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RBERI_A { @@ -113,15 +148,22 @@ impl RBERI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RBERI_A::VALUE1 + **self == RBERI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RBERI_A::VALUE2 + **self == RBERI_A::VALUE2 + } +} +impl core::ops::Deref for RBERI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RBERI`"] +#[doc = "Field `RBERI` writer - Receive Buffer Error Event"] pub struct RBERI_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> RBERI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RBERI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A receive buffer error event has not been detected."] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> RBERI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ARBI`"] -pub type ARBI_R = crate::R; +#[doc = "Field `ARBI` reader - Alternative Receive Buffer Event"] +pub struct ARBI_R(crate::FieldReader); impl ARBI_R { + pub(crate) fn new(bits: bool) -> Self { + ARBI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARBI_A { @@ -188,15 +231,22 @@ impl ARBI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARBI_A::VALUE1 + **self == ARBI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARBI_A::VALUE2 + **self == ARBI_A::VALUE2 + } +} +impl core::ops::Deref for ARBI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARBI`"] +#[doc = "Field `ARBI` writer - Alternative Receive Buffer Event"] pub struct ARBI_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> ARBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARBI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "An alternative receive buffer event has not been detected."] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> ARBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REMPTY`"] -pub type REMPTY_R = crate::R; +#[doc = "Field `REMPTY` reader - Receive Buffer Empty"] +pub struct REMPTY_R(crate::FieldReader); impl REMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + REMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REMPTY_A { @@ -263,12 +314,19 @@ impl REMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REMPTY_A::VALUE1 + **self == REMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REMPTY_A::VALUE2 + **self == REMPTY_A::VALUE2 + } +} +impl core::ops::Deref for REMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Buffer Full\n\nValue on reset: 0"] @@ -285,9 +343,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RFULL`"] -pub type RFULL_R = crate::R; +#[doc = "Field `RFULL` reader - Receive Buffer Full"] +pub struct RFULL_R(crate::FieldReader); impl RFULL_R { + pub(crate) fn new(bits: bool) -> Self { + RFULL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RFULL_A { @@ -299,12 +360,19 @@ impl RFULL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RFULL_A::VALUE1 + **self == RFULL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RFULL_A::VALUE2 + **self == RFULL_A::VALUE2 + } +} +impl core::ops::Deref for RFULL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Receive Buffer Busy\n\nValue on reset: 0"] @@ -321,9 +389,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RBUS`"] -pub type RBUS_R = crate::R; +#[doc = "Field `RBUS` reader - Receive Buffer Busy"] +pub struct RBUS_R(crate::FieldReader); impl RBUS_R { + pub(crate) fn new(bits: bool) -> Self { + RBUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RBUS_A { @@ -335,12 +406,19 @@ impl RBUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RBUS_A::VALUE1 + **self == RBUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RBUS_A::VALUE2 + **self == RBUS_A::VALUE2 + } +} +impl core::ops::Deref for RBUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Standard Receive Buffer Event Trigger\n\nValue on reset: 0"] @@ -357,9 +435,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRBT`"] -pub type SRBT_R = crate::R; +#[doc = "Field `SRBT` reader - Standard Receive Buffer Event Trigger"] +pub struct SRBT_R(crate::FieldReader); impl SRBT_R { + pub(crate) fn new(bits: bool) -> Self { + SRBT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRBT_A { @@ -371,12 +452,19 @@ impl SRBT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRBT_A::VALUE1 + **self == SRBT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRBT_A::VALUE2 + **self == SRBT_A::VALUE2 + } +} +impl core::ops::Deref for SRBT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Standard Transmit Buffer Event\n\nValue on reset: 0"] @@ -393,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STBI`"] -pub type STBI_R = crate::R; +#[doc = "Field `STBI` reader - Standard Transmit Buffer Event"] +pub struct STBI_R(crate::FieldReader); impl STBI_R { + pub(crate) fn new(bits: bool) -> Self { + STBI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STBI_A { @@ -407,15 +498,22 @@ impl STBI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBI_A::VALUE1 + **self == STBI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBI_A::VALUE2 + **self == STBI_A::VALUE2 + } +} +impl core::ops::Deref for STBI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `STBI`"] +#[doc = "Field `STBI` writer - Standard Transmit Buffer Event"] pub struct STBI_W<'a> { w: &'a mut W, } @@ -423,9 +521,7 @@ impl<'a> STBI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STBI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A standard transmit buffer event has not been detected."] #[inline(always)] @@ -450,7 +546,7 @@ impl<'a> STBI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -468,9 +564,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBERI`"] -pub type TBERI_R = crate::R; +#[doc = "Field `TBERI` reader - Transmit Buffer Error Event"] +pub struct TBERI_R(crate::FieldReader); impl TBERI_R { + pub(crate) fn new(bits: bool) -> Self { + TBERI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBERI_A { @@ -482,15 +581,22 @@ impl TBERI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBERI_A::VALUE1 + **self == TBERI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBERI_A::VALUE2 + **self == TBERI_A::VALUE2 } } -#[doc = "Write proxy for field `TBERI`"] +impl core::ops::Deref for TBERI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBERI` writer - Transmit Buffer Error Event"] pub struct TBERI_W<'a> { w: &'a mut W, } @@ -498,9 +604,7 @@ impl<'a> TBERI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TBERI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A transmit buffer error event has not been detected."] #[inline(always)] @@ -525,7 +629,7 @@ impl<'a> TBERI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -543,9 +647,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TEMPTY`"] -pub type TEMPTY_R = crate::R; +#[doc = "Field `TEMPTY` reader - Transmit Buffer Empty"] +pub struct TEMPTY_R(crate::FieldReader); impl TEMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + TEMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TEMPTY_A { @@ -557,12 +664,19 @@ impl TEMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TEMPTY_A::VALUE1 + **self == TEMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TEMPTY_A::VALUE2 + **self == TEMPTY_A::VALUE2 + } +} +impl core::ops::Deref for TEMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Buffer Full\n\nValue on reset: 0"] @@ -579,9 +693,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TFULL`"] -pub type TFULL_R = crate::R; +#[doc = "Field `TFULL` reader - Transmit Buffer Full"] +pub struct TFULL_R(crate::FieldReader); impl TFULL_R { + pub(crate) fn new(bits: bool) -> Self { + TFULL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TFULL_A { @@ -593,12 +710,19 @@ impl TFULL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TFULL_A::VALUE1 + **self == TFULL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TFULL_A::VALUE2 + **self == TFULL_A::VALUE2 + } +} +impl core::ops::Deref for TFULL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Transmit Buffer Busy\n\nValue on reset: 0"] @@ -615,9 +739,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TBUS`"] -pub type TBUS_R = crate::R; +#[doc = "Field `TBUS` reader - Transmit Buffer Busy"] +pub struct TBUS_R(crate::FieldReader); impl TBUS_R { + pub(crate) fn new(bits: bool) -> Self { + TBUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TBUS_A { @@ -629,12 +756,19 @@ impl TBUS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TBUS_A::VALUE1 + **self == TBUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TBUS_A::VALUE2 + **self == TBUS_A::VALUE2 + } +} +impl core::ops::Deref for TBUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Standard Transmit Buffer Event Trigger\n\nValue on reset: 0"] @@ -651,9 +785,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `STBT`"] -pub type STBT_R = crate::R; +#[doc = "Field `STBT` reader - Standard Transmit Buffer Event Trigger"] +pub struct STBT_R(crate::FieldReader); impl STBT_R { + pub(crate) fn new(bits: bool) -> Self { + STBT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STBT_A { @@ -665,18 +802,49 @@ impl STBT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STBT_A::VALUE1 + **self == STBT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STBT_A::VALUE2 + **self == STBT_A::VALUE2 + } +} +impl core::ops::Deref for STBT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RBFLVL` reader - Receive Buffer Filling Level"] +pub struct RBFLVL_R(crate::FieldReader); +impl RBFLVL_R { + pub(crate) fn new(bits: u8) -> Self { + RBFLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RBFLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TBFLVL` reader - Transmit Buffer Filling Level"] +pub struct TBFLVL_R(crate::FieldReader); +impl TBFLVL_R { + pub(crate) fn new(bits: u8) -> Self { + TBFLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TBFLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `RBFLVL`"] -pub type RBFLVL_R = crate::R; -#[doc = "Reader of field `TBFLVL`"] -pub type TBFLVL_R = crate::R; impl R { #[doc = "Bit 0 - Standard Receive Buffer Event"] #[inline(always)] @@ -780,4 +948,30 @@ impl W { pub fn tberi(&mut self) -> TBERI_W { TBERI_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit/Receive Buffer Status Register\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 [trbsr](index.html) module"] +pub struct TRBSR_SPEC; +impl crate::RegisterSpec for TRBSR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [trbsr::R](R) reader structure"] +impl crate::Readable for TRBSR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [trbsr::W](W) writer structure"] +impl crate::Writable for TRBSR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRBSR to value 0x0808"] +impl crate::Resettable for TRBSR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0808 + } } diff --git a/src/vadc.rs b/src/vadc.rs index b495274b..75f2f3f0 100644 --- a/src/vadc.rs +++ b/src/vadc.rs @@ -2,237 +2,120 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Clock Control Register"] - pub clc: CLC, - _reserved1: [u8; 4usize], + pub clc: crate::Reg, + _reserved1: [u8; 0x04], #[doc = "0x08 - Module Identification Register"] - pub id: ID, - _reserved2: [u8; 28usize], + pub id: crate::Reg, + _reserved2: [u8; 0x1c], #[doc = "0x28 - OCDS Control and Status Register"] - pub ocs: OCS, - _reserved3: [u8; 84usize], + pub ocs: crate::Reg, + _reserved3: [u8; 0x54], #[doc = "0x80 - Global Configuration Register"] - pub globcfg: GLOBCFG, - _reserved4: [u8; 28usize], - #[doc = "0xa0 - Input Class Register, Global"] - pub globiclass: [GLOBICLASS; 2], - _reserved5: [u8; 16usize], + pub globcfg: crate::Reg, + _reserved4: [u8; 0x1c], + #[doc = "0xa0..0xa8 - Input Class Register, Global"] + pub globiclass: [crate::Reg; 2], + _reserved5: [u8; 0x10], #[doc = "0xb8 - Global Boundary Select Register"] - pub globbound: GLOBBOUND, - _reserved6: [u8; 36usize], + pub globbound: crate::Reg, + _reserved6: [u8; 0x24], #[doc = "0xe0 - Global Event Flag Register"] - pub globeflag: GLOBEFLAG, - _reserved7: [u8; 92usize], + pub globeflag: crate::Reg, + _reserved7: [u8; 0x5c], #[doc = "0x140 - Global Event Node Pointer Register"] - pub globevnp: GLOBEVNP, - _reserved8: [u8; 28usize], + pub globevnp: crate::Reg, + _reserved8: [u8; 0x1c], #[doc = "0x160 - Global Test Functions Register"] - pub globtf: GLOBTF, - _reserved9: [u8; 28usize], - #[doc = "0x180 - Background Request Source Channel Select Register"] - pub brssel: [BRSSEL; 4], - _reserved10: [u8; 48usize], - #[doc = "0x1c0 - Background Request Source Pending Register"] - pub brspnd: [BRSPND; 4], - _reserved11: [u8; 48usize], + pub globtf: crate::Reg, + _reserved9: [u8; 0x1c], + #[doc = "0x180..0x190 - Background Request Source Channel Select Register"] + pub brssel: [crate::Reg; 4], + _reserved10: [u8; 0x30], + #[doc = "0x1c0..0x1d0 - Background Request Source Pending Register"] + pub brspnd: [crate::Reg; 4], + _reserved11: [u8; 0x30], #[doc = "0x200 - Background Request Source Control Register"] - pub brsctrl: BRSCTRL, + pub brsctrl: crate::Reg, #[doc = "0x204 - Background Request Source Mode Register"] - pub brsmr: BRSMR, - _reserved13: [u8; 120usize], + pub brsmr: crate::Reg, + _reserved13: [u8; 0x78], #[doc = "0x280 - Global Result Control Register"] - pub globrcr: GLOBRCR, - _reserved14: [u8; 124usize], + pub globrcr: crate::Reg, + _reserved14: [u8; 0x7c], #[doc = "0x300 - Global Result Register"] - pub globres: GLOBRES, - _reserved15: [u8; 124usize], + pub globres: crate::Reg, + _reserved15: [u8; 0x7c], #[doc = "0x380 - Global Result Register, Debug"] - pub globresd: GLOBRESD, - _reserved16: [u8; 108usize], + pub globresd: crate::Reg, + _reserved16: [u8; 0x6c], #[doc = "0x3f0 - External Multiplexer Select Register"] - pub emuxsel: EMUXSEL, + pub emuxsel: crate::Reg, } -#[doc = "Clock Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clc](clc) module"] -pub type CLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CLC; -#[doc = "`read()` method returns [clc::R](clc::R) reader structure"] -impl crate::Readable for CLC {} -#[doc = "`write(|w| ..)` method takes [clc::W](clc::W) writer structure"] -impl crate::Writable for CLC {} +#[doc = "CLC register accessor: an alias for `Reg`"] +pub type CLC = crate::Reg; #[doc = "Clock Control Register"] pub mod clc; -#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "OCDS Control and Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ocs](ocs) module"] -pub type OCS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _OCS; -#[doc = "`read()` method returns [ocs::R](ocs::R) reader structure"] -impl crate::Readable for OCS {} -#[doc = "`write(|w| ..)` method takes [ocs::W](ocs::W) writer structure"] -impl crate::Writable for OCS {} +#[doc = "OCS register accessor: an alias for `Reg`"] +pub type OCS = crate::Reg; #[doc = "OCDS Control and Status Register"] pub mod ocs; -#[doc = "Global Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globcfg](globcfg) module"] -pub type GLOBCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBCFG; -#[doc = "`read()` method returns [globcfg::R](globcfg::R) reader structure"] -impl crate::Readable for GLOBCFG {} -#[doc = "`write(|w| ..)` method takes [globcfg::W](globcfg::W) writer structure"] -impl crate::Writable for GLOBCFG {} +#[doc = "GLOBCFG register accessor: an alias for `Reg`"] +pub type GLOBCFG = crate::Reg; #[doc = "Global Configuration Register"] pub mod globcfg; -#[doc = "Input Class Register, Global\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globiclass](globiclass) module"] -pub type GLOBICLASS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBICLASS; -#[doc = "`read()` method returns [globiclass::R](globiclass::R) reader structure"] -impl crate::Readable for GLOBICLASS {} -#[doc = "`write(|w| ..)` method takes [globiclass::W](globiclass::W) writer structure"] -impl crate::Writable for GLOBICLASS {} +#[doc = "GLOBICLASS register accessor: an alias for `Reg`"] +pub type GLOBICLASS = crate::Reg; #[doc = "Input Class Register, Global"] pub mod globiclass; -#[doc = "Global Boundary Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globbound](globbound) module"] -pub type GLOBBOUND = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBBOUND; -#[doc = "`read()` method returns [globbound::R](globbound::R) reader structure"] -impl crate::Readable for GLOBBOUND {} -#[doc = "`write(|w| ..)` method takes [globbound::W](globbound::W) writer structure"] -impl crate::Writable for GLOBBOUND {} +#[doc = "GLOBBOUND register accessor: an alias for `Reg`"] +pub type GLOBBOUND = crate::Reg; #[doc = "Global Boundary Select Register"] pub mod globbound; -#[doc = "Global Event Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globeflag](globeflag) module"] -pub type GLOBEFLAG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBEFLAG; -#[doc = "`read()` method returns [globeflag::R](globeflag::R) reader structure"] -impl crate::Readable for GLOBEFLAG {} -#[doc = "`write(|w| ..)` method takes [globeflag::W](globeflag::W) writer structure"] -impl crate::Writable for GLOBEFLAG {} +#[doc = "GLOBEFLAG register accessor: an alias for `Reg`"] +pub type GLOBEFLAG = crate::Reg; #[doc = "Global Event Flag Register"] pub mod globeflag; -#[doc = "Global Event Node Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globevnp](globevnp) module"] -pub type GLOBEVNP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBEVNP; -#[doc = "`read()` method returns [globevnp::R](globevnp::R) reader structure"] -impl crate::Readable for GLOBEVNP {} -#[doc = "`write(|w| ..)` method takes [globevnp::W](globevnp::W) writer structure"] -impl crate::Writable for GLOBEVNP {} +#[doc = "GLOBEVNP register accessor: an alias for `Reg`"] +pub type GLOBEVNP = crate::Reg; #[doc = "Global Event Node Pointer Register"] pub mod globevnp; -#[doc = "Global Test Functions Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globtf](globtf) module"] -pub type GLOBTF = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBTF; -#[doc = "`read()` method returns [globtf::R](globtf::R) reader structure"] -impl crate::Readable for GLOBTF {} -#[doc = "`write(|w| ..)` method takes [globtf::W](globtf::W) writer structure"] -impl crate::Writable for GLOBTF {} +#[doc = "GLOBTF register accessor: an alias for `Reg`"] +pub type GLOBTF = crate::Reg; #[doc = "Global Test Functions Register"] pub mod globtf; -#[doc = "Background Request Source Channel Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [brssel](brssel) module"] -pub type BRSSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BRSSEL; -#[doc = "`read()` method returns [brssel::R](brssel::R) reader structure"] -impl crate::Readable for BRSSEL {} -#[doc = "`write(|w| ..)` method takes [brssel::W](brssel::W) writer structure"] -impl crate::Writable for BRSSEL {} +#[doc = "BRSSEL register accessor: an alias for `Reg`"] +pub type BRSSEL = crate::Reg; #[doc = "Background Request Source Channel Select Register"] pub mod brssel; -#[doc = "Background Request Source Pending Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [brspnd](brspnd) module"] -pub type BRSPND = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BRSPND; -#[doc = "`read()` method returns [brspnd::R](brspnd::R) reader structure"] -impl crate::Readable for BRSPND {} -#[doc = "`write(|w| ..)` method takes [brspnd::W](brspnd::W) writer structure"] -impl crate::Writable for BRSPND {} +#[doc = "BRSPND register accessor: an alias for `Reg`"] +pub type BRSPND = crate::Reg; #[doc = "Background Request Source Pending Register"] pub mod brspnd; -#[doc = "Background Request Source Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [brsctrl](brsctrl) module"] -pub type BRSCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BRSCTRL; -#[doc = "`read()` method returns [brsctrl::R](brsctrl::R) reader structure"] -impl crate::Readable for BRSCTRL {} -#[doc = "`write(|w| ..)` method takes [brsctrl::W](brsctrl::W) writer structure"] -impl crate::Writable for BRSCTRL {} +#[doc = "BRSCTRL register accessor: an alias for `Reg`"] +pub type BRSCTRL = crate::Reg; #[doc = "Background Request Source Control Register"] pub mod brsctrl; -#[doc = "Background Request Source Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [brsmr](brsmr) module"] -pub type BRSMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BRSMR; -#[doc = "`read()` method returns [brsmr::R](brsmr::R) reader structure"] -impl crate::Readable for BRSMR {} -#[doc = "`write(|w| ..)` method takes [brsmr::W](brsmr::W) writer structure"] -impl crate::Writable for BRSMR {} +#[doc = "BRSMR register accessor: an alias for `Reg`"] +pub type BRSMR = crate::Reg; #[doc = "Background Request Source Mode Register"] pub mod brsmr; -#[doc = "Global Result Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globrcr](globrcr) module"] -pub type GLOBRCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBRCR; -#[doc = "`read()` method returns [globrcr::R](globrcr::R) reader structure"] -impl crate::Readable for GLOBRCR {} -#[doc = "`write(|w| ..)` method takes [globrcr::W](globrcr::W) writer structure"] -impl crate::Writable for GLOBRCR {} +#[doc = "GLOBRCR register accessor: an alias for `Reg`"] +pub type GLOBRCR = crate::Reg; #[doc = "Global Result Control Register"] pub mod globrcr; -#[doc = "Global Result Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globres](globres) module"] -pub type GLOBRES = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBRES; -#[doc = "`read()` method returns [globres::R](globres::R) reader structure"] -impl crate::Readable for GLOBRES {} -#[doc = "`write(|w| ..)` method takes [globres::W](globres::W) writer structure"] -impl crate::Writable for GLOBRES {} +#[doc = "GLOBRES register accessor: an alias for `Reg`"] +pub type GLOBRES = crate::Reg; #[doc = "Global Result Register"] pub mod globres; -#[doc = "Global Result Register, Debug\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [globresd](globresd) module"] -pub type GLOBRESD = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _GLOBRESD; -#[doc = "`read()` method returns [globresd::R](globresd::R) reader structure"] -impl crate::Readable for GLOBRESD {} -#[doc = "`write(|w| ..)` method takes [globresd::W](globresd::W) writer structure"] -impl crate::Writable for GLOBRESD {} +#[doc = "GLOBRESD register accessor: an alias for `Reg`"] +pub type GLOBRESD = crate::Reg; #[doc = "Global Result Register, Debug"] pub mod globresd; -#[doc = "External Multiplexer Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [emuxsel](emuxsel) module"] -pub type EMUXSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EMUXSEL; -#[doc = "`read()` method returns [emuxsel::R](emuxsel::R) reader structure"] -impl crate::Readable for EMUXSEL {} -#[doc = "`write(|w| ..)` method takes [emuxsel::W](emuxsel::W) writer structure"] -impl crate::Writable for EMUXSEL {} +#[doc = "EMUXSEL register accessor: an alias for `Reg`"] +pub type EMUXSEL = crate::Reg; #[doc = "External Multiplexer Select Register"] pub mod emuxsel; diff --git a/src/vadc/brsctrl.rs b/src/vadc/brsctrl.rs index d58a21b8..6573e1bd 100644 --- a/src/vadc/brsctrl.rs +++ b/src/vadc/brsctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BRSCTRL"] -pub type R = crate::R; -#[doc = "Writer for register BRSCTRL"] -pub type W = crate::W; -#[doc = "Register BRSCTRL `reset()`'s with value 0"] -impl crate::ResetValue for super::BRSCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BRSCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BRSCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source-specific Result Register\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRCRESREG`"] -pub type SRCRESREG_R = crate::R; +#[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] +pub struct SRCRESREG_R(crate::FieldReader); impl SRCRESREG_R { + pub(crate) fn new(bits: u8) -> Self { + SRCRESREG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRCRESREG_A::VALUE1), - 1 => Val(SRCRESREG_A::VALUE2), - 15 => Val(SRCRESREG_A::VALUE3), - i => Res(i), + 0 => Some(SRCRESREG_A::VALUE1), + 1 => Some(SRCRESREG_A::VALUE2), + 15 => Some(SRCRESREG_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRCRESREG_A::VALUE1 + **self == SRCRESREG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRCRESREG_A::VALUE2 + **self == SRCRESREG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SRCRESREG_A::VALUE3 + **self == SRCRESREG_A::VALUE3 + } +} +impl core::ops::Deref for SRCRESREG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SRCRESREG`"] +#[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] pub struct SRCRESREG_W<'a> { w: &'a mut W, } @@ -85,13 +118,25 @@ impl<'a> SRCRESREG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `XTSEL`"] -pub type XTSEL_R = crate::R; -#[doc = "Write proxy for field `XTSEL`"] +#[doc = "Field `XTSEL` reader - External Trigger Input Selection"] +pub struct XTSEL_R(crate::FieldReader); +impl XTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + XTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XTSEL` writer - External Trigger Input Selection"] pub struct XTSEL_W<'a> { w: &'a mut W, } @@ -99,12 +144,24 @@ impl<'a> XTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `XTLVL`"] -pub type XTLVL_R = crate::R; +#[doc = "Field `XTLVL` reader - External Trigger Level"] +pub struct XTLVL_R(crate::FieldReader); +impl XTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + XTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -124,9 +181,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `XTMODE`"] -pub type XTMODE_R = crate::R; +#[doc = "Field `XTMODE` reader - Trigger Operating Mode"] +pub struct XTMODE_R(crate::FieldReader); impl XTMODE_R { + pub(crate) fn new(bits: u8) -> Self { + XTMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XTMODE_A { @@ -141,25 +201,32 @@ impl XTMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XTMODE_A::VALUE1 + **self == XTMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XTMODE_A::VALUE2 + **self == XTMODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == XTMODE_A::VALUE3 + **self == XTMODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == XTMODE_A::VALUE4 + **self == XTMODE_A::VALUE4 } } -#[doc = "Write proxy for field `XTMODE`"] +impl core::ops::Deref for XTMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XTMODE` writer - Trigger Operating Mode"] pub struct XTMODE_W<'a> { w: &'a mut W, } @@ -167,9 +234,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTMODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No external trigger"] #[inline(always)] @@ -194,7 +259,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -212,7 +277,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `XTWC`"] +#[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] pub struct XTWC_W<'a> { w: &'a mut W, } @@ -220,9 +285,7 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to trigger configuration"] #[inline(always)] @@ -247,13 +310,25 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `GTSEL`"] -pub type GTSEL_R = crate::R; -#[doc = "Write proxy for field `GTSEL`"] +#[doc = "Field `GTSEL` reader - Gate Input Selection"] +pub struct GTSEL_R(crate::FieldReader); +impl GTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + GTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GTSEL` writer - Gate Input Selection"] pub struct GTSEL_W<'a> { w: &'a mut W, } @@ -261,12 +336,24 @@ impl<'a> GTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } -#[doc = "Reader of field `GTLVL`"] -pub type GTLVL_R = crate::R; +#[doc = "Field `GTLVL` reader - Gate Input Level"] +pub struct GTLVL_R(crate::FieldReader); +impl GTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + GTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum GTWC_AW { @@ -281,7 +368,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `GTWC`"] +#[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] pub struct GTWC_W<'a> { w: &'a mut W, } @@ -289,9 +376,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to gate configuration"] #[inline(always)] @@ -316,7 +401,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -383,4 +468,30 @@ impl W { pub fn gtwc(&mut self) -> GTWC_W { GTWC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Background Request Source Control Register\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 [brsctrl](index.html) module"] +pub struct BRSCTRL_SPEC; +impl crate::RegisterSpec for BRSCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [brsctrl::R](R) reader structure"] +impl crate::Readable for BRSCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [brsctrl::W](W) writer structure"] +impl crate::Writable for BRSCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BRSCTRL to value 0"] +impl crate::Resettable for BRSCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/brsmr.rs b/src/vadc/brsmr.rs index 86df9caf..5ec367d2 100644 --- a/src/vadc/brsmr.rs +++ b/src/vadc/brsmr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BRSMR"] -pub type R = crate::R; -#[doc = "Writer for register BRSMR"] -pub type W = crate::W; -#[doc = "Register BRSMR `reset()`'s with value 0"] -impl crate::ResetValue for super::BRSMR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BRSMR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BRSMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable Gate\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENGT`"] -pub type ENGT_R = crate::R; +#[doc = "Field `ENGT` reader - Enable Gate"] +pub struct ENGT_R(crate::FieldReader); impl ENGT_R { + pub(crate) fn new(bits: u8) -> Self { + ENGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENGT_A { @@ -46,25 +73,32 @@ impl ENGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENGT_A::VALUE1 + **self == ENGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENGT_A::VALUE2 + **self == ENGT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENGT_A::VALUE3 + **self == ENGT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENGT_A::VALUE4 + **self == ENGT_A::VALUE4 } } -#[doc = "Write proxy for field `ENGT`"] +impl core::ops::Deref for ENGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENGT` writer - Enable Gate"] pub struct ENGT_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENGT_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No conversion requests are issued"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -117,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENTR`"] -pub type ENTR_R = crate::R; +#[doc = "Field `ENTR` reader - Enable External Trigger"] +pub struct ENTR_R(crate::FieldReader); impl ENTR_R { + pub(crate) fn new(bits: bool) -> Self { + ENTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENTR_A { @@ -131,15 +166,22 @@ impl ENTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENTR_A::VALUE1 + **self == ENTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENTR_A::VALUE2 + **self == ENTR_A::VALUE2 + } +} +impl core::ops::Deref for ENTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENTR`"] +#[doc = "Field `ENTR` writer - Enable External Trigger"] pub struct ENTR_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External trigger disabled"] #[inline(always)] @@ -174,7 +214,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -192,9 +232,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENSI`"] -pub type ENSI_R = crate::R; +#[doc = "Field `ENSI` reader - Enable Source Interrupt"] +pub struct ENSI_R(crate::FieldReader); impl ENSI_R { + pub(crate) fn new(bits: bool) -> Self { + ENSI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENSI_A { @@ -206,15 +249,22 @@ impl ENSI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENSI_A::VALUE1 + **self == ENSI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENSI_A::VALUE2 + **self == ENSI_A::VALUE2 } } -#[doc = "Write proxy for field `ENSI`"] +impl core::ops::Deref for ENSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENSI` writer - Enable Source Interrupt"] pub struct ENSI_W<'a> { w: &'a mut W, } @@ -222,9 +272,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENSI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No request source interrupt"] #[inline(always)] @@ -249,7 +297,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -267,9 +315,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCAN`"] -pub type SCAN_R = crate::R; +#[doc = "Field `SCAN` reader - Autoscan Enable"] +pub struct SCAN_R(crate::FieldReader); impl SCAN_R { + pub(crate) fn new(bits: bool) -> Self { + SCAN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCAN_A { @@ -281,15 +332,22 @@ impl SCAN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCAN_A::VALUE1 + **self == SCAN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCAN_A::VALUE2 + **self == SCAN_A::VALUE2 } } -#[doc = "Write proxy for field `SCAN`"] +impl core::ops::Deref for SCAN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCAN` writer - Autoscan Enable"] pub struct SCAN_W<'a> { w: &'a mut W, } @@ -297,9 +355,7 @@ impl<'a> SCAN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCAN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No autoscan"] #[inline(always)] @@ -324,7 +380,7 @@ impl<'a> SCAN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -342,9 +398,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LDM`"] -pub type LDM_R = crate::R; +#[doc = "Field `LDM` reader - Autoscan Source Load Event Mode"] +pub struct LDM_R(crate::FieldReader); impl LDM_R { + pub(crate) fn new(bits: bool) -> Self { + LDM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LDM_A { @@ -356,15 +415,22 @@ impl LDM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LDM_A::VALUE1 + **self == LDM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LDM_A::VALUE2 + **self == LDM_A::VALUE2 + } +} +impl core::ops::Deref for LDM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LDM`"] +#[doc = "Field `LDM` writer - Autoscan Source Load Event Mode"] pub struct LDM_W<'a> { w: &'a mut W, } @@ -372,9 +438,7 @@ impl<'a> LDM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LDM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] @@ -399,7 +463,7 @@ impl<'a> LDM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -417,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REQGT`"] -pub type REQGT_R = crate::R; +#[doc = "Field `REQGT` reader - Request Gate Level"] +pub struct REQGT_R(crate::FieldReader); impl REQGT_R { + pub(crate) fn new(bits: bool) -> Self { + REQGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REQGT_A { @@ -431,12 +498,19 @@ impl REQGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REQGT_A::VALUE1 + **self == REQGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REQGT_A::VALUE2 + **self == REQGT_A::VALUE2 + } +} +impl core::ops::Deref for REQGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Clear Pending Bits\n\nValue on reset: 0"] @@ -453,7 +527,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CLRPND`"] +#[doc = "Field `CLRPND` writer - Clear Pending Bits"] pub struct CLRPND_W<'a> { w: &'a mut W, } @@ -461,9 +535,7 @@ impl<'a> CLRPND_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLRPND_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -488,7 +560,7 @@ impl<'a> CLRPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -506,7 +578,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LDEV`"] +#[doc = "Field `LDEV` writer - Generate Load Event"] pub struct LDEV_W<'a> { w: &'a mut W, } @@ -514,9 +586,7 @@ impl<'a> LDEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LDEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -541,7 +611,7 @@ impl<'a> LDEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -559,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPTDIS`"] -pub type RPTDIS_R = crate::R; +#[doc = "Field `RPTDIS` reader - Repeat Disable"] +pub struct RPTDIS_R(crate::FieldReader); impl RPTDIS_R { + pub(crate) fn new(bits: bool) -> Self { + RPTDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPTDIS_A { @@ -573,15 +646,22 @@ impl RPTDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPTDIS_A::VALUE1 + **self == RPTDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPTDIS_A::VALUE2 + **self == RPTDIS_A::VALUE2 + } +} +impl core::ops::Deref for RPTDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RPTDIS`"] +#[doc = "Field `RPTDIS` writer - Repeat Disable"] pub struct RPTDIS_W<'a> { w: &'a mut W, } @@ -589,9 +669,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RPTDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A cancelled conversion is repeated"] #[inline(always)] @@ -616,7 +694,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -698,4 +776,30 @@ impl W { pub fn rptdis(&mut self) -> RPTDIS_W { RPTDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Background Request Source Mode Register\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 [brsmr](index.html) module"] +pub struct BRSMR_SPEC; +impl crate::RegisterSpec for BRSMR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [brsmr::R](R) reader structure"] +impl crate::Readable for BRSMR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [brsmr::W](W) writer structure"] +impl crate::Writable for BRSMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BRSMR to value 0"] +impl crate::Resettable for BRSMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/brspnd.rs b/src/vadc/brspnd.rs index 8a36f5fe..038f9395 100644 --- a/src/vadc/brspnd.rs +++ b/src/vadc/brspnd.rs @@ -1,14 +1,37 @@ -#[doc = "Reader of register BRSPND[%s]"] -pub type R = crate::R; -#[doc = "Writer for register BRSPND[%s]"] -pub type W = crate::W; -#[doc = "Register BRSPND[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::BRSPND { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BRSPND[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BRSPND[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Channels Pending Group x\n\nValue on reset: 0"] @@ -25,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG0`"] -pub type CHPNDG0_R = crate::R; +#[doc = "Field `CHPNDG0` reader - Channels Pending Group x"] +pub struct CHPNDG0_R(crate::FieldReader); impl CHPNDG0_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG0_A { @@ -39,15 +65,22 @@ impl CHPNDG0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG0_A::VALUE1 + **self == CHPNDG0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG0_A::VALUE2 + **self == CHPNDG0_A::VALUE2 + } +} +impl core::ops::Deref for CHPNDG0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPNDG0`"] +#[doc = "Field `CHPNDG0` writer - Channels Pending Group x"] pub struct CHPNDG0_W<'a> { w: &'a mut W, } @@ -55,9 +88,7 @@ impl<'a> CHPNDG0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -82,7 +113,7 @@ impl<'a> CHPNDG0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -100,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG1`"] -pub type CHPNDG1_R = crate::R; +#[doc = "Field `CHPNDG1` reader - Channels Pending Group x"] +pub struct CHPNDG1_R(crate::FieldReader); impl CHPNDG1_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG1_A { @@ -114,15 +148,22 @@ impl CHPNDG1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG1_A::VALUE1 + **self == CHPNDG1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG1_A::VALUE2 + **self == CHPNDG1_A::VALUE2 } } -#[doc = "Write proxy for field `CHPNDG1`"] +impl core::ops::Deref for CHPNDG1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPNDG1` writer - Channels Pending Group x"] pub struct CHPNDG1_W<'a> { w: &'a mut W, } @@ -130,9 +171,7 @@ impl<'a> CHPNDG1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -157,7 +196,7 @@ impl<'a> CHPNDG1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -175,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG2`"] -pub type CHPNDG2_R = crate::R; +#[doc = "Field `CHPNDG2` reader - Channels Pending Group x"] +pub struct CHPNDG2_R(crate::FieldReader); impl CHPNDG2_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG2_A { @@ -189,15 +231,22 @@ impl CHPNDG2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG2_A::VALUE1 + **self == CHPNDG2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG2_A::VALUE2 + **self == CHPNDG2_A::VALUE2 + } +} +impl core::ops::Deref for CHPNDG2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPNDG2`"] +#[doc = "Field `CHPNDG2` writer - Channels Pending Group x"] pub struct CHPNDG2_W<'a> { w: &'a mut W, } @@ -205,9 +254,7 @@ impl<'a> CHPNDG2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -232,7 +279,7 @@ impl<'a> CHPNDG2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -250,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG3`"] -pub type CHPNDG3_R = crate::R; +#[doc = "Field `CHPNDG3` reader - Channels Pending Group x"] +pub struct CHPNDG3_R(crate::FieldReader); impl CHPNDG3_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG3_A { @@ -264,15 +314,22 @@ impl CHPNDG3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG3_A::VALUE1 + **self == CHPNDG3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG3_A::VALUE2 + **self == CHPNDG3_A::VALUE2 } } -#[doc = "Write proxy for field `CHPNDG3`"] +impl core::ops::Deref for CHPNDG3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPNDG3` writer - Channels Pending Group x"] pub struct CHPNDG3_W<'a> { w: &'a mut W, } @@ -280,9 +337,7 @@ impl<'a> CHPNDG3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -307,7 +362,7 @@ impl<'a> CHPNDG3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -325,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG4`"] -pub type CHPNDG4_R = crate::R; +#[doc = "Field `CHPNDG4` reader - Channels Pending Group x"] +pub struct CHPNDG4_R(crate::FieldReader); impl CHPNDG4_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG4_A { @@ -339,15 +397,22 @@ impl CHPNDG4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG4_A::VALUE1 + **self == CHPNDG4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG4_A::VALUE2 + **self == CHPNDG4_A::VALUE2 + } +} +impl core::ops::Deref for CHPNDG4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPNDG4`"] +#[doc = "Field `CHPNDG4` writer - Channels Pending Group x"] pub struct CHPNDG4_W<'a> { w: &'a mut W, } @@ -355,9 +420,7 @@ impl<'a> CHPNDG4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -382,7 +445,7 @@ impl<'a> CHPNDG4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -400,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG5`"] -pub type CHPNDG5_R = crate::R; +#[doc = "Field `CHPNDG5` reader - Channels Pending Group x"] +pub struct CHPNDG5_R(crate::FieldReader); impl CHPNDG5_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG5_A { @@ -414,15 +480,22 @@ impl CHPNDG5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG5_A::VALUE1 + **self == CHPNDG5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG5_A::VALUE2 + **self == CHPNDG5_A::VALUE2 } } -#[doc = "Write proxy for field `CHPNDG5`"] +impl core::ops::Deref for CHPNDG5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPNDG5` writer - Channels Pending Group x"] pub struct CHPNDG5_W<'a> { w: &'a mut W, } @@ -430,9 +503,7 @@ impl<'a> CHPNDG5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -457,7 +528,7 @@ impl<'a> CHPNDG5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -475,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG6`"] -pub type CHPNDG6_R = crate::R; +#[doc = "Field `CHPNDG6` reader - Channels Pending Group x"] +pub struct CHPNDG6_R(crate::FieldReader); impl CHPNDG6_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG6_A { @@ -489,15 +563,22 @@ impl CHPNDG6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG6_A::VALUE1 + **self == CHPNDG6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG6_A::VALUE2 + **self == CHPNDG6_A::VALUE2 + } +} +impl core::ops::Deref for CHPNDG6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPNDG6`"] +#[doc = "Field `CHPNDG6` writer - Channels Pending Group x"] pub struct CHPNDG6_W<'a> { w: &'a mut W, } @@ -505,9 +586,7 @@ impl<'a> CHPNDG6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -532,7 +611,7 @@ impl<'a> CHPNDG6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -550,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPNDG7`"] -pub type CHPNDG7_R = crate::R; +#[doc = "Field `CHPNDG7` reader - Channels Pending Group x"] +pub struct CHPNDG7_R(crate::FieldReader); impl CHPNDG7_R { + pub(crate) fn new(bits: bool) -> Self { + CHPNDG7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPNDG7_A { @@ -564,15 +646,22 @@ impl CHPNDG7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPNDG7_A::VALUE1 + **self == CHPNDG7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPNDG7_A::VALUE2 + **self == CHPNDG7_A::VALUE2 + } +} +impl core::ops::Deref for CHPNDG7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPNDG7`"] +#[doc = "Field `CHPNDG7` writer - Channels Pending Group x"] pub struct CHPNDG7_W<'a> { w: &'a mut W, } @@ -580,9 +669,7 @@ impl<'a> CHPNDG7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPNDG7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -607,7 +694,7 @@ impl<'a> CHPNDG7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -694,4 +781,31 @@ impl W { pub fn chpndg7(&mut self) -> CHPNDG7_W { CHPNDG7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Background Request Source Pending Register\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 [brspnd](index.html) module"] +pub struct BRSPND_SPEC; +impl crate::RegisterSpec for BRSPND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [brspnd::R](R) reader structure"] +impl crate::Readable for BRSPND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [brspnd::W](W) writer structure"] +impl crate::Writable for BRSPND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BRSPND[%s] +to value 0"] +impl crate::Resettable for BRSPND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/brssel.rs b/src/vadc/brssel.rs index 5486e89c..ac2bea6d 100644 --- a/src/vadc/brssel.rs +++ b/src/vadc/brssel.rs @@ -1,14 +1,37 @@ -#[doc = "Reader of register BRSSEL[%s]"] -pub type R = crate::R; -#[doc = "Writer for register BRSSEL[%s]"] -pub type W = crate::W; -#[doc = "Register BRSSEL[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::BRSSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BRSSEL[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BRSSEL[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Channel Selection Group x\n\nValue on reset: 0"] @@ -25,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG0`"] -pub type CHSELG0_R = crate::R; +#[doc = "Field `CHSELG0` reader - Channel Selection Group x"] +pub struct CHSELG0_R(crate::FieldReader); impl CHSELG0_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG0_A { @@ -39,15 +65,22 @@ impl CHSELG0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG0_A::VALUE1 + **self == CHSELG0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG0_A::VALUE2 + **self == CHSELG0_A::VALUE2 + } +} +impl core::ops::Deref for CHSELG0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSELG0`"] +#[doc = "Field `CHSELG0` writer - Channel Selection Group x"] pub struct CHSELG0_W<'a> { w: &'a mut W, } @@ -55,9 +88,7 @@ impl<'a> CHSELG0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -82,7 +113,7 @@ impl<'a> CHSELG0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -100,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG1`"] -pub type CHSELG1_R = crate::R; +#[doc = "Field `CHSELG1` reader - Channel Selection Group x"] +pub struct CHSELG1_R(crate::FieldReader); impl CHSELG1_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG1_A { @@ -114,15 +148,22 @@ impl CHSELG1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG1_A::VALUE1 + **self == CHSELG1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG1_A::VALUE2 + **self == CHSELG1_A::VALUE2 } } -#[doc = "Write proxy for field `CHSELG1`"] +impl core::ops::Deref for CHSELG1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSELG1` writer - Channel Selection Group x"] pub struct CHSELG1_W<'a> { w: &'a mut W, } @@ -130,9 +171,7 @@ impl<'a> CHSELG1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -157,7 +196,7 @@ impl<'a> CHSELG1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -175,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG2`"] -pub type CHSELG2_R = crate::R; +#[doc = "Field `CHSELG2` reader - Channel Selection Group x"] +pub struct CHSELG2_R(crate::FieldReader); impl CHSELG2_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG2_A { @@ -189,15 +231,22 @@ impl CHSELG2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG2_A::VALUE1 + **self == CHSELG2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG2_A::VALUE2 + **self == CHSELG2_A::VALUE2 + } +} +impl core::ops::Deref for CHSELG2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSELG2`"] +#[doc = "Field `CHSELG2` writer - Channel Selection Group x"] pub struct CHSELG2_W<'a> { w: &'a mut W, } @@ -205,9 +254,7 @@ impl<'a> CHSELG2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -232,7 +279,7 @@ impl<'a> CHSELG2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -250,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG3`"] -pub type CHSELG3_R = crate::R; +#[doc = "Field `CHSELG3` reader - Channel Selection Group x"] +pub struct CHSELG3_R(crate::FieldReader); impl CHSELG3_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG3_A { @@ -264,15 +314,22 @@ impl CHSELG3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG3_A::VALUE1 + **self == CHSELG3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG3_A::VALUE2 + **self == CHSELG3_A::VALUE2 } } -#[doc = "Write proxy for field `CHSELG3`"] +impl core::ops::Deref for CHSELG3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSELG3` writer - Channel Selection Group x"] pub struct CHSELG3_W<'a> { w: &'a mut W, } @@ -280,9 +337,7 @@ impl<'a> CHSELG3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -307,7 +362,7 @@ impl<'a> CHSELG3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -325,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG4`"] -pub type CHSELG4_R = crate::R; +#[doc = "Field `CHSELG4` reader - Channel Selection Group x"] +pub struct CHSELG4_R(crate::FieldReader); impl CHSELG4_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG4_A { @@ -339,15 +397,22 @@ impl CHSELG4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG4_A::VALUE1 + **self == CHSELG4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG4_A::VALUE2 + **self == CHSELG4_A::VALUE2 + } +} +impl core::ops::Deref for CHSELG4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSELG4`"] +#[doc = "Field `CHSELG4` writer - Channel Selection Group x"] pub struct CHSELG4_W<'a> { w: &'a mut W, } @@ -355,9 +420,7 @@ impl<'a> CHSELG4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -382,7 +445,7 @@ impl<'a> CHSELG4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -400,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG5`"] -pub type CHSELG5_R = crate::R; +#[doc = "Field `CHSELG5` reader - Channel Selection Group x"] +pub struct CHSELG5_R(crate::FieldReader); impl CHSELG5_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG5_A { @@ -414,15 +480,22 @@ impl CHSELG5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG5_A::VALUE1 + **self == CHSELG5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG5_A::VALUE2 + **self == CHSELG5_A::VALUE2 } } -#[doc = "Write proxy for field `CHSELG5`"] +impl core::ops::Deref for CHSELG5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSELG5` writer - Channel Selection Group x"] pub struct CHSELG5_W<'a> { w: &'a mut W, } @@ -430,9 +503,7 @@ impl<'a> CHSELG5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -457,7 +528,7 @@ impl<'a> CHSELG5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -475,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG6`"] -pub type CHSELG6_R = crate::R; +#[doc = "Field `CHSELG6` reader - Channel Selection Group x"] +pub struct CHSELG6_R(crate::FieldReader); impl CHSELG6_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG6_A { @@ -489,15 +563,22 @@ impl CHSELG6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG6_A::VALUE1 + **self == CHSELG6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG6_A::VALUE2 + **self == CHSELG6_A::VALUE2 + } +} +impl core::ops::Deref for CHSELG6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSELG6`"] +#[doc = "Field `CHSELG6` writer - Channel Selection Group x"] pub struct CHSELG6_W<'a> { w: &'a mut W, } @@ -505,9 +586,7 @@ impl<'a> CHSELG6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -532,7 +611,7 @@ impl<'a> CHSELG6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -550,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSELG7`"] -pub type CHSELG7_R = crate::R; +#[doc = "Field `CHSELG7` reader - Channel Selection Group x"] +pub struct CHSELG7_R(crate::FieldReader); impl CHSELG7_R { + pub(crate) fn new(bits: bool) -> Self { + CHSELG7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSELG7_A { @@ -564,15 +646,22 @@ impl CHSELG7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSELG7_A::VALUE1 + **self == CHSELG7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSELG7_A::VALUE2 + **self == CHSELG7_A::VALUE2 + } +} +impl core::ops::Deref for CHSELG7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSELG7`"] +#[doc = "Field `CHSELG7` writer - Channel Selection Group x"] pub struct CHSELG7_W<'a> { w: &'a mut W, } @@ -580,9 +669,7 @@ impl<'a> CHSELG7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSELG7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -607,7 +694,7 @@ impl<'a> CHSELG7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -694,4 +781,31 @@ impl W { pub fn chselg7(&mut self) -> CHSELG7_W { CHSELG7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Background Request Source Channel Select Register\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 [brssel](index.html) module"] +pub struct BRSSEL_SPEC; +impl crate::RegisterSpec for BRSSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [brssel::R](R) reader structure"] +impl crate::Readable for BRSSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [brssel::W](W) writer structure"] +impl crate::Writable for BRSSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BRSSEL[%s] +to value 0"] +impl crate::Resettable for BRSSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/clc.rs b/src/vadc/clc.rs index c190baf2..a7720127 100644 --- a/src/vadc/clc.rs +++ b/src/vadc/clc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CLC"] -pub type R = crate::R; -#[doc = "Writer for register CLC"] -pub type W = crate::W; -#[doc = "Register CLC `reset()`'s with value 0x03"] -impl crate::ResetValue for super::CLC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x03 +#[doc = "Register `CLC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Module Disable Request Bit\n\nValue on reset: 1"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DISR`"] -pub type DISR_R = crate::R; +#[doc = "Field `DISR` reader - Module Disable Request Bit"] +pub struct DISR_R(crate::FieldReader); impl DISR_R { + pub(crate) fn new(bits: bool) -> Self { + DISR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DISR_A { @@ -38,15 +65,22 @@ impl DISR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DISR_A::VALUE1 + **self == DISR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DISR_A::VALUE2 + **self == DISR_A::VALUE2 } } -#[doc = "Write proxy for field `DISR`"] +impl core::ops::Deref for DISR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISR` writer - Module Disable Request Bit"] pub struct DISR_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> DISR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DISR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "On request: enable the module clock"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> DISR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DISS`"] -pub type DISS_R = crate::R; +#[doc = "Field `DISS` reader - Module Disable Status Bit"] +pub struct DISS_R(crate::FieldReader); impl DISS_R { + pub(crate) fn new(bits: bool) -> Self { + DISS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DISS_A { @@ -113,12 +148,19 @@ impl DISS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DISS_A::VALUE1 + **self == DISS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DISS_A::VALUE2 + **self == DISS_A::VALUE2 + } +} +impl core::ops::Deref for DISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sleep Mode Enable Control\n\nValue on reset: 0"] @@ -135,9 +177,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EDIS`"] -pub type EDIS_R = crate::R; +#[doc = "Field `EDIS` reader - Sleep Mode Enable Control"] +pub struct EDIS_R(crate::FieldReader); impl EDIS_R { + pub(crate) fn new(bits: bool) -> Self { + EDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EDIS_A { @@ -149,15 +194,22 @@ impl EDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EDIS_A::VALUE1 + **self == EDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EDIS_A::VALUE2 + **self == EDIS_A::VALUE2 } } -#[doc = "Write proxy for field `EDIS`"] +impl core::ops::Deref for EDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDIS` writer - Sleep Mode Enable Control"] pub struct EDIS_W<'a> { w: &'a mut W, } @@ -165,9 +217,7 @@ impl<'a> EDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Sleep mode request is enabled and functional"] #[inline(always)] @@ -192,7 +242,7 @@ impl<'a> EDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -224,4 +274,30 @@ impl W { pub fn edis(&mut self) -> EDIS_W { EDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clock Control Register\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 [clc](index.html) module"] +pub struct CLC_SPEC; +impl crate::RegisterSpec for CLC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clc::R](R) reader structure"] +impl crate::Readable for CLC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [clc::W](W) writer structure"] +impl crate::Writable for CLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLC to value 0x03"] +impl crate::Resettable for CLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03 + } } diff --git a/src/vadc/emuxsel.rs b/src/vadc/emuxsel.rs index f522b05d..67ed316c 100644 --- a/src/vadc/emuxsel.rs +++ b/src/vadc/emuxsel.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register EMUXSEL"] -pub type R = crate::R; -#[doc = "Writer for register EMUXSEL"] -pub type W = crate::W; -#[doc = "Register EMUXSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::EMUXSEL { - type Type = u32; +#[doc = "Register `EMUXSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EMUXSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `EMUXGRP0` reader - External Multiplexer Group for Interface x"] +pub struct EMUXGRP0_R(crate::FieldReader); +impl EMUXGRP0_R { + pub(crate) fn new(bits: u8) -> Self { + EMUXGRP0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUXGRP0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `EMUXGRP0`"] -pub type EMUXGRP0_R = crate::R; -#[doc = "Write proxy for field `EMUXGRP0`"] +#[doc = "Field `EMUXGRP0` writer - External Multiplexer Group for Interface x"] pub struct EMUXGRP0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> EMUXGRP0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `EMUXGRP1`"] -pub type EMUXGRP1_R = crate::R; -#[doc = "Write proxy for field `EMUXGRP1`"] +#[doc = "Field `EMUXGRP1` reader - External Multiplexer Group for Interface x"] +pub struct EMUXGRP1_R(crate::FieldReader); +impl EMUXGRP1_R { + pub(crate) fn new(bits: u8) -> Self { + EMUXGRP1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUXGRP1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUXGRP1` writer - External Multiplexer Group for Interface x"] pub struct EMUXGRP1_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> EMUXGRP1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn emuxgrp1(&mut self) -> EMUXGRP1_W { EMUXGRP1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External Multiplexer Select Register\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 [emuxsel](index.html) module"] +pub struct EMUXSEL_SPEC; +impl crate::RegisterSpec for EMUXSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [emuxsel::R](R) reader structure"] +impl crate::Readable for EMUXSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [emuxsel::W](W) writer structure"] +impl crate::Writable for EMUXSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EMUXSEL to value 0"] +impl crate::Resettable for EMUXSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globbound.rs b/src/vadc/globbound.rs index f7a679a0..1a4bba3e 100644 --- a/src/vadc/globbound.rs +++ b/src/vadc/globbound.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLOBBOUND"] -pub type R = crate::R; -#[doc = "Writer for register GLOBBOUND"] -pub type W = crate::W; -#[doc = "Register GLOBBOUND `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBBOUND { - type Type = u32; +#[doc = "Register `GLOBBOUND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBBOUND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BOUNDARY0` reader - Boundary Value 0 for Limit Checking"] +pub struct BOUNDARY0_R(crate::FieldReader); +impl BOUNDARY0_R { + pub(crate) fn new(bits: u16) -> Self { + BOUNDARY0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BOUNDARY0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `BOUNDARY0`"] -pub type BOUNDARY0_R = crate::R; -#[doc = "Write proxy for field `BOUNDARY0`"] +#[doc = "Field `BOUNDARY0` writer - Boundary Value 0 for Limit Checking"] pub struct BOUNDARY0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> BOUNDARY0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } -#[doc = "Reader of field `BOUNDARY1`"] -pub type BOUNDARY1_R = crate::R; -#[doc = "Write proxy for field `BOUNDARY1`"] +#[doc = "Field `BOUNDARY1` reader - Boundary Value 1 for Limit Checking"] +pub struct BOUNDARY1_R(crate::FieldReader); +impl BOUNDARY1_R { + pub(crate) fn new(bits: u16) -> Self { + BOUNDARY1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BOUNDARY1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BOUNDARY1` writer - Boundary Value 1 for Limit Checking"] pub struct BOUNDARY1_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> BOUNDARY1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 16)) | (((value as u32) & 0x0fff) << 16); + self.w.bits = (self.w.bits & !(0x0fff << 16)) | ((value as u32 & 0x0fff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn boundary1(&mut self) -> BOUNDARY1_W { BOUNDARY1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Boundary Select Register\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 [globbound](index.html) module"] +pub struct GLOBBOUND_SPEC; +impl crate::RegisterSpec for GLOBBOUND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globbound::R](R) reader structure"] +impl crate::Readable for GLOBBOUND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globbound::W](W) writer structure"] +impl crate::Writable for GLOBBOUND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBBOUND to value 0"] +impl crate::Resettable for GLOBBOUND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globcfg.rs b/src/vadc/globcfg.rs index cc7abc4a..24366820 100644 --- a/src/vadc/globcfg.rs +++ b/src/vadc/globcfg.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GLOBCFG"] -pub type R = crate::R; -#[doc = "Writer for register GLOBCFG"] -pub type W = crate::W; -#[doc = "Register GLOBCFG `reset()`'s with value 0x0f"] -impl crate::ResetValue for super::GLOBCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0x0f +#[doc = "Register `GLOBCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Divider Factor for the Analog Internal Clock\n\nValue on reset: 15"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DIVA`"] -pub type DIVA_R = crate::R; +#[doc = "Field `DIVA` reader - Divider Factor for the Analog Internal Clock"] +pub struct DIVA_R(crate::FieldReader); impl DIVA_R { + pub(crate) fn new(bits: u8) -> Self { + DIVA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DIVA_A::VALUE1), - 1 => Val(DIVA_A::VALUE2), - 2 => Val(DIVA_A::VALUE3), - 31 => Val(DIVA_A::VALUE4), - i => Res(i), + 0 => Some(DIVA_A::VALUE1), + 1 => Some(DIVA_A::VALUE2), + 2 => Some(DIVA_A::VALUE3), + 31 => Some(DIVA_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIVA_A::VALUE1 + **self == DIVA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIVA_A::VALUE2 + **self == DIVA_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DIVA_A::VALUE3 + **self == DIVA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DIVA_A::VALUE4 + **self == DIVA_A::VALUE4 } } -#[doc = "Write proxy for field `DIVA`"] +impl core::ops::Deref for DIVA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIVA` writer - Divider Factor for the Analog Internal Clock"] pub struct DIVA_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> DIVA_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } @@ -116,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DCMSB`"] -pub type DCMSB_R = crate::R; +#[doc = "Field `DCMSB` reader - Double Clock for the MSB Conversion"] +pub struct DCMSB_R(crate::FieldReader); impl DCMSB_R { + pub(crate) fn new(bits: bool) -> Self { + DCMSB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DCMSB_A { @@ -130,15 +166,22 @@ impl DCMSB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DCMSB_A::VALUE1 + **self == DCMSB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DCMSB_A::VALUE2 + **self == DCMSB_A::VALUE2 } } -#[doc = "Write proxy for field `DCMSB`"] +impl core::ops::Deref for DCMSB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCMSB` writer - Double Clock for the MSB Conversion"] pub struct DCMSB_W<'a> { w: &'a mut W, } @@ -146,9 +189,7 @@ impl<'a> DCMSB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DCMSB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "1 clock cycles for the MSB (standard)"] #[inline(always)] @@ -173,7 +214,7 @@ impl<'a> DCMSB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -196,9 +237,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DIVD`"] -pub type DIVD_R = crate::R; +#[doc = "Field `DIVD` reader - Divider Factor for the Arbiter Clock"] +pub struct DIVD_R(crate::FieldReader); impl DIVD_R { + pub(crate) fn new(bits: u8) -> Self { + DIVD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DIVD_A { @@ -213,25 +257,32 @@ impl DIVD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DIVD_A::VALUE1 + **self == DIVD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DIVD_A::VALUE2 + **self == DIVD_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DIVD_A::VALUE3 + **self == DIVD_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == DIVD_A::VALUE4 + **self == DIVD_A::VALUE4 + } +} +impl core::ops::Deref for DIVD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DIVD`"] +#[doc = "Field `DIVD` writer - Divider Factor for the Arbiter Clock"] pub struct DIVD_W<'a> { w: &'a mut W, } @@ -239,9 +290,7 @@ impl<'a> DIVD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIVD_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "fADCD = fADC"] #[inline(always)] @@ -266,7 +315,7 @@ impl<'a> DIVD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -284,7 +333,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `DIVWC`"] +#[doc = "Field `DIVWC` writer - Write Control for Divider Parameters"] pub struct DIVWC_W<'a> { w: &'a mut W, } @@ -292,9 +341,7 @@ impl<'a> DIVWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DIVWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to divider parameters"] #[inline(always)] @@ -319,7 +366,7 @@ impl<'a> DIVWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -337,9 +384,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPCAL0`"] -pub type DPCAL0_R = crate::R; +#[doc = "Field `DPCAL0` reader - Disable Post-Calibration"] +pub struct DPCAL0_R(crate::FieldReader); impl DPCAL0_R { + pub(crate) fn new(bits: bool) -> Self { + DPCAL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPCAL0_A { @@ -351,15 +401,22 @@ impl DPCAL0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPCAL0_A::VALUE1 + **self == DPCAL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPCAL0_A::VALUE2 + **self == DPCAL0_A::VALUE2 } } -#[doc = "Write proxy for field `DPCAL0`"] +impl core::ops::Deref for DPCAL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPCAL0` writer - Disable Post-Calibration"] pub struct DPCAL0_W<'a> { w: &'a mut W, } @@ -367,9 +424,7 @@ impl<'a> DPCAL0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPCAL0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] @@ -394,7 +449,7 @@ impl<'a> DPCAL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -412,9 +467,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPCAL1`"] -pub type DPCAL1_R = crate::R; +#[doc = "Field `DPCAL1` reader - Disable Post-Calibration"] +pub struct DPCAL1_R(crate::FieldReader); impl DPCAL1_R { + pub(crate) fn new(bits: bool) -> Self { + DPCAL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPCAL1_A { @@ -426,15 +484,22 @@ impl DPCAL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPCAL1_A::VALUE1 + **self == DPCAL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPCAL1_A::VALUE2 + **self == DPCAL1_A::VALUE2 + } +} +impl core::ops::Deref for DPCAL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DPCAL1`"] +#[doc = "Field `DPCAL1` writer - Disable Post-Calibration"] pub struct DPCAL1_W<'a> { w: &'a mut W, } @@ -442,9 +507,7 @@ impl<'a> DPCAL1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPCAL1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] @@ -469,7 +532,7 @@ impl<'a> DPCAL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -487,9 +550,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPCAL2`"] -pub type DPCAL2_R = crate::R; +#[doc = "Field `DPCAL2` reader - Disable Post-Calibration"] +pub struct DPCAL2_R(crate::FieldReader); impl DPCAL2_R { + pub(crate) fn new(bits: bool) -> Self { + DPCAL2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPCAL2_A { @@ -501,15 +567,22 @@ impl DPCAL2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPCAL2_A::VALUE1 + **self == DPCAL2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPCAL2_A::VALUE2 + **self == DPCAL2_A::VALUE2 } } -#[doc = "Write proxy for field `DPCAL2`"] +impl core::ops::Deref for DPCAL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPCAL2` writer - Disable Post-Calibration"] pub struct DPCAL2_W<'a> { w: &'a mut W, } @@ -517,9 +590,7 @@ impl<'a> DPCAL2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPCAL2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] @@ -544,7 +615,7 @@ impl<'a> DPCAL2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -562,9 +633,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `DPCAL3`"] -pub type DPCAL3_R = crate::R; +#[doc = "Field `DPCAL3` reader - Disable Post-Calibration"] +pub struct DPCAL3_R(crate::FieldReader); impl DPCAL3_R { + pub(crate) fn new(bits: bool) -> Self { + DPCAL3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DPCAL3_A { @@ -576,15 +650,22 @@ impl DPCAL3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DPCAL3_A::VALUE1 + **self == DPCAL3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DPCAL3_A::VALUE2 + **self == DPCAL3_A::VALUE2 } } -#[doc = "Write proxy for field `DPCAL3`"] +impl core::ops::Deref for DPCAL3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DPCAL3` writer - Disable Post-Calibration"] pub struct DPCAL3_W<'a> { w: &'a mut W, } @@ -592,9 +673,7 @@ impl<'a> DPCAL3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DPCAL3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] @@ -619,7 +698,7 @@ impl<'a> DPCAL3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -637,7 +716,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SUCAL`"] +#[doc = "Field `SUCAL` writer - Start-Up Calibration"] pub struct SUCAL_W<'a> { w: &'a mut W, } @@ -645,9 +724,7 @@ impl<'a> SUCAL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SUCAL_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -672,7 +749,7 @@ impl<'a> SUCAL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -759,4 +836,30 @@ impl W { pub fn sucal(&mut self) -> SUCAL_W { SUCAL_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Configuration Register\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 [globcfg](index.html) module"] +pub struct GLOBCFG_SPEC; +impl crate::RegisterSpec for GLOBCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globcfg::R](R) reader structure"] +impl crate::Readable for GLOBCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globcfg::W](W) writer structure"] +impl crate::Writable for GLOBCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBCFG to value 0x0f"] +impl crate::Resettable for GLOBCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0f + } } diff --git a/src/vadc/globeflag.rs b/src/vadc/globeflag.rs index 5e9c0a23..355ef9f6 100644 --- a/src/vadc/globeflag.rs +++ b/src/vadc/globeflag.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GLOBEFLAG"] -pub type R = crate::R; -#[doc = "Writer for register GLOBEFLAG"] -pub type W = crate::W; -#[doc = "Register GLOBEFLAG `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBEFLAG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBEFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBEFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source Event (Background)\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SEVGLB`"] -pub type SEVGLB_R = crate::R; +#[doc = "Field `SEVGLB` reader - Source Event (Background)"] +pub struct SEVGLB_R(crate::FieldReader); impl SEVGLB_R { + pub(crate) fn new(bits: bool) -> Self { + SEVGLB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SEVGLB_A { @@ -38,15 +65,22 @@ impl SEVGLB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEVGLB_A::VALUE1 + **self == SEVGLB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEVGLB_A::VALUE2 + **self == SEVGLB_A::VALUE2 + } +} +impl core::ops::Deref for SEVGLB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SEVGLB`"] +#[doc = "Field `SEVGLB` writer - Source Event (Background)"] pub struct SEVGLB_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SEVGLB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEVGLB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No source event"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SEVGLB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REVGLB`"] -pub type REVGLB_R = crate::R; +#[doc = "Field `REVGLB` reader - Global Result Event"] +pub struct REVGLB_R(crate::FieldReader); impl REVGLB_R { + pub(crate) fn new(bits: bool) -> Self { + REVGLB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REVGLB_A { @@ -113,15 +148,22 @@ impl REVGLB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REVGLB_A::VALUE1 + **self == REVGLB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REVGLB_A::VALUE2 + **self == REVGLB_A::VALUE2 + } +} +impl core::ops::Deref for REVGLB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REVGLB`"] +#[doc = "Field `REVGLB` writer - Global Result Event"] pub struct REVGLB_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> REVGLB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REVGLB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> REVGLB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -174,7 +214,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SEVGLBCLR`"] +#[doc = "Field `SEVGLBCLR` writer - Clear Source Event (Background)"] pub struct SEVGLBCLR_W<'a> { w: &'a mut W, } @@ -182,9 +222,7 @@ impl<'a> SEVGLBCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEVGLBCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -209,7 +247,7 @@ impl<'a> SEVGLBCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -227,7 +265,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REVGLBCLR`"] +#[doc = "Field `REVGLBCLR` writer - Clear Global Result Event"] pub struct REVGLBCLR_W<'a> { w: &'a mut W, } @@ -235,9 +273,7 @@ impl<'a> REVGLBCLR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REVGLBCLR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -262,7 +298,7 @@ impl<'a> REVGLBCLR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -299,4 +335,30 @@ impl W { pub fn revglbclr(&mut self) -> REVGLBCLR_W { REVGLBCLR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Event Flag Register\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 [globeflag](index.html) module"] +pub struct GLOBEFLAG_SPEC; +impl crate::RegisterSpec for GLOBEFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globeflag::R](R) reader structure"] +impl crate::Readable for GLOBEFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globeflag::W](W) writer structure"] +impl crate::Writable for GLOBEFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBEFLAG to value 0"] +impl crate::Resettable for GLOBEFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globevnp.rs b/src/vadc/globevnp.rs index cc8758b4..a9cd2ea2 100644 --- a/src/vadc/globevnp.rs +++ b/src/vadc/globevnp.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GLOBEVNP"] -pub type R = crate::R; -#[doc = "Writer for register GLOBEVNP"] -pub type W = crate::W; -#[doc = "Register GLOBEVNP `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBEVNP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBEVNP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBEVNP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Service Request Node Pointer Backgr. Source\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SEV0NP`"] -pub type SEV0NP_R = crate::R; +#[doc = "Field `SEV0NP` reader - Service Request Node Pointer Backgr. Source"] +pub struct SEV0NP_R(crate::FieldReader); impl SEV0NP_R { + pub(crate) fn new(bits: u8) -> Self { + SEV0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SEV0NP_A::VALUE1), - 3 => Val(SEV0NP_A::VALUE2), - 4 => Val(SEV0NP_A::VALUE3), - 7 => Val(SEV0NP_A::VALUE4), - i => Res(i), + 0 => Some(SEV0NP_A::VALUE1), + 3 => Some(SEV0NP_A::VALUE2), + 4 => Some(SEV0NP_A::VALUE3), + 7 => Some(SEV0NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEV0NP_A::VALUE1 + **self == SEV0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEV0NP_A::VALUE2 + **self == SEV0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SEV0NP_A::VALUE3 + **self == SEV0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SEV0NP_A::VALUE4 + **self == SEV0NP_A::VALUE4 } } -#[doc = "Write proxy for field `SEV0NP`"] +impl core::ops::Deref for SEV0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEV0NP` writer - Service Request Node Pointer Backgr. Source"] pub struct SEV0NP_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> SEV0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV0NP`"] -pub type REV0NP_R = crate::R; +#[doc = "Field `REV0NP` reader - Service Request Node Pointer Backgr. Result"] +pub struct REV0NP_R(crate::FieldReader); impl REV0NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV0NP_A::VALUE1), - 3 => Val(REV0NP_A::VALUE2), - 4 => Val(REV0NP_A::VALUE3), - 7 => Val(REV0NP_A::VALUE4), - i => Res(i), + 0 => Some(REV0NP_A::VALUE1), + 3 => Some(REV0NP_A::VALUE2), + 4 => Some(REV0NP_A::VALUE3), + 7 => Some(REV0NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV0NP_A::VALUE1 + **self == REV0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV0NP_A::VALUE2 + **self == REV0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV0NP_A::VALUE3 + **self == REV0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV0NP_A::VALUE4 + **self == REV0NP_A::VALUE4 + } +} +impl core::ops::Deref for REV0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV0NP`"] +#[doc = "Field `REV0NP` writer - Service Request Node Pointer Backgr. Result"] pub struct REV0NP_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> REV0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -217,4 +259,30 @@ impl W { pub fn rev0np(&mut self) -> REV0NP_W { REV0NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Event Node Pointer Register\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 [globevnp](index.html) module"] +pub struct GLOBEVNP_SPEC; +impl crate::RegisterSpec for GLOBEVNP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globevnp::R](R) reader structure"] +impl crate::Readable for GLOBEVNP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globevnp::W](W) writer structure"] +impl crate::Writable for GLOBEVNP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBEVNP to value 0"] +impl crate::Resettable for GLOBEVNP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globiclass.rs b/src/vadc/globiclass.rs index f01ef294..d449bcf2 100644 --- a/src/vadc/globiclass.rs +++ b/src/vadc/globiclass.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register GLOBICLASS[%s]"] -pub type R = crate::R; -#[doc = "Writer for register GLOBICLASS[%s]"] -pub type W = crate::W; -#[doc = "Register GLOBICLASS[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBICLASS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBICLASS[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBICLASS[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `STCS`"] -pub type STCS_R = crate::R; -#[doc = "Write proxy for field `STCS`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `STCS` reader - Sample Time Control for Standard Conversions"] +pub struct STCS_R(crate::FieldReader); +impl STCS_R { + pub(crate) fn new(bits: u8) -> Self { + STCS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STCS` writer - Sample Time Control for Standard Conversions"] pub struct STCS_W<'a> { w: &'a mut W, } @@ -21,7 +56,7 @@ impl<'a> STCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } @@ -44,43 +79,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CMS`"] -pub type CMS_R = crate::R; +#[doc = "Field `CMS` reader - Conversion Mode for Standard Conversions"] +pub struct CMS_R(crate::FieldReader); impl CMS_R { + pub(crate) fn new(bits: u8) -> Self { + CMS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CMS_A::VALUE1), - 1 => Val(CMS_A::VALUE2), - 2 => Val(CMS_A::VALUE3), - 5 => Val(CMS_A::VALUE6), - i => Res(i), + 0 => Some(CMS_A::VALUE1), + 1 => Some(CMS_A::VALUE2), + 2 => Some(CMS_A::VALUE3), + 5 => Some(CMS_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMS_A::VALUE1 + **self == CMS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMS_A::VALUE2 + **self == CMS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CMS_A::VALUE3 + **self == CMS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == CMS_A::VALUE6 + **self == CMS_A::VALUE6 } } -#[doc = "Write proxy for field `CMS`"] +impl core::ops::Deref for CMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMS` writer - Conversion Mode for Standard Conversions"] pub struct CMS_W<'a> { w: &'a mut W, } @@ -113,13 +157,25 @@ impl<'a> CMS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `STCE`"] -pub type STCE_R = crate::R; -#[doc = "Write proxy for field `STCE`"] +#[doc = "Field `STCE` reader - Sample Time Control for EMUX Conversions"] +pub struct STCE_R(crate::FieldReader); +impl STCE_R { + pub(crate) fn new(bits: u8) -> Self { + STCE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STCE` writer - Sample Time Control for EMUX Conversions"] pub struct STCE_W<'a> { w: &'a mut W, } @@ -127,7 +183,7 @@ impl<'a> STCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); + self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16); self.w } } @@ -150,43 +206,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CME`"] -pub type CME_R = crate::R; +#[doc = "Field `CME` reader - Conversion Mode for EMUX Conversions"] +pub struct CME_R(crate::FieldReader); impl CME_R { + pub(crate) fn new(bits: u8) -> Self { + CME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CME_A::VALUE1), - 1 => Val(CME_A::VALUE2), - 2 => Val(CME_A::VALUE3), - 5 => Val(CME_A::VALUE6), - i => Res(i), + 0 => Some(CME_A::VALUE1), + 1 => Some(CME_A::VALUE2), + 2 => Some(CME_A::VALUE3), + 5 => Some(CME_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CME_A::VALUE1 + **self == CME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CME_A::VALUE2 + **self == CME_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CME_A::VALUE3 + **self == CME_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == CME_A::VALUE6 + **self == CME_A::VALUE6 + } +} +impl core::ops::Deref for CME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CME`"] +#[doc = "Field `CME` writer - Conversion Mode for EMUX Conversions"] pub struct CME_W<'a> { w: &'a mut W, } @@ -219,7 +284,7 @@ impl<'a> CME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -266,4 +331,31 @@ impl W { pub fn cme(&mut self) -> CME_W { CME_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Class Register, Global\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 [globiclass](index.html) module"] +pub struct GLOBICLASS_SPEC; +impl crate::RegisterSpec for GLOBICLASS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globiclass::R](R) reader structure"] +impl crate::Readable for GLOBICLASS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globiclass::W](W) writer structure"] +impl crate::Writable for GLOBICLASS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBICLASS[%s] +to value 0"] +impl crate::Resettable for GLOBICLASS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globrcr.rs b/src/vadc/globrcr.rs index 044e14df..2e23fac4 100644 --- a/src/vadc/globrcr.rs +++ b/src/vadc/globrcr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register GLOBRCR"] -pub type R = crate::R; -#[doc = "Writer for register GLOBRCR"] -pub type W = crate::W; -#[doc = "Register GLOBRCR `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBRCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBRCR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBRCR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Data Reduction Control\n\nValue on reset: 0"] @@ -23,25 +47,34 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DRCTR`"] -pub type DRCTR_R = crate::R; +#[doc = "Field `DRCTR` reader - Data Reduction Control"] +pub struct DRCTR_R(crate::FieldReader); impl DRCTR_R { + pub(crate) fn new(bits: u8) -> Self { + DRCTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DRCTR_A::VALUE1), - i => Res(i), + 0 => Some(DRCTR_A::VALUE1), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DRCTR_A::VALUE1 + **self == DRCTR_A::VALUE1 } } -#[doc = "Write proxy for field `DRCTR`"] +impl core::ops::Deref for DRCTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DRCTR` writer - Data Reduction Control"] pub struct DRCTR_W<'a> { w: &'a mut W, } @@ -59,7 +92,7 @@ impl<'a> DRCTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -77,9 +110,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WFR`"] -pub type WFR_R = crate::R; +#[doc = "Field `WFR` reader - Wait-for-Read Mode Enable"] +pub struct WFR_R(crate::FieldReader); impl WFR_R { + pub(crate) fn new(bits: bool) -> Self { + WFR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WFR_A { @@ -91,15 +127,22 @@ impl WFR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WFR_A::VALUE1 + **self == WFR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WFR_A::VALUE2 + **self == WFR_A::VALUE2 } } -#[doc = "Write proxy for field `WFR`"] +impl core::ops::Deref for WFR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WFR` writer - Wait-for-Read Mode Enable"] pub struct WFR_W<'a> { w: &'a mut W, } @@ -107,9 +150,7 @@ impl<'a> WFR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WFR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Overwrite mode"] #[inline(always)] @@ -134,7 +175,7 @@ impl<'a> WFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -152,9 +193,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRGEN`"] -pub type SRGEN_R = crate::R; +#[doc = "Field `SRGEN` reader - Service Request Generation Enable"] +pub struct SRGEN_R(crate::FieldReader); impl SRGEN_R { + pub(crate) fn new(bits: bool) -> Self { + SRGEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRGEN_A { @@ -166,15 +210,22 @@ impl SRGEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRGEN_A::VALUE1 + **self == SRGEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRGEN_A::VALUE2 + **self == SRGEN_A::VALUE2 } } -#[doc = "Write proxy for field `SRGEN`"] +impl core::ops::Deref for SRGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRGEN` writer - Service Request Generation Enable"] pub struct SRGEN_W<'a> { w: &'a mut W, } @@ -182,9 +233,7 @@ impl<'a> SRGEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRGEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No service request"] #[inline(always)] @@ -209,7 +258,7 @@ impl<'a> SRGEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -246,4 +295,30 @@ impl W { pub fn srgen(&mut self) -> SRGEN_W { SRGEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Result Control Register\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 [globrcr](index.html) module"] +pub struct GLOBRCR_SPEC; +impl crate::RegisterSpec for GLOBRCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globrcr::R](R) reader structure"] +impl crate::Readable for GLOBRCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globrcr::W](W) writer structure"] +impl crate::Writable for GLOBRCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBRCR to value 0"] +impl crate::Resettable for GLOBRCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globres.rs b/src/vadc/globres.rs index a70dd435..f45cb7e0 100644 --- a/src/vadc/globres.rs +++ b/src/vadc/globres.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLOBRES"] -pub type R = crate::R; -#[doc = "Writer for register GLOBRES"] -pub type W = crate::W; -#[doc = "Register GLOBRES `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBRES { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBRES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBRES` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; -#[doc = "Write proxy for field `RESULT`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RESULT` reader - Result of most recent conversion"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESULT` writer - Result of most recent conversion"] pub struct RESULT_W<'a> { w: &'a mut W, } @@ -20,18 +56,66 @@ impl<'a> RESULT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `GNR`"] -pub type GNR_R = crate::R; -#[doc = "Reader of field `CHNR`"] -pub type CHNR_R = crate::R; -#[doc = "Reader of field `EMUX`"] -pub type EMUX_R = crate::R; -#[doc = "Reader of field `CRS`"] -pub type CRS_R = crate::R; +#[doc = "Field `GNR` reader - Group Number"] +pub struct GNR_R(crate::FieldReader); +impl GNR_R { + pub(crate) fn new(bits: u8) -> Self { + GNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHNR` reader - Channel Number"] +pub struct CHNR_R(crate::FieldReader); +impl CHNR_R { + pub(crate) fn new(bits: u8) -> Self { + CHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUX` reader - External Multiplexer Setting"] +pub struct EMUX_R(crate::FieldReader); +impl EMUX_R { + pub(crate) fn new(bits: u8) -> Self { + EMUX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRS` reader - Converted Request Source"] +pub struct CRS_R(crate::FieldReader); +impl CRS_R { + pub(crate) fn new(bits: u8) -> Self { + CRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Fast Compare Result\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FCR_A { @@ -46,9 +130,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCR`"] -pub type FCR_R = crate::R; +#[doc = "Field `FCR` reader - Fast Compare Result"] +pub struct FCR_R(crate::FieldReader); impl FCR_R { + pub(crate) fn new(bits: bool) -> Self { + FCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCR_A { @@ -60,12 +147,19 @@ impl FCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCR_A::VALUE1 + **self == FCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCR_A::VALUE2 + **self == FCR_A::VALUE2 + } +} +impl core::ops::Deref for FCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Valid Flag\n\nValue on reset: 0"] @@ -82,9 +176,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF`"] -pub type VF_R = crate::R; +#[doc = "Field `VF` reader - Valid Flag"] +pub struct VF_R(crate::FieldReader); impl VF_R { + pub(crate) fn new(bits: bool) -> Self { + VF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF_A { @@ -96,15 +193,22 @@ impl VF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF_A::VALUE1 + **self == VF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF_A::VALUE2 + **self == VF_A::VALUE2 + } +} +impl core::ops::Deref for VF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF`"] +#[doc = "Field `VF` writer - Valid Flag"] pub struct VF_W<'a> { w: &'a mut W, } @@ -112,9 +216,7 @@ impl<'a> VF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -139,7 +241,7 @@ impl<'a> VF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -191,4 +293,30 @@ impl W { pub fn vf(&mut self) -> VF_W { VF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Result Register\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 [globres](index.html) module"] +pub struct GLOBRES_SPEC; +impl crate::RegisterSpec for GLOBRES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globres::R](R) reader structure"] +impl crate::Readable for GLOBRES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globres::W](W) writer structure"] +impl crate::Writable for GLOBRES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBRES to value 0"] +impl crate::Resettable for GLOBRES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globresd.rs b/src/vadc/globresd.rs index 4cd16c8d..5d87adec 100644 --- a/src/vadc/globresd.rs +++ b/src/vadc/globresd.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLOBRESD"] -pub type R = crate::R; -#[doc = "Writer for register GLOBRESD"] -pub type W = crate::W; -#[doc = "Register GLOBRESD `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBRESD { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBRESD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBRESD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; -#[doc = "Write proxy for field `RESULT`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RESULT` reader - Result of most recent conversion"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESULT` writer - Result of most recent conversion"] pub struct RESULT_W<'a> { w: &'a mut W, } @@ -20,18 +56,66 @@ impl<'a> RESULT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `GNR`"] -pub type GNR_R = crate::R; -#[doc = "Reader of field `CHNR`"] -pub type CHNR_R = crate::R; -#[doc = "Reader of field `EMUX`"] -pub type EMUX_R = crate::R; -#[doc = "Reader of field `CRS`"] -pub type CRS_R = crate::R; +#[doc = "Field `GNR` reader - Group Number"] +pub struct GNR_R(crate::FieldReader); +impl GNR_R { + pub(crate) fn new(bits: u8) -> Self { + GNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHNR` reader - Channel Number"] +pub struct CHNR_R(crate::FieldReader); +impl CHNR_R { + pub(crate) fn new(bits: u8) -> Self { + CHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUX` reader - External Multiplexer Setting"] +pub struct EMUX_R(crate::FieldReader); +impl EMUX_R { + pub(crate) fn new(bits: u8) -> Self { + EMUX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRS` reader - Converted Request Source"] +pub struct CRS_R(crate::FieldReader); +impl CRS_R { + pub(crate) fn new(bits: u8) -> Self { + CRS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Fast Compare Result\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FCR_A { @@ -46,9 +130,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCR`"] -pub type FCR_R = crate::R; +#[doc = "Field `FCR` reader - Fast Compare Result"] +pub struct FCR_R(crate::FieldReader); impl FCR_R { + pub(crate) fn new(bits: bool) -> Self { + FCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCR_A { @@ -60,12 +147,19 @@ impl FCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCR_A::VALUE1 + **self == FCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCR_A::VALUE2 + **self == FCR_A::VALUE2 + } +} +impl core::ops::Deref for FCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Valid Flag\n\nValue on reset: 0"] @@ -82,9 +176,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF`"] -pub type VF_R = crate::R; +#[doc = "Field `VF` reader - Valid Flag"] +pub struct VF_R(crate::FieldReader); impl VF_R { + pub(crate) fn new(bits: bool) -> Self { + VF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF_A { @@ -96,15 +193,22 @@ impl VF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF_A::VALUE1 + **self == VF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF_A::VALUE2 + **self == VF_A::VALUE2 + } +} +impl core::ops::Deref for VF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF`"] +#[doc = "Field `VF` writer - Valid Flag"] pub struct VF_W<'a> { w: &'a mut W, } @@ -112,9 +216,7 @@ impl<'a> VF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -139,7 +241,7 @@ impl<'a> VF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -191,4 +293,30 @@ impl W { pub fn vf(&mut self) -> VF_W { VF_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Result Register, Debug\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 [globresd](index.html) module"] +pub struct GLOBRESD_SPEC; +impl crate::RegisterSpec for GLOBRESD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globresd::R](R) reader structure"] +impl crate::Readable for GLOBRESD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globresd::W](W) writer structure"] +impl crate::Writable for GLOBRESD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBRESD to value 0"] +impl crate::Resettable for GLOBRESD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/globtf.rs b/src/vadc/globtf.rs index 5341fbec..d15731b0 100644 --- a/src/vadc/globtf.rs +++ b/src/vadc/globtf.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register GLOBTF"] -pub type R = crate::R; -#[doc = "Writer for register GLOBTF"] -pub type W = crate::W; -#[doc = "Register GLOBTF `reset()`'s with value 0"] -impl crate::ResetValue for super::GLOBTF { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `GLOBTF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GLOBTF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `CDGR`"] -pub type CDGR_R = crate::R; -#[doc = "Write proxy for field `CDGR`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CDGR` reader - Converter Diagnostics Group"] +pub struct CDGR_R(crate::FieldReader); +impl CDGR_R { + pub(crate) fn new(bits: u8) -> Self { + CDGR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CDGR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CDGR` writer - Converter Diagnostics Group"] pub struct CDGR_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> CDGR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -38,9 +74,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CDEN`"] -pub type CDEN_R = crate::R; +#[doc = "Field `CDEN` reader - Converter Diagnostics Enable"] +pub struct CDEN_R(crate::FieldReader); impl CDEN_R { + pub(crate) fn new(bits: bool) -> Self { + CDEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CDEN_A { @@ -52,15 +91,22 @@ impl CDEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CDEN_A::VALUE1 + **self == CDEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CDEN_A::VALUE2 + **self == CDEN_A::VALUE2 + } +} +impl core::ops::Deref for CDEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CDEN`"] +#[doc = "Field `CDEN` writer - Converter Diagnostics Enable"] pub struct CDEN_W<'a> { w: &'a mut W, } @@ -68,9 +114,7 @@ impl<'a> CDEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CDEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "All diagnostic pull devices are disconnected"] #[inline(always)] @@ -95,7 +139,7 @@ impl<'a> CDEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -118,9 +162,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CDSEL`"] -pub type CDSEL_R = crate::R; +#[doc = "Field `CDSEL` reader - Converter Diagnostics Pull-Devices Select"] +pub struct CDSEL_R(crate::FieldReader); impl CDSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CDSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CDSEL_A { @@ -135,25 +182,32 @@ impl CDSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CDSEL_A::VALUE1 + **self == CDSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CDSEL_A::VALUE2 + **self == CDSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CDSEL_A::VALUE3 + **self == CDSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CDSEL_A::VALUE4 + **self == CDSEL_A::VALUE4 + } +} +impl core::ops::Deref for CDSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CDSEL`"] +#[doc = "Field `CDSEL` writer - Converter Diagnostics Pull-Devices Select"] pub struct CDSEL_W<'a> { w: &'a mut W, } @@ -161,9 +215,7 @@ impl<'a> CDSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CDSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Connected to VAREF"] #[inline(always)] @@ -188,7 +240,7 @@ impl<'a> CDSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 9)) | (((value as u32) & 0x03) << 9); + self.w.bits = (self.w.bits & !(0x03 << 9)) | ((value as u32 & 0x03) << 9); self.w } } @@ -206,7 +258,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CDWC`"] +#[doc = "Field `CDWC` writer - Write Control for Conversion Diagnostics"] pub struct CDWC_W<'a> { w: &'a mut W, } @@ -214,9 +266,7 @@ impl<'a> CDWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CDWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to parameters"] #[inline(always)] @@ -241,7 +291,7 @@ impl<'a> CDWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -259,9 +309,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `PDD`"] -pub type PDD_R = crate::R; +#[doc = "Field `PDD` reader - Pull-Down Diagnostics Enable"] +pub struct PDD_R(crate::FieldReader); impl PDD_R { + pub(crate) fn new(bits: bool) -> Self { + PDD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PDD_A { @@ -273,15 +326,22 @@ impl PDD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PDD_A::VALUE1 + **self == PDD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PDD_A::VALUE2 + **self == PDD_A::VALUE2 + } +} +impl core::ops::Deref for PDD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PDD`"] +#[doc = "Field `PDD` writer - Pull-Down Diagnostics Enable"] pub struct PDD_W<'a> { w: &'a mut W, } @@ -289,9 +349,7 @@ impl<'a> PDD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PDD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Disconnected"] #[inline(always)] @@ -316,7 +374,7 @@ impl<'a> PDD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -334,7 +392,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `MDWC`"] +#[doc = "Field `MDWC` writer - Write Control for Multiplexer Diagnostics"] pub struct MDWC_W<'a> { w: &'a mut W, } @@ -342,9 +400,7 @@ impl<'a> MDWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MDWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to parameters"] #[inline(always)] @@ -369,7 +425,7 @@ impl<'a> MDWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -426,4 +482,30 @@ impl W { pub fn mdwc(&mut self) -> MDWC_W { MDWC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Global Test Functions Register\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 [globtf](index.html) module"] +pub struct GLOBTF_SPEC; +impl crate::RegisterSpec for GLOBTF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [globtf::R](R) reader structure"] +impl crate::Readable for GLOBTF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [globtf::W](W) writer structure"] +impl crate::Writable for GLOBTF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GLOBTF to value 0"] +impl crate::Resettable for GLOBTF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc/id.rs b/src/vadc/id.rs index f22f9749..59b1ec09 100644 --- a/src/vadc/id.rs +++ b/src/vadc/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "Module Identification Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00c5_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00c5_c000 + } +} diff --git a/src/vadc/ocs.rs b/src/vadc/ocs.rs index f82d8f46..4c6c90f2 100644 --- a/src/vadc/ocs.rs +++ b/src/vadc/ocs.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register OCS"] -pub type R = crate::R; -#[doc = "Writer for register OCS"] -pub type W = crate::W; -#[doc = "Register OCS `reset()`'s with value 0"] -impl crate::ResetValue for super::OCS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `OCS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OCS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Trigger Set for OTGB0/1\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `TGS`"] -pub type TGS_R = crate::R; +#[doc = "Field `TGS` reader - Trigger Set for OTGB0/1"] +pub struct TGS_R(crate::FieldReader); impl TGS_R { + pub(crate) fn new(bits: u8) -> Self { + TGS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(TGS_A::VALUE1), - 1 => Val(TGS_A::VALUE2), - i => Res(i), + 0 => Some(TGS_A::VALUE1), + 1 => Some(TGS_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TGS_A::VALUE1 + **self == TGS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TGS_A::VALUE2 + **self == TGS_A::VALUE2 } } -#[doc = "Write proxy for field `TGS`"] +impl core::ops::Deref for TGS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TGS` writer - Trigger Set for OTGB0/1"] pub struct TGS_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> TGS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -90,9 +123,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TGB`"] -pub type TGB_R = crate::R; +#[doc = "Field `TGB` reader - OTGB0/1 Bus Select"] +pub struct TGB_R(crate::FieldReader); impl TGB_R { + pub(crate) fn new(bits: bool) -> Self { + TGB_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TGB_A { @@ -104,15 +140,22 @@ impl TGB_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TGB_A::VALUE1 + **self == TGB_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TGB_A::VALUE2 + **self == TGB_A::VALUE2 + } +} +impl core::ops::Deref for TGB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TGB`"] +#[doc = "Field `TGB` writer - OTGB0/1 Bus Select"] pub struct TGB_W<'a> { w: &'a mut W, } @@ -120,9 +163,7 @@ impl<'a> TGB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TGB_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Trigger Set is output on OTGB0"] #[inline(always)] @@ -147,11 +188,11 @@ impl<'a> TGB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } -#[doc = "Write proxy for field `TG_P`"] +#[doc = "Field `TG_P` writer - TGS, TGB Write Protection"] pub struct TG_P_W<'a> { w: &'a mut W, } @@ -169,7 +210,7 @@ impl<'a> TG_P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -192,43 +233,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SUS`"] -pub type SUS_R = crate::R; +#[doc = "Field `SUS` reader - OCDS Suspend Control"] +pub struct SUS_R(crate::FieldReader); impl SUS_R { + pub(crate) fn new(bits: u8) -> Self { + SUS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SUS_A::VALUE1), - 1 => Val(SUS_A::VALUE2), - 2 => Val(SUS_A::VALUE3), - 3 => Val(SUS_A::VALUE4), - i => Res(i), + 0 => Some(SUS_A::VALUE1), + 1 => Some(SUS_A::VALUE2), + 2 => Some(SUS_A::VALUE3), + 3 => Some(SUS_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUS_A::VALUE1 + **self == SUS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUS_A::VALUE2 + **self == SUS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SUS_A::VALUE3 + **self == SUS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SUS_A::VALUE4 + **self == SUS_A::VALUE4 + } +} +impl core::ops::Deref for SUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SUS`"] +#[doc = "Field `SUS` writer - OCDS Suspend Control"] pub struct SUS_W<'a> { w: &'a mut W, } @@ -261,11 +311,11 @@ impl<'a> SUS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } -#[doc = "Write proxy for field `SUS_P`"] +#[doc = "Field `SUS_P` writer - SUS Write Protection"] pub struct SUS_P_W<'a> { w: &'a mut W, } @@ -283,7 +333,7 @@ impl<'a> SUS_P_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -301,9 +351,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SUSSTA`"] -pub type SUSSTA_R = crate::R; +#[doc = "Field `SUSSTA` reader - Suspend State"] +pub struct SUSSTA_R(crate::FieldReader); impl SUSSTA_R { + pub(crate) fn new(bits: bool) -> Self { + SUSSTA_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SUSSTA_A { @@ -315,12 +368,19 @@ impl SUSSTA_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SUSSTA_A::VALUE1 + **self == SUSSTA_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SUSSTA_A::VALUE2 + **self == SUSSTA_A::VALUE2 + } +} +impl core::ops::Deref for SUSSTA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -371,4 +431,30 @@ impl W { pub fn sus_p(&mut self) -> SUS_P_W { SUS_P_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "OCDS Control and Status Register\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 [ocs](index.html) module"] +pub struct OCS_SPEC; +impl crate::RegisterSpec for OCS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ocs::R](R) reader structure"] +impl crate::Readable for OCS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ocs::W](W) writer structure"] +impl crate::Writable for OCS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OCS to value 0"] +impl crate::Resettable for OCS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0.rs b/src/vadc_g0.rs index 11347956..01505e62 100644 --- a/src/vadc_g0.rs +++ b/src/vadc_g0.rs @@ -1,517 +1,261 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - _reserved0: [u8; 128usize], + _reserved0: [u8; 0x80], #[doc = "0x80 - Arbitration Configuration Register"] - pub arbcfg: ARBCFG, + pub arbcfg: crate::Reg, #[doc = "0x84 - Arbitration Priority Register"] - pub arbpr: ARBPR, + pub arbpr: crate::Reg, #[doc = "0x88 - Channel Assignment Register"] - pub chass: CHASS, - _reserved3: [u8; 20usize], - #[doc = "0xa0 - Input Class Register"] - pub iclass: [ICLASS; 2], - _reserved4: [u8; 8usize], + pub chass: crate::Reg, + _reserved3: [u8; 0x14], + #[doc = "0xa0..0xa8 - Input Class Register"] + pub iclass: [crate::Reg; 2], + _reserved4: [u8; 0x08], #[doc = "0xb0 - Alias Register"] - pub alias: ALIAS, - _reserved5: [u8; 4usize], + pub alias: crate::Reg, + _reserved5: [u8; 0x04], #[doc = "0xb8 - Boundary Select Register"] - pub bound: BOUND, - _reserved6: [u8; 4usize], + pub bound: crate::Reg, + _reserved6: [u8; 0x04], #[doc = "0xc0 - Synchronization Control Register"] - pub synctr: SYNCTR, - _reserved7: [u8; 4usize], + pub synctr: crate::Reg, + _reserved7: [u8; 0x04], #[doc = "0xc8 - Boundary Flag Register"] - pub bfl: BFL, + pub bfl: crate::Reg, #[doc = "0xcc - Boundary Flag Software Register"] - pub bfls: BFLS, + pub bfls: crate::Reg, #[doc = "0xd0 - Boundary Flag Control Register"] - pub bflc: BFLC, + pub bflc: crate::Reg, #[doc = "0xd4 - Boundary Flag Node Pointer Register"] - pub bflnp: BFLNP, - _reserved11: [u8; 40usize], + pub bflnp: crate::Reg, + _reserved11: [u8; 0x28], #[doc = "0x100 - Queue 0 Source Control Register"] - pub qctrl0: QCTRL0, + pub qctrl0: crate::Reg, #[doc = "0x104 - Queue 0 Mode Register"] - pub qmr0: QMR0, + pub qmr0: crate::Reg, #[doc = "0x108 - Queue 0 Status Register"] - pub qsr0: QSR0, + pub qsr0: crate::Reg, #[doc = "0x10c - Queue 0 Register 0"] - pub q0r0: Q0R0, - _reserved_15_qbur0: [u8; 4usize], - _reserved16: [u8; 12usize], + pub q0r0: crate::Reg, + _reserved_15_qbur0: [u8; 0x04], + _reserved16: [u8; 0x0c], #[doc = "0x120 - Autoscan Source Control Register"] - pub asctrl: ASCTRL, + pub asctrl: crate::Reg, #[doc = "0x124 - Autoscan Source Mode Register"] - pub asmr: ASMR, + pub asmr: crate::Reg, #[doc = "0x128 - Autoscan Source Channel Select Register"] - pub assel: ASSEL, + pub assel: crate::Reg, #[doc = "0x12c - Autoscan Source Pending Register"] - pub aspnd: ASPND, - _reserved20: [u8; 80usize], + pub aspnd: crate::Reg, + _reserved20: [u8; 0x50], #[doc = "0x180 - Channel Event Flag Register"] - pub ceflag: CEFLAG, + pub ceflag: crate::Reg, #[doc = "0x184 - Result Event Flag Register"] - pub reflag: REFLAG, + pub reflag: crate::Reg, #[doc = "0x188 - Source Event Flag Register"] - pub seflag: SEFLAG, - _reserved23: [u8; 4usize], + pub seflag: crate::Reg, + _reserved23: [u8; 0x04], #[doc = "0x190 - Channel Event Flag Clear Register"] - pub cefclr: CEFCLR, + pub cefclr: crate::Reg, #[doc = "0x194 - Result Event Flag Clear Register"] - pub refclr: REFCLR, + pub refclr: crate::Reg, #[doc = "0x198 - Source Event Flag Clear Register"] - pub sefclr: SEFCLR, - _reserved26: [u8; 4usize], + pub sefclr: crate::Reg, + _reserved26: [u8; 0x04], #[doc = "0x1a0 - Channel Event Node Pointer Register 0"] - pub cevnp0: CEVNP0, - _reserved27: [u8; 12usize], + pub cevnp0: crate::Reg, + _reserved27: [u8; 0x0c], #[doc = "0x1b0 - Result Event Node Pointer Register 0"] - pub revnp0: REVNP0, + pub revnp0: crate::Reg, #[doc = "0x1b4 - Result Event Node Pointer Register 1"] - pub revnp1: REVNP1, - _reserved29: [u8; 8usize], + pub revnp1: crate::Reg, + _reserved29: [u8; 0x08], #[doc = "0x1c0 - Source Event Node Pointer Register"] - pub sevnp: SEVNP, - _reserved30: [u8; 4usize], + pub sevnp: crate::Reg, + _reserved30: [u8; 0x04], #[doc = "0x1c8 - Service Request Software Activation Trigger"] - pub sract: SRACT, - _reserved31: [u8; 36usize], + pub sract: crate::Reg, + _reserved31: [u8; 0x24], #[doc = "0x1f0 - External Multiplexer Control Register"] - pub emuxctr: EMUXCTR, - _reserved32: [u8; 4usize], + pub emuxctr: crate::Reg, + _reserved32: [u8; 0x04], #[doc = "0x1f8 - Valid Flag Register"] - pub vfr: VFR, - _reserved33: [u8; 4usize], - #[doc = "0x200 - Channel Ctrl. Reg."] - pub chctr: [CHCTR; 8], - _reserved34: [u8; 96usize], - #[doc = "0x280 - Result Control Register"] - pub rcr: [RCR; 16], - _reserved35: [u8; 64usize], - #[doc = "0x300 - Result Register"] - pub res: [RES; 16], - _reserved36: [u8; 64usize], - #[doc = "0x380 - Result Register, Debug"] - pub resd: [RESD; 16], + pub vfr: crate::Reg, + _reserved33: [u8; 0x04], + #[doc = "0x200..0x220 - Channel Ctrl. Reg."] + pub chctr: [crate::Reg; 8], + _reserved34: [u8; 0x60], + #[doc = "0x280..0x2c0 - Result Control Register"] + pub rcr: [crate::Reg; 16], + _reserved35: [u8; 0x40], + #[doc = "0x300..0x340 - Result Register"] + pub res: [crate::Reg; 16], + _reserved36: [u8; 0x40], + #[doc = "0x380..0x3c0 - Result Register, Debug"] + pub resd: [crate::Reg; 16], } impl RegisterBlock { #[doc = "0x110 - Queue 0 Backup Register"] #[inline(always)] - pub fn qbur0(&self) -> &QBUR0 { - unsafe { &*(((self as *const Self) as *const u8).add(272usize) as *const QBUR0) } - } - #[doc = "0x110 - Queue 0 Backup Register"] - #[inline(always)] - pub fn qbur0_mut(&self) -> &mut QBUR0 { - unsafe { &mut *(((self as *const Self) as *mut u8).add(272usize) as *mut QBUR0) } - } - #[doc = "0x110 - Queue 0 Input Register"] - #[inline(always)] - pub fn qinr0(&self) -> &QINR0 { - unsafe { &*(((self as *const Self) as *const u8).add(272usize) as *const QINR0) } + pub fn qbur0(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(272usize) as *const crate::Reg) } } #[doc = "0x110 - Queue 0 Input Register"] #[inline(always)] - pub fn qinr0_mut(&self) -> &mut QINR0 { - unsafe { &mut *(((self as *const Self) as *mut u8).add(272usize) as *mut QINR0) } + pub fn qinr0(&self) -> &crate::Reg { + unsafe { &*(((self as *const Self) as *const u8).add(272usize) as *const crate::Reg) } } } -#[doc = "Arbitration Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [arbcfg](arbcfg) module"] -pub type ARBCFG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ARBCFG; -#[doc = "`read()` method returns [arbcfg::R](arbcfg::R) reader structure"] -impl crate::Readable for ARBCFG {} -#[doc = "`write(|w| ..)` method takes [arbcfg::W](arbcfg::W) writer structure"] -impl crate::Writable for ARBCFG {} +#[doc = "ARBCFG register accessor: an alias for `Reg`"] +pub type ARBCFG = crate::Reg; #[doc = "Arbitration Configuration Register"] pub mod arbcfg; -#[doc = "Arbitration Priority Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [arbpr](arbpr) module"] -pub type ARBPR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ARBPR; -#[doc = "`read()` method returns [arbpr::R](arbpr::R) reader structure"] -impl crate::Readable for ARBPR {} -#[doc = "`write(|w| ..)` method takes [arbpr::W](arbpr::W) writer structure"] -impl crate::Writable for ARBPR {} +#[doc = "ARBPR register accessor: an alias for `Reg`"] +pub type ARBPR = crate::Reg; #[doc = "Arbitration Priority Register"] pub mod arbpr; -#[doc = "Channel Assignment Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chass](chass) module"] -pub type CHASS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CHASS; -#[doc = "`read()` method returns [chass::R](chass::R) reader structure"] -impl crate::Readable for CHASS {} -#[doc = "`write(|w| ..)` method takes [chass::W](chass::W) writer structure"] -impl crate::Writable for CHASS {} +#[doc = "CHASS register accessor: an alias for `Reg`"] +pub type CHASS = crate::Reg; #[doc = "Channel Assignment Register"] pub mod chass; -#[doc = "Input Class Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [iclass](iclass) module"] -pub type ICLASS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ICLASS; -#[doc = "`read()` method returns [iclass::R](iclass::R) reader structure"] -impl crate::Readable for ICLASS {} -#[doc = "`write(|w| ..)` method takes [iclass::W](iclass::W) writer structure"] -impl crate::Writable for ICLASS {} +#[doc = "ICLASS register accessor: an alias for `Reg`"] +pub type ICLASS = crate::Reg; #[doc = "Input Class Register"] pub mod iclass; -#[doc = "Alias Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [alias](alias) module"] -pub type ALIAS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ALIAS; -#[doc = "`read()` method returns [alias::R](alias::R) reader structure"] -impl crate::Readable for ALIAS {} -#[doc = "`write(|w| ..)` method takes [alias::W](alias::W) writer structure"] -impl crate::Writable for ALIAS {} +#[doc = "ALIAS register accessor: an alias for `Reg`"] +pub type ALIAS = crate::Reg; #[doc = "Alias Register"] pub mod alias; -#[doc = "Boundary Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bound](bound) module"] -pub type BOUND = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BOUND; -#[doc = "`read()` method returns [bound::R](bound::R) reader structure"] -impl crate::Readable for BOUND {} -#[doc = "`write(|w| ..)` method takes [bound::W](bound::W) writer structure"] -impl crate::Writable for BOUND {} +#[doc = "BOUND register accessor: an alias for `Reg`"] +pub type BOUND = crate::Reg; #[doc = "Boundary Select Register"] pub mod bound; -#[doc = "Synchronization Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [synctr](synctr) module"] -pub type SYNCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SYNCTR; -#[doc = "`read()` method returns [synctr::R](synctr::R) reader structure"] -impl crate::Readable for SYNCTR {} -#[doc = "`write(|w| ..)` method takes [synctr::W](synctr::W) writer structure"] -impl crate::Writable for SYNCTR {} +#[doc = "SYNCTR register accessor: an alias for `Reg`"] +pub type SYNCTR = crate::Reg; #[doc = "Synchronization Control Register"] pub mod synctr; -#[doc = "Boundary Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bfl](bfl) module"] -pub type BFL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BFL; -#[doc = "`read()` method returns [bfl::R](bfl::R) reader structure"] -impl crate::Readable for BFL {} -#[doc = "`write(|w| ..)` method takes [bfl::W](bfl::W) writer structure"] -impl crate::Writable for BFL {} +#[doc = "BFL register accessor: an alias for `Reg`"] +pub type BFL = crate::Reg; #[doc = "Boundary Flag Register"] pub mod bfl; -#[doc = "Boundary Flag Software Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bfls](bfls) module"] -pub type BFLS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BFLS; -#[doc = "`write(|w| ..)` method takes [bfls::W](bfls::W) writer structure"] -impl crate::Writable for BFLS {} +#[doc = "BFLS register accessor: an alias for `Reg`"] +pub type BFLS = crate::Reg; #[doc = "Boundary Flag Software Register"] pub mod bfls; -#[doc = "Boundary Flag Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bflc](bflc) module"] -pub type BFLC = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BFLC; -#[doc = "`read()` method returns [bflc::R](bflc::R) reader structure"] -impl crate::Readable for BFLC {} -#[doc = "`write(|w| ..)` method takes [bflc::W](bflc::W) writer structure"] -impl crate::Writable for BFLC {} +#[doc = "BFLC register accessor: an alias for `Reg`"] +pub type BFLC = crate::Reg; #[doc = "Boundary Flag Control Register"] pub mod bflc; -#[doc = "Boundary Flag Node Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bflnp](bflnp) module"] -pub type BFLNP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _BFLNP; -#[doc = "`read()` method returns [bflnp::R](bflnp::R) reader structure"] -impl crate::Readable for BFLNP {} -#[doc = "`write(|w| ..)` method takes [bflnp::W](bflnp::W) writer structure"] -impl crate::Writable for BFLNP {} +#[doc = "BFLNP register accessor: an alias for `Reg`"] +pub type BFLNP = crate::Reg; #[doc = "Boundary Flag Node Pointer Register"] pub mod bflnp; -#[doc = "Queue 0 Source Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qctrl0](qctrl0) module"] -pub type QCTRL0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QCTRL0; -#[doc = "`read()` method returns [qctrl0::R](qctrl0::R) reader structure"] -impl crate::Readable for QCTRL0 {} -#[doc = "`write(|w| ..)` method takes [qctrl0::W](qctrl0::W) writer structure"] -impl crate::Writable for QCTRL0 {} +#[doc = "QCTRL0 register accessor: an alias for `Reg`"] +pub type QCTRL0 = crate::Reg; #[doc = "Queue 0 Source Control Register"] pub mod qctrl0; -#[doc = "Queue 0 Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qmr0](qmr0) module"] -pub type QMR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QMR0; -#[doc = "`read()` method returns [qmr0::R](qmr0::R) reader structure"] -impl crate::Readable for QMR0 {} -#[doc = "`write(|w| ..)` method takes [qmr0::W](qmr0::W) writer structure"] -impl crate::Writable for QMR0 {} +#[doc = "QMR0 register accessor: an alias for `Reg`"] +pub type QMR0 = crate::Reg; #[doc = "Queue 0 Mode Register"] pub mod qmr0; -#[doc = "Queue 0 Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qsr0](qsr0) module"] -pub type QSR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QSR0; -#[doc = "`read()` method returns [qsr0::R](qsr0::R) reader structure"] -impl crate::Readable for QSR0 {} +#[doc = "QSR0 register accessor: an alias for `Reg`"] +pub type QSR0 = crate::Reg; #[doc = "Queue 0 Status Register"] pub mod qsr0; -#[doc = "Queue 0 Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [q0r0](q0r0) module"] -pub type Q0R0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _Q0R0; -#[doc = "`read()` method returns [q0r0::R](q0r0::R) reader structure"] -impl crate::Readable for Q0R0 {} +#[doc = "Q0R0 register accessor: an alias for `Reg`"] +pub type Q0R0 = crate::Reg; #[doc = "Queue 0 Register 0"] pub mod q0r0; -#[doc = "Queue 0 Input Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qinr0](qinr0) module"] -pub type QINR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QINR0; -#[doc = "`write(|w| ..)` method takes [qinr0::W](qinr0::W) writer structure"] -impl crate::Writable for QINR0 {} +#[doc = "QINR0 register accessor: an alias for `Reg`"] +pub type QINR0 = crate::Reg; #[doc = "Queue 0 Input Register"] pub mod qinr0; -#[doc = "Queue 0 Backup Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qbur0](qbur0) module"] -pub type QBUR0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _QBUR0; -#[doc = "`read()` method returns [qbur0::R](qbur0::R) reader structure"] -impl crate::Readable for QBUR0 {} +#[doc = "QBUR0 register accessor: an alias for `Reg`"] +pub type QBUR0 = crate::Reg; #[doc = "Queue 0 Backup Register"] pub mod qbur0; -#[doc = "Autoscan Source Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [asctrl](asctrl) module"] -pub type ASCTRL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ASCTRL; -#[doc = "`read()` method returns [asctrl::R](asctrl::R) reader structure"] -impl crate::Readable for ASCTRL {} -#[doc = "`write(|w| ..)` method takes [asctrl::W](asctrl::W) writer structure"] -impl crate::Writable for ASCTRL {} +#[doc = "ASCTRL register accessor: an alias for `Reg`"] +pub type ASCTRL = crate::Reg; #[doc = "Autoscan Source Control Register"] pub mod asctrl; -#[doc = "Autoscan Source Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [asmr](asmr) module"] -pub type ASMR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ASMR; -#[doc = "`read()` method returns [asmr::R](asmr::R) reader structure"] -impl crate::Readable for ASMR {} -#[doc = "`write(|w| ..)` method takes [asmr::W](asmr::W) writer structure"] -impl crate::Writable for ASMR {} +#[doc = "ASMR register accessor: an alias for `Reg`"] +pub type ASMR = crate::Reg; #[doc = "Autoscan Source Mode Register"] pub mod asmr; -#[doc = "Autoscan Source Channel Select Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [assel](assel) module"] -pub type ASSEL = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ASSEL; -#[doc = "`read()` method returns [assel::R](assel::R) reader structure"] -impl crate::Readable for ASSEL {} -#[doc = "`write(|w| ..)` method takes [assel::W](assel::W) writer structure"] -impl crate::Writable for ASSEL {} +#[doc = "ASSEL register accessor: an alias for `Reg`"] +pub type ASSEL = crate::Reg; #[doc = "Autoscan Source Channel Select Register"] pub mod assel; -#[doc = "Autoscan Source Pending Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [aspnd](aspnd) module"] -pub type ASPND = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ASPND; -#[doc = "`read()` method returns [aspnd::R](aspnd::R) reader structure"] -impl crate::Readable for ASPND {} -#[doc = "`write(|w| ..)` method takes [aspnd::W](aspnd::W) writer structure"] -impl crate::Writable for ASPND {} +#[doc = "ASPND register accessor: an alias for `Reg`"] +pub type ASPND = crate::Reg; #[doc = "Autoscan Source Pending Register"] pub mod aspnd; -#[doc = "Channel Event Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ceflag](ceflag) module"] -pub type CEFLAG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CEFLAG; -#[doc = "`read()` method returns [ceflag::R](ceflag::R) reader structure"] -impl crate::Readable for CEFLAG {} -#[doc = "`write(|w| ..)` method takes [ceflag::W](ceflag::W) writer structure"] -impl crate::Writable for CEFLAG {} +#[doc = "CEFLAG register accessor: an alias for `Reg`"] +pub type CEFLAG = crate::Reg; #[doc = "Channel Event Flag Register"] pub mod ceflag; -#[doc = "Result Event Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [reflag](reflag) module"] -pub type REFLAG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REFLAG; -#[doc = "`read()` method returns [reflag::R](reflag::R) reader structure"] -impl crate::Readable for REFLAG {} -#[doc = "`write(|w| ..)` method takes [reflag::W](reflag::W) writer structure"] -impl crate::Writable for REFLAG {} +#[doc = "REFLAG register accessor: an alias for `Reg`"] +pub type REFLAG = crate::Reg; #[doc = "Result Event Flag Register"] pub mod reflag; -#[doc = "Source Event Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [seflag](seflag) module"] -pub type SEFLAG = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SEFLAG; -#[doc = "`read()` method returns [seflag::R](seflag::R) reader structure"] -impl crate::Readable for SEFLAG {} -#[doc = "`write(|w| ..)` method takes [seflag::W](seflag::W) writer structure"] -impl crate::Writable for SEFLAG {} +#[doc = "SEFLAG register accessor: an alias for `Reg`"] +pub type SEFLAG = crate::Reg; #[doc = "Source Event Flag Register"] pub mod seflag; -#[doc = "Channel Event Flag Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cefclr](cefclr) module"] -pub type CEFCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CEFCLR; -#[doc = "`write(|w| ..)` method takes [cefclr::W](cefclr::W) writer structure"] -impl crate::Writable for CEFCLR {} +#[doc = "CEFCLR register accessor: an alias for `Reg`"] +pub type CEFCLR = crate::Reg; #[doc = "Channel Event Flag Clear Register"] pub mod cefclr; -#[doc = "Result Event Flag Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refclr](refclr) module"] -pub type REFCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REFCLR; -#[doc = "`write(|w| ..)` method takes [refclr::W](refclr::W) writer structure"] -impl crate::Writable for REFCLR {} +#[doc = "REFCLR register accessor: an alias for `Reg`"] +pub type REFCLR = crate::Reg; #[doc = "Result Event Flag Clear Register"] pub mod refclr; -#[doc = "Source Event Flag Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sefclr](sefclr) module"] -pub type SEFCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SEFCLR; -#[doc = "`write(|w| ..)` method takes [sefclr::W](sefclr::W) writer structure"] -impl crate::Writable for SEFCLR {} +#[doc = "SEFCLR register accessor: an alias for `Reg`"] +pub type SEFCLR = crate::Reg; #[doc = "Source Event Flag Clear Register"] pub mod sefclr; -#[doc = "Channel Event Node Pointer Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cevnp0](cevnp0) module"] -pub type CEVNP0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CEVNP0; -#[doc = "`read()` method returns [cevnp0::R](cevnp0::R) reader structure"] -impl crate::Readable for CEVNP0 {} -#[doc = "`write(|w| ..)` method takes [cevnp0::W](cevnp0::W) writer structure"] -impl crate::Writable for CEVNP0 {} +#[doc = "CEVNP0 register accessor: an alias for `Reg`"] +pub type CEVNP0 = crate::Reg; #[doc = "Channel Event Node Pointer Register 0"] pub mod cevnp0; -#[doc = "Result Event Node Pointer Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [revnp0](revnp0) module"] -pub type REVNP0 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REVNP0; -#[doc = "`read()` method returns [revnp0::R](revnp0::R) reader structure"] -impl crate::Readable for REVNP0 {} -#[doc = "`write(|w| ..)` method takes [revnp0::W](revnp0::W) writer structure"] -impl crate::Writable for REVNP0 {} +#[doc = "REVNP0 register accessor: an alias for `Reg`"] +pub type REVNP0 = crate::Reg; #[doc = "Result Event Node Pointer Register 0"] pub mod revnp0; -#[doc = "Result Event Node Pointer Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [revnp1](revnp1) module"] -pub type REVNP1 = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _REVNP1; -#[doc = "`read()` method returns [revnp1::R](revnp1::R) reader structure"] -impl crate::Readable for REVNP1 {} -#[doc = "`write(|w| ..)` method takes [revnp1::W](revnp1::W) writer structure"] -impl crate::Writable for REVNP1 {} +#[doc = "REVNP1 register accessor: an alias for `Reg`"] +pub type REVNP1 = crate::Reg; #[doc = "Result Event Node Pointer Register 1"] pub mod revnp1; -#[doc = "Source Event Node Pointer Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sevnp](sevnp) module"] -pub type SEVNP = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SEVNP; -#[doc = "`read()` method returns [sevnp::R](sevnp::R) reader structure"] -impl crate::Readable for SEVNP {} -#[doc = "`write(|w| ..)` method takes [sevnp::W](sevnp::W) writer structure"] -impl crate::Writable for SEVNP {} +#[doc = "SEVNP register accessor: an alias for `Reg`"] +pub type SEVNP = crate::Reg; #[doc = "Source Event Node Pointer Register"] pub mod sevnp; -#[doc = "Service Request Software Activation Trigger\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sract](sract) module"] -pub type SRACT = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRACT; -#[doc = "`write(|w| ..)` method takes [sract::W](sract::W) writer structure"] -impl crate::Writable for SRACT {} +#[doc = "SRACT register accessor: an alias for `Reg`"] +pub type SRACT = crate::Reg; #[doc = "Service Request Software Activation Trigger"] pub mod sract; -#[doc = "External Multiplexer Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [emuxctr](emuxctr) module"] -pub type EMUXCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _EMUXCTR; -#[doc = "`read()` method returns [emuxctr::R](emuxctr::R) reader structure"] -impl crate::Readable for EMUXCTR {} -#[doc = "`write(|w| ..)` method takes [emuxctr::W](emuxctr::W) writer structure"] -impl crate::Writable for EMUXCTR {} +#[doc = "EMUXCTR register accessor: an alias for `Reg`"] +pub type EMUXCTR = crate::Reg; #[doc = "External Multiplexer Control Register"] pub mod emuxctr; -#[doc = "Valid Flag Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [vfr](vfr) module"] -pub type VFR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _VFR; -#[doc = "`read()` method returns [vfr::R](vfr::R) reader structure"] -impl crate::Readable for VFR {} -#[doc = "`write(|w| ..)` method takes [vfr::W](vfr::W) writer structure"] -impl crate::Writable for VFR {} +#[doc = "VFR register accessor: an alias for `Reg`"] +pub type VFR = crate::Reg; #[doc = "Valid Flag Register"] pub mod vfr; -#[doc = "Channel Ctrl. Reg.\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chctr](chctr) module"] -pub type CHCTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CHCTR; -#[doc = "`read()` method returns [chctr::R](chctr::R) reader structure"] -impl crate::Readable for CHCTR {} -#[doc = "`write(|w| ..)` method takes [chctr::W](chctr::W) writer structure"] -impl crate::Writable for CHCTR {} +#[doc = "CHCTR register accessor: an alias for `Reg`"] +pub type CHCTR = crate::Reg; #[doc = "Channel Ctrl. Reg."] pub mod chctr; -#[doc = "Result Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rcr](rcr) module"] -pub type RCR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RCR; -#[doc = "`read()` method returns [rcr::R](rcr::R) reader structure"] -impl crate::Readable for RCR {} -#[doc = "`write(|w| ..)` method takes [rcr::W](rcr::W) writer structure"] -impl crate::Writable for RCR {} +#[doc = "RCR register accessor: an alias for `Reg`"] +pub type RCR = crate::Reg; #[doc = "Result Control Register"] pub mod rcr; -#[doc = "Result Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [res](res) module"] -pub type RES = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RES; -#[doc = "`read()` method returns [res::R](res::R) reader structure"] -impl crate::Readable for RES {} -#[doc = "`write(|w| ..)` method takes [res::W](res::W) writer structure"] -impl crate::Writable for RES {} +#[doc = "RES register accessor: an alias for `Reg`"] +pub type RES = crate::Reg; #[doc = "Result Register"] pub mod res; -#[doc = "Result Register, Debug\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resd](resd) module"] -pub type RESD = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _RESD; -#[doc = "`read()` method returns [resd::R](resd::R) reader structure"] -impl crate::Readable for RESD {} +#[doc = "RESD register accessor: an alias for `Reg`"] +pub type RESD = crate::Reg; #[doc = "Result Register, Debug"] pub mod resd; diff --git a/src/vadc_g0/alias.rs b/src/vadc_g0/alias.rs index 989b5152..4790ca42 100644 --- a/src/vadc_g0/alias.rs +++ b/src/vadc_g0/alias.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register ALIAS"] -pub type R = crate::R; -#[doc = "Writer for register ALIAS"] -pub type W = crate::W; -#[doc = "Register ALIAS `reset()`'s with value 0x0100"] -impl crate::ResetValue for super::ALIAS { - type Type = u32; +#[doc = "Register `ALIAS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0x0100 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ALIAS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ALIAS0` reader - Alias Value for CH0 Conversion Requests"] +pub struct ALIAS0_R(crate::FieldReader); +impl ALIAS0_R { + pub(crate) fn new(bits: u8) -> Self { + ALIAS0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ALIAS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `ALIAS0`"] -pub type ALIAS0_R = crate::R; -#[doc = "Write proxy for field `ALIAS0`"] +#[doc = "Field `ALIAS0` writer - Alias Value for CH0 Conversion Requests"] pub struct ALIAS0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> ALIAS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } -#[doc = "Reader of field `ALIAS1`"] -pub type ALIAS1_R = crate::R; -#[doc = "Write proxy for field `ALIAS1`"] +#[doc = "Field `ALIAS1` reader - Alias Value for CH1 Conversion Requests"] +pub struct ALIAS1_R(crate::FieldReader); +impl ALIAS1_R { + pub(crate) fn new(bits: u8) -> Self { + ALIAS1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ALIAS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALIAS1` writer - Alias Value for CH1 Conversion Requests"] pub struct ALIAS1_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> ALIAS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 8)) | (((value as u32) & 0x1f) << 8); + self.w.bits = (self.w.bits & !(0x1f << 8)) | ((value as u32 & 0x1f) << 8); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn alias1(&mut self) -> ALIAS1_W { ALIAS1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Alias Register\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 [alias](index.html) module"] +pub struct ALIAS_SPEC; +impl crate::RegisterSpec for ALIAS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [alias::R](R) reader structure"] +impl crate::Readable for ALIAS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [alias::W](W) writer structure"] +impl crate::Writable for ALIAS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ALIAS to value 0x0100"] +impl crate::Resettable for ALIAS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0100 + } } diff --git a/src/vadc_g0/arbcfg.rs b/src/vadc_g0/arbcfg.rs index b3b61bfb..f50d496c 100644 --- a/src/vadc_g0/arbcfg.rs +++ b/src/vadc_g0/arbcfg.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register ARBCFG"] -pub type R = crate::R; -#[doc = "Writer for register ARBCFG"] -pub type W = crate::W; -#[doc = "Register ARBCFG `reset()`'s with value 0"] -impl crate::ResetValue for super::ARBCFG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ARBCFG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ARBCFG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `ANONC`"] -pub type ANONC_R = crate::R; -#[doc = "Write proxy for field `ANONC`"] +#[doc = "Field `ANONC` reader - Analog Converter Control"] +pub struct ANONC_R(crate::FieldReader); +impl ANONC_R { + pub(crate) fn new(bits: u8) -> Self { + ANONC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ANONC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANONC` writer - Analog Converter Control"] pub struct ANONC_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> ANONC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -43,9 +79,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ARBRND`"] -pub type ARBRND_R = crate::R; +#[doc = "Field `ARBRND` reader - Arbitration Round Length"] +pub struct ARBRND_R(crate::FieldReader); impl ARBRND_R { + pub(crate) fn new(bits: u8) -> Self { + ARBRND_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARBRND_A { @@ -60,25 +99,32 @@ impl ARBRND_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARBRND_A::VALUE1 + **self == ARBRND_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARBRND_A::VALUE2 + **self == ARBRND_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ARBRND_A::VALUE3 + **self == ARBRND_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ARBRND_A::VALUE4 + **self == ARBRND_A::VALUE4 } } -#[doc = "Write proxy for field `ARBRND`"] +impl core::ops::Deref for ARBRND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ARBRND` writer - Arbitration Round Length"] pub struct ARBRND_W<'a> { w: &'a mut W, } @@ -86,9 +132,7 @@ impl<'a> ARBRND_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARBRND_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "4 arbitration slots per round (tARB = 4 / fADCD)"] #[inline(always)] @@ -113,7 +157,7 @@ impl<'a> ARBRND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -131,9 +175,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ARBM`"] -pub type ARBM_R = crate::R; +#[doc = "Field `ARBM` reader - Arbitration Mode"] +pub struct ARBM_R(crate::FieldReader); impl ARBM_R { + pub(crate) fn new(bits: bool) -> Self { + ARBM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ARBM_A { @@ -145,15 +192,22 @@ impl ARBM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ARBM_A::VALUE1 + **self == ARBM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ARBM_A::VALUE2 + **self == ARBM_A::VALUE2 + } +} +impl core::ops::Deref for ARBM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ARBM`"] +#[doc = "Field `ARBM` writer - Arbitration Mode"] pub struct ARBM_W<'a> { w: &'a mut W, } @@ -161,9 +215,7 @@ impl<'a> ARBM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ARBM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The arbiter runs permanently. This setting is required for a synchronization slave (see ) and for equidistant sampling using the signal ARBCNT (see )."] #[inline(always)] @@ -188,7 +240,7 @@ impl<'a> ARBM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -207,28 +259,37 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ANONS`"] -pub type ANONS_R = crate::R; +#[doc = "Field `ANONS` reader - Analog Converter Control Status"] +pub struct ANONS_R(crate::FieldReader); impl ANONS_R { + pub(crate) fn new(bits: u8) -> Self { + ANONS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(ANONS_A::VALUE1), - 3 => Val(ANONS_A::VALUE4), - i => Res(i), + 0 => Some(ANONS_A::VALUE1), + 3 => Some(ANONS_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ANONS_A::VALUE1 + **self == ANONS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ANONS_A::VALUE4 + **self == ANONS_A::VALUE4 + } +} +impl core::ops::Deref for ANONS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Start-Up Calibration Active Indication\n\nValue on reset: 0"] @@ -245,9 +306,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CAL`"] -pub type CAL_R = crate::R; +#[doc = "Field `CAL` reader - Start-Up Calibration Active Indication"] +pub struct CAL_R(crate::FieldReader); impl CAL_R { + pub(crate) fn new(bits: bool) -> Self { + CAL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CAL_A { @@ -259,12 +323,19 @@ impl CAL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CAL_A::VALUE1 + **self == CAL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CAL_A::VALUE2 + **self == CAL_A::VALUE2 + } +} +impl core::ops::Deref for CAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Converter Busy Flag\n\nValue on reset: 0"] @@ -281,9 +352,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BUSY`"] -pub type BUSY_R = crate::R; +#[doc = "Field `BUSY` reader - Converter Busy Flag"] +pub struct BUSY_R(crate::FieldReader); impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BUSY_A { @@ -295,12 +369,19 @@ impl BUSY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BUSY_A::VALUE1 + **self == BUSY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BUSY_A::VALUE2 + **self == BUSY_A::VALUE2 + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Sample Phase Flag\n\nValue on reset: 0"] @@ -317,9 +398,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SAMPLE`"] -pub type SAMPLE_R = crate::R; +#[doc = "Field `SAMPLE` reader - Sample Phase Flag"] +pub struct SAMPLE_R(crate::FieldReader); impl SAMPLE_R { + pub(crate) fn new(bits: bool) -> Self { + SAMPLE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SAMPLE_A { @@ -331,12 +415,19 @@ impl SAMPLE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SAMPLE_A::VALUE1 + **self == SAMPLE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SAMPLE_A::VALUE2 + **self == SAMPLE_A::VALUE2 + } +} +impl core::ops::Deref for SAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -392,4 +483,30 @@ impl W { pub fn arbm(&mut self) -> ARBM_W { ARBM_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Arbitration Configuration Register\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 [arbcfg](index.html) module"] +pub struct ARBCFG_SPEC; +impl crate::RegisterSpec for ARBCFG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [arbcfg::R](R) reader structure"] +impl crate::Readable for ARBCFG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [arbcfg::W](W) writer structure"] +impl crate::Writable for ARBCFG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ARBCFG to value 0"] +impl crate::Resettable for ARBCFG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/arbpr.rs b/src/vadc_g0/arbpr.rs index 2b669351..005f4753 100644 --- a/src/vadc_g0/arbpr.rs +++ b/src/vadc_g0/arbpr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ARBPR"] -pub type R = crate::R; -#[doc = "Writer for register ARBPR"] -pub type W = crate::W; -#[doc = "Register ARBPR `reset()`'s with value 0"] -impl crate::ResetValue for super::ARBPR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ARBPR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ARBPR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Priority of Request Source x\n\nValue on reset: 0"] @@ -25,31 +49,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRIO0`"] -pub type PRIO0_R = crate::R; +#[doc = "Field `PRIO0` reader - Priority of Request Source x"] +pub struct PRIO0_R(crate::FieldReader); impl PRIO0_R { + pub(crate) fn new(bits: u8) -> Self { + PRIO0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PRIO0_A::VALUE1), - 3 => Val(PRIO0_A::VALUE2), - i => Res(i), + 0 => Some(PRIO0_A::VALUE1), + 3 => Some(PRIO0_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRIO0_A::VALUE1 + **self == PRIO0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRIO0_A::VALUE2 + **self == PRIO0_A::VALUE2 } } -#[doc = "Write proxy for field `PRIO0`"] +impl core::ops::Deref for PRIO0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRIO0` writer - Priority of Request Source x"] pub struct PRIO0_W<'a> { w: &'a mut W, } @@ -72,7 +105,7 @@ impl<'a> PRIO0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -91,31 +124,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRIO1`"] -pub type PRIO1_R = crate::R; +#[doc = "Field `PRIO1` reader - Priority of Request Source x"] +pub struct PRIO1_R(crate::FieldReader); impl PRIO1_R { + pub(crate) fn new(bits: u8) -> Self { + PRIO1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PRIO1_A::VALUE1), - 3 => Val(PRIO1_A::VALUE2), - i => Res(i), + 0 => Some(PRIO1_A::VALUE1), + 3 => Some(PRIO1_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRIO1_A::VALUE1 + **self == PRIO1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRIO1_A::VALUE2 + **self == PRIO1_A::VALUE2 + } +} +impl core::ops::Deref for PRIO1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PRIO1`"] +#[doc = "Field `PRIO1` writer - Priority of Request Source x"] pub struct PRIO1_W<'a> { w: &'a mut W, } @@ -138,7 +180,7 @@ impl<'a> PRIO1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -157,31 +199,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `PRIO2`"] -pub type PRIO2_R = crate::R; +#[doc = "Field `PRIO2` reader - Priority of Request Source x"] +pub struct PRIO2_R(crate::FieldReader); impl PRIO2_R { + pub(crate) fn new(bits: u8) -> Self { + PRIO2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(PRIO2_A::VALUE1), - 3 => Val(PRIO2_A::VALUE2), - i => Res(i), + 0 => Some(PRIO2_A::VALUE1), + 3 => Some(PRIO2_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == PRIO2_A::VALUE1 + **self == PRIO2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == PRIO2_A::VALUE2 + **self == PRIO2_A::VALUE2 + } +} +impl core::ops::Deref for PRIO2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `PRIO2`"] +#[doc = "Field `PRIO2` writer - Priority of Request Source x"] pub struct PRIO2_W<'a> { w: &'a mut W, } @@ -204,7 +255,7 @@ impl<'a> PRIO2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -222,9 +273,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CSM0`"] -pub type CSM0_R = crate::R; +#[doc = "Field `CSM0` reader - Conversion Start Mode of Request Source x"] +pub struct CSM0_R(crate::FieldReader); impl CSM0_R { + pub(crate) fn new(bits: bool) -> Self { + CSM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSM0_A { @@ -236,15 +290,22 @@ impl CSM0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSM0_A::VALUE1 + **self == CSM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSM0_A::VALUE2 + **self == CSM0_A::VALUE2 + } +} +impl core::ops::Deref for CSM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CSM0`"] +#[doc = "Field `CSM0` writer - Conversion Start Mode of Request Source x"] pub struct CSM0_W<'a> { w: &'a mut W, } @@ -252,9 +313,7 @@ impl<'a> CSM0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSM0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wait-for-start mode"] #[inline(always)] @@ -279,7 +338,7 @@ impl<'a> CSM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -297,9 +356,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CSM1`"] -pub type CSM1_R = crate::R; +#[doc = "Field `CSM1` reader - Conversion Start Mode of Request Source x"] +pub struct CSM1_R(crate::FieldReader); impl CSM1_R { + pub(crate) fn new(bits: bool) -> Self { + CSM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSM1_A { @@ -311,15 +373,22 @@ impl CSM1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSM1_A::VALUE1 + **self == CSM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSM1_A::VALUE2 + **self == CSM1_A::VALUE2 } } -#[doc = "Write proxy for field `CSM1`"] +impl core::ops::Deref for CSM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CSM1` writer - Conversion Start Mode of Request Source x"] pub struct CSM1_W<'a> { w: &'a mut W, } @@ -327,9 +396,7 @@ impl<'a> CSM1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSM1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wait-for-start mode"] #[inline(always)] @@ -354,7 +421,7 @@ impl<'a> CSM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -372,9 +439,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CSM2`"] -pub type CSM2_R = crate::R; +#[doc = "Field `CSM2` reader - Conversion Start Mode of Request Source x"] +pub struct CSM2_R(crate::FieldReader); impl CSM2_R { + pub(crate) fn new(bits: bool) -> Self { + CSM2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CSM2_A { @@ -386,15 +456,22 @@ impl CSM2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CSM2_A::VALUE1 + **self == CSM2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CSM2_A::VALUE2 + **self == CSM2_A::VALUE2 } } -#[doc = "Write proxy for field `CSM2`"] +impl core::ops::Deref for CSM2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CSM2` writer - Conversion Start Mode of Request Source x"] pub struct CSM2_W<'a> { w: &'a mut W, } @@ -402,9 +479,7 @@ impl<'a> CSM2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CSM2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Wait-for-start mode"] #[inline(always)] @@ -429,7 +504,7 @@ impl<'a> CSM2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -447,9 +522,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASEN0`"] -pub type ASEN0_R = crate::R; +#[doc = "Field `ASEN0` reader - Arbitration Slot 0 Enable"] +pub struct ASEN0_R(crate::FieldReader); impl ASEN0_R { + pub(crate) fn new(bits: bool) -> Self { + ASEN0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASEN0_A { @@ -461,15 +539,22 @@ impl ASEN0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASEN0_A::VALUE1 + **self == ASEN0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASEN0_A::VALUE2 + **self == ASEN0_A::VALUE2 + } +} +impl core::ops::Deref for ASEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASEN0`"] +#[doc = "Field `ASEN0` writer - Arbitration Slot 0 Enable"] pub struct ASEN0_W<'a> { w: &'a mut W, } @@ -477,9 +562,7 @@ impl<'a> ASEN0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASEN0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] @@ -504,7 +587,7 @@ impl<'a> ASEN0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -522,9 +605,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASEN1`"] -pub type ASEN1_R = crate::R; +#[doc = "Field `ASEN1` reader - Arbitration Slot 1 Enable"] +pub struct ASEN1_R(crate::FieldReader); impl ASEN1_R { + pub(crate) fn new(bits: bool) -> Self { + ASEN1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASEN1_A { @@ -536,15 +622,22 @@ impl ASEN1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASEN1_A::VALUE1 + **self == ASEN1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASEN1_A::VALUE2 + **self == ASEN1_A::VALUE2 + } +} +impl core::ops::Deref for ASEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASEN1`"] +#[doc = "Field `ASEN1` writer - Arbitration Slot 1 Enable"] pub struct ASEN1_W<'a> { w: &'a mut W, } @@ -552,9 +645,7 @@ impl<'a> ASEN1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASEN1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] @@ -579,7 +670,7 @@ impl<'a> ASEN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); self.w } } @@ -597,9 +688,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASEN2`"] -pub type ASEN2_R = crate::R; +#[doc = "Field `ASEN2` reader - Arbitration Slot 2 Enable"] +pub struct ASEN2_R(crate::FieldReader); impl ASEN2_R { + pub(crate) fn new(bits: bool) -> Self { + ASEN2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASEN2_A { @@ -611,15 +705,22 @@ impl ASEN2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASEN2_A::VALUE1 + **self == ASEN2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASEN2_A::VALUE2 + **self == ASEN2_A::VALUE2 + } +} +impl core::ops::Deref for ASEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASEN2`"] +#[doc = "Field `ASEN2` writer - Arbitration Slot 2 Enable"] pub struct ASEN2_W<'a> { w: &'a mut W, } @@ -627,9 +728,7 @@ impl<'a> ASEN2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASEN2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] @@ -654,7 +753,7 @@ impl<'a> ASEN2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26); + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); self.w } } @@ -751,4 +850,30 @@ impl W { pub fn asen2(&mut self) -> ASEN2_W { ASEN2_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Arbitration Priority Register\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 [arbpr](index.html) module"] +pub struct ARBPR_SPEC; +impl crate::RegisterSpec for ARBPR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [arbpr::R](R) reader structure"] +impl crate::Readable for ARBPR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [arbpr::W](W) writer structure"] +impl crate::Writable for ARBPR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ARBPR to value 0"] +impl crate::Resettable for ARBPR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/asctrl.rs b/src/vadc_g0/asctrl.rs index 0bd7bfd0..53e38735 100644 --- a/src/vadc_g0/asctrl.rs +++ b/src/vadc_g0/asctrl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ASCTRL"] -pub type R = crate::R; -#[doc = "Writer for register ASCTRL"] -pub type W = crate::W; -#[doc = "Register ASCTRL `reset()`'s with value 0"] -impl crate::ResetValue for super::ASCTRL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ASCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ASCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source-specific Result Register\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRCRESREG`"] -pub type SRCRESREG_R = crate::R; +#[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] +pub struct SRCRESREG_R(crate::FieldReader); impl SRCRESREG_R { + pub(crate) fn new(bits: u8) -> Self { + SRCRESREG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRCRESREG_A::VALUE1), - 1 => Val(SRCRESREG_A::VALUE2), - 15 => Val(SRCRESREG_A::VALUE3), - i => Res(i), + 0 => Some(SRCRESREG_A::VALUE1), + 1 => Some(SRCRESREG_A::VALUE2), + 15 => Some(SRCRESREG_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRCRESREG_A::VALUE1 + **self == SRCRESREG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRCRESREG_A::VALUE2 + **self == SRCRESREG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SRCRESREG_A::VALUE3 + **self == SRCRESREG_A::VALUE3 } } -#[doc = "Write proxy for field `SRCRESREG`"] +impl core::ops::Deref for SRCRESREG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] pub struct SRCRESREG_W<'a> { w: &'a mut W, } @@ -85,13 +118,25 @@ impl<'a> SRCRESREG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `XTSEL`"] -pub type XTSEL_R = crate::R; -#[doc = "Write proxy for field `XTSEL`"] +#[doc = "Field `XTSEL` reader - External Trigger Input Selection"] +pub struct XTSEL_R(crate::FieldReader); +impl XTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + XTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XTSEL` writer - External Trigger Input Selection"] pub struct XTSEL_W<'a> { w: &'a mut W, } @@ -99,12 +144,24 @@ impl<'a> XTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `XTLVL`"] -pub type XTLVL_R = crate::R; +#[doc = "Field `XTLVL` reader - External Trigger Level"] +pub struct XTLVL_R(crate::FieldReader); +impl XTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + XTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -124,9 +181,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `XTMODE`"] -pub type XTMODE_R = crate::R; +#[doc = "Field `XTMODE` reader - Trigger Operating Mode"] +pub struct XTMODE_R(crate::FieldReader); impl XTMODE_R { + pub(crate) fn new(bits: u8) -> Self { + XTMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XTMODE_A { @@ -141,25 +201,32 @@ impl XTMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XTMODE_A::VALUE1 + **self == XTMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XTMODE_A::VALUE2 + **self == XTMODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == XTMODE_A::VALUE3 + **self == XTMODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == XTMODE_A::VALUE4 + **self == XTMODE_A::VALUE4 + } +} +impl core::ops::Deref for XTMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XTMODE`"] +#[doc = "Field `XTMODE` writer - Trigger Operating Mode"] pub struct XTMODE_W<'a> { w: &'a mut W, } @@ -167,9 +234,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTMODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No external trigger"] #[inline(always)] @@ -194,7 +259,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -212,7 +277,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `XTWC`"] +#[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] pub struct XTWC_W<'a> { w: &'a mut W, } @@ -220,9 +285,7 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to trigger configuration"] #[inline(always)] @@ -247,13 +310,25 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `GTSEL`"] -pub type GTSEL_R = crate::R; -#[doc = "Write proxy for field `GTSEL`"] +#[doc = "Field `GTSEL` reader - Gate Input Selection"] +pub struct GTSEL_R(crate::FieldReader); +impl GTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + GTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GTSEL` writer - Gate Input Selection"] pub struct GTSEL_W<'a> { w: &'a mut W, } @@ -261,12 +336,24 @@ impl<'a> GTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } -#[doc = "Reader of field `GTLVL`"] -pub type GTLVL_R = crate::R; +#[doc = "Field `GTLVL` reader - Gate Input Level"] +pub struct GTLVL_R(crate::FieldReader); +impl GTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + GTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum GTWC_AW { @@ -281,7 +368,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `GTWC`"] +#[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] pub struct GTWC_W<'a> { w: &'a mut W, } @@ -289,9 +376,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to gate configuration"] #[inline(always)] @@ -316,7 +401,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -334,9 +419,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TMEN`"] -pub type TMEN_R = crate::R; +#[doc = "Field `TMEN` reader - Timer Mode Enable"] +pub struct TMEN_R(crate::FieldReader); impl TMEN_R { + pub(crate) fn new(bits: bool) -> Self { + TMEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TMEN_A { @@ -348,15 +436,22 @@ impl TMEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TMEN_A::VALUE1 + **self == TMEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TMEN_A::VALUE2 + **self == TMEN_A::VALUE2 + } +} +impl core::ops::Deref for TMEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TMEN`"] +#[doc = "Field `TMEN` writer - Timer Mode Enable"] pub struct TMEN_W<'a> { w: &'a mut W, } @@ -364,9 +459,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TMEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] @@ -391,7 +484,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -409,7 +502,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TMWC`"] +#[doc = "Field `TMWC` writer - Write Control for Timer Mode"] pub struct TMWC_W<'a> { w: &'a mut W, } @@ -417,9 +510,7 @@ impl<'a> TMWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TMWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to timer mode"] #[inline(always)] @@ -444,7 +535,7 @@ impl<'a> TMWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -526,4 +617,30 @@ impl W { pub fn tmwc(&mut self) -> TMWC_W { TMWC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Autoscan Source Control Register\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 [asctrl](index.html) module"] +pub struct ASCTRL_SPEC; +impl crate::RegisterSpec for ASCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [asctrl::R](R) reader structure"] +impl crate::Readable for ASCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [asctrl::W](W) writer structure"] +impl crate::Writable for ASCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ASCTRL to value 0"] +impl crate::Resettable for ASCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/asmr.rs b/src/vadc_g0/asmr.rs index 31026824..e71d6ec9 100644 --- a/src/vadc_g0/asmr.rs +++ b/src/vadc_g0/asmr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ASMR"] -pub type R = crate::R; -#[doc = "Writer for register ASMR"] -pub type W = crate::W; -#[doc = "Register ASMR `reset()`'s with value 0"] -impl crate::ResetValue for super::ASMR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ASMR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ASMR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable Gate\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENGT`"] -pub type ENGT_R = crate::R; +#[doc = "Field `ENGT` reader - Enable Gate"] +pub struct ENGT_R(crate::FieldReader); impl ENGT_R { + pub(crate) fn new(bits: u8) -> Self { + ENGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENGT_A { @@ -46,25 +73,32 @@ impl ENGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENGT_A::VALUE1 + **self == ENGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENGT_A::VALUE2 + **self == ENGT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENGT_A::VALUE3 + **self == ENGT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENGT_A::VALUE4 + **self == ENGT_A::VALUE4 } } -#[doc = "Write proxy for field `ENGT`"] +impl core::ops::Deref for ENGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENGT` writer - Enable Gate"] pub struct ENGT_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENGT_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No conversion requests are issued"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -117,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENTR`"] -pub type ENTR_R = crate::R; +#[doc = "Field `ENTR` reader - Enable External Trigger"] +pub struct ENTR_R(crate::FieldReader); impl ENTR_R { + pub(crate) fn new(bits: bool) -> Self { + ENTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENTR_A { @@ -131,15 +166,22 @@ impl ENTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENTR_A::VALUE1 + **self == ENTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENTR_A::VALUE2 + **self == ENTR_A::VALUE2 + } +} +impl core::ops::Deref for ENTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENTR`"] +#[doc = "Field `ENTR` writer - Enable External Trigger"] pub struct ENTR_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External trigger disabled"] #[inline(always)] @@ -174,7 +214,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -192,9 +232,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENSI`"] -pub type ENSI_R = crate::R; +#[doc = "Field `ENSI` reader - Enable Source Interrupt"] +pub struct ENSI_R(crate::FieldReader); impl ENSI_R { + pub(crate) fn new(bits: bool) -> Self { + ENSI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENSI_A { @@ -206,15 +249,22 @@ impl ENSI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENSI_A::VALUE1 + **self == ENSI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENSI_A::VALUE2 + **self == ENSI_A::VALUE2 } } -#[doc = "Write proxy for field `ENSI`"] +impl core::ops::Deref for ENSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENSI` writer - Enable Source Interrupt"] pub struct ENSI_W<'a> { w: &'a mut W, } @@ -222,9 +272,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENSI_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No request source interrupt"] #[inline(always)] @@ -249,7 +297,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -267,9 +315,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SCAN`"] -pub type SCAN_R = crate::R; +#[doc = "Field `SCAN` reader - Autoscan Enable"] +pub struct SCAN_R(crate::FieldReader); impl SCAN_R { + pub(crate) fn new(bits: bool) -> Self { + SCAN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SCAN_A { @@ -281,15 +332,22 @@ impl SCAN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SCAN_A::VALUE1 + **self == SCAN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SCAN_A::VALUE2 + **self == SCAN_A::VALUE2 } } -#[doc = "Write proxy for field `SCAN`"] +impl core::ops::Deref for SCAN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCAN` writer - Autoscan Enable"] pub struct SCAN_W<'a> { w: &'a mut W, } @@ -297,9 +355,7 @@ impl<'a> SCAN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SCAN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No autoscan"] #[inline(always)] @@ -324,7 +380,7 @@ impl<'a> SCAN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -342,9 +398,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `LDM`"] -pub type LDM_R = crate::R; +#[doc = "Field `LDM` reader - Autoscan Source Load Event Mode"] +pub struct LDM_R(crate::FieldReader); impl LDM_R { + pub(crate) fn new(bits: bool) -> Self { + LDM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LDM_A { @@ -356,15 +415,22 @@ impl LDM_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == LDM_A::VALUE1 + **self == LDM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == LDM_A::VALUE2 + **self == LDM_A::VALUE2 + } +} +impl core::ops::Deref for LDM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `LDM`"] +#[doc = "Field `LDM` writer - Autoscan Source Load Event Mode"] pub struct LDM_W<'a> { w: &'a mut W, } @@ -372,9 +438,7 @@ impl<'a> LDM_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LDM_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] @@ -399,7 +463,7 @@ impl<'a> LDM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -417,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REQGT`"] -pub type REQGT_R = crate::R; +#[doc = "Field `REQGT` reader - Request Gate Level"] +pub struct REQGT_R(crate::FieldReader); impl REQGT_R { + pub(crate) fn new(bits: bool) -> Self { + REQGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REQGT_A { @@ -431,12 +498,19 @@ impl REQGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REQGT_A::VALUE1 + **self == REQGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REQGT_A::VALUE2 + **self == REQGT_A::VALUE2 + } +} +impl core::ops::Deref for REQGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Clear Pending Bits\n\nValue on reset: 0"] @@ -453,7 +527,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CLRPND`"] +#[doc = "Field `CLRPND` writer - Clear Pending Bits"] pub struct CLRPND_W<'a> { w: &'a mut W, } @@ -461,9 +535,7 @@ impl<'a> CLRPND_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLRPND_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -488,7 +560,7 @@ impl<'a> CLRPND_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -506,7 +578,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `LDEV`"] +#[doc = "Field `LDEV` writer - Generate Load Event"] pub struct LDEV_W<'a> { w: &'a mut W, } @@ -514,9 +586,7 @@ impl<'a> LDEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: LDEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -541,7 +611,7 @@ impl<'a> LDEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -559,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPTDIS`"] -pub type RPTDIS_R = crate::R; +#[doc = "Field `RPTDIS` reader - Repeat Disable"] +pub struct RPTDIS_R(crate::FieldReader); impl RPTDIS_R { + pub(crate) fn new(bits: bool) -> Self { + RPTDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPTDIS_A { @@ -573,15 +646,22 @@ impl RPTDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPTDIS_A::VALUE1 + **self == RPTDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPTDIS_A::VALUE2 + **self == RPTDIS_A::VALUE2 + } +} +impl core::ops::Deref for RPTDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RPTDIS`"] +#[doc = "Field `RPTDIS` writer - Repeat Disable"] pub struct RPTDIS_W<'a> { w: &'a mut W, } @@ -589,9 +669,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RPTDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A cancelled conversion is repeated"] #[inline(always)] @@ -616,7 +694,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -698,4 +776,30 @@ impl W { pub fn rptdis(&mut self) -> RPTDIS_W { RPTDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Autoscan Source Mode Register\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 [asmr](index.html) module"] +pub struct ASMR_SPEC; +impl crate::RegisterSpec for ASMR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [asmr::R](R) reader structure"] +impl crate::Readable for ASMR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [asmr::W](W) writer structure"] +impl crate::Writable for ASMR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ASMR to value 0"] +impl crate::Resettable for ASMR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/aspnd.rs b/src/vadc_g0/aspnd.rs index f2b3a9de..506fd1f4 100644 --- a/src/vadc_g0/aspnd.rs +++ b/src/vadc_g0/aspnd.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ASPND"] -pub type R = crate::R; -#[doc = "Writer for register ASPND"] -pub type W = crate::W; -#[doc = "Register ASPND `reset()`'s with value 0"] -impl crate::ResetValue for super::ASPND { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ASPND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ASPND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Channels Pending\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND0`"] -pub type CHPND0_R = crate::R; +#[doc = "Field `CHPND0` reader - Channels Pending"] +pub struct CHPND0_R(crate::FieldReader); impl CHPND0_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND0_A { @@ -38,15 +65,22 @@ impl CHPND0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND0_A::VALUE1 + **self == CHPND0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND0_A::VALUE2 + **self == CHPND0_A::VALUE2 + } +} +impl core::ops::Deref for CHPND0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPND0`"] +#[doc = "Field `CHPND0` writer - Channels Pending"] pub struct CHPND0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CHPND0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CHPND0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND1`"] -pub type CHPND1_R = crate::R; +#[doc = "Field `CHPND1` reader - Channels Pending"] +pub struct CHPND1_R(crate::FieldReader); impl CHPND1_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND1_A { @@ -113,15 +148,22 @@ impl CHPND1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND1_A::VALUE1 + **self == CHPND1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND1_A::VALUE2 + **self == CHPND1_A::VALUE2 } } -#[doc = "Write proxy for field `CHPND1`"] +impl core::ops::Deref for CHPND1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPND1` writer - Channels Pending"] pub struct CHPND1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> CHPND1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> CHPND1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND2`"] -pub type CHPND2_R = crate::R; +#[doc = "Field `CHPND2` reader - Channels Pending"] +pub struct CHPND2_R(crate::FieldReader); impl CHPND2_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND2_A { @@ -188,15 +231,22 @@ impl CHPND2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND2_A::VALUE1 + **self == CHPND2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND2_A::VALUE2 + **self == CHPND2_A::VALUE2 + } +} +impl core::ops::Deref for CHPND2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPND2`"] +#[doc = "Field `CHPND2` writer - Channels Pending"] pub struct CHPND2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CHPND2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CHPND2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND3`"] -pub type CHPND3_R = crate::R; +#[doc = "Field `CHPND3` reader - Channels Pending"] +pub struct CHPND3_R(crate::FieldReader); impl CHPND3_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND3_A { @@ -263,15 +314,22 @@ impl CHPND3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND3_A::VALUE1 + **self == CHPND3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND3_A::VALUE2 + **self == CHPND3_A::VALUE2 } } -#[doc = "Write proxy for field `CHPND3`"] +impl core::ops::Deref for CHPND3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPND3` writer - Channels Pending"] pub struct CHPND3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> CHPND3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> CHPND3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND4`"] -pub type CHPND4_R = crate::R; +#[doc = "Field `CHPND4` reader - Channels Pending"] +pub struct CHPND4_R(crate::FieldReader); impl CHPND4_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND4_A { @@ -338,15 +397,22 @@ impl CHPND4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND4_A::VALUE1 + **self == CHPND4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND4_A::VALUE2 + **self == CHPND4_A::VALUE2 + } +} +impl core::ops::Deref for CHPND4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPND4`"] +#[doc = "Field `CHPND4` writer - Channels Pending"] pub struct CHPND4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CHPND4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CHPND4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND5`"] -pub type CHPND5_R = crate::R; +#[doc = "Field `CHPND5` reader - Channels Pending"] +pub struct CHPND5_R(crate::FieldReader); impl CHPND5_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND5_A { @@ -413,15 +480,22 @@ impl CHPND5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND5_A::VALUE1 + **self == CHPND5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND5_A::VALUE2 + **self == CHPND5_A::VALUE2 } } -#[doc = "Write proxy for field `CHPND5`"] +impl core::ops::Deref for CHPND5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHPND5` writer - Channels Pending"] pub struct CHPND5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> CHPND5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> CHPND5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND6`"] -pub type CHPND6_R = crate::R; +#[doc = "Field `CHPND6` reader - Channels Pending"] +pub struct CHPND6_R(crate::FieldReader); impl CHPND6_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND6_A { @@ -488,15 +563,22 @@ impl CHPND6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND6_A::VALUE1 + **self == CHPND6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND6_A::VALUE2 + **self == CHPND6_A::VALUE2 + } +} +impl core::ops::Deref for CHPND6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPND6`"] +#[doc = "Field `CHPND6` writer - Channels Pending"] pub struct CHPND6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> CHPND6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> CHPND6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHPND7`"] -pub type CHPND7_R = crate::R; +#[doc = "Field `CHPND7` reader - Channels Pending"] +pub struct CHPND7_R(crate::FieldReader); impl CHPND7_R { + pub(crate) fn new(bits: bool) -> Self { + CHPND7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHPND7_A { @@ -563,15 +646,22 @@ impl CHPND7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHPND7_A::VALUE1 + **self == CHPND7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHPND7_A::VALUE2 + **self == CHPND7_A::VALUE2 + } +} +impl core::ops::Deref for CHPND7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHPND7`"] +#[doc = "Field `CHPND7` writer - Channels Pending"] pub struct CHPND7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> CHPND7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHPND7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> CHPND7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -693,4 +781,30 @@ impl W { pub fn chpnd7(&mut self) -> CHPND7_W { CHPND7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Autoscan Source Pending Register\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 [aspnd](index.html) module"] +pub struct ASPND_SPEC; +impl crate::RegisterSpec for ASPND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [aspnd::R](R) reader structure"] +impl crate::Readable for ASPND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [aspnd::W](W) writer structure"] +impl crate::Writable for ASPND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ASPND to value 0"] +impl crate::Resettable for ASPND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/assel.rs b/src/vadc_g0/assel.rs index 5fb8139c..64edda43 100644 --- a/src/vadc_g0/assel.rs +++ b/src/vadc_g0/assel.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register ASSEL"] -pub type R = crate::R; -#[doc = "Writer for register ASSEL"] -pub type W = crate::W; -#[doc = "Register ASSEL `reset()`'s with value 0"] -impl crate::ResetValue for super::ASSEL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ASSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ASSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Channel Selection\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL0`"] -pub type CHSEL0_R = crate::R; +#[doc = "Field `CHSEL0` reader - Channel Selection"] +pub struct CHSEL0_R(crate::FieldReader); impl CHSEL0_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL0_A { @@ -38,15 +65,22 @@ impl CHSEL0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL0_A::VALUE1 + **self == CHSEL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL0_A::VALUE2 + **self == CHSEL0_A::VALUE2 + } +} +impl core::ops::Deref for CHSEL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSEL0`"] +#[doc = "Field `CHSEL0` writer - Channel Selection"] pub struct CHSEL0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CHSEL0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CHSEL0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL1`"] -pub type CHSEL1_R = crate::R; +#[doc = "Field `CHSEL1` reader - Channel Selection"] +pub struct CHSEL1_R(crate::FieldReader); impl CHSEL1_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL1_A { @@ -113,15 +148,22 @@ impl CHSEL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL1_A::VALUE1 + **self == CHSEL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL1_A::VALUE2 + **self == CHSEL1_A::VALUE2 } } -#[doc = "Write proxy for field `CHSEL1`"] +impl core::ops::Deref for CHSEL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSEL1` writer - Channel Selection"] pub struct CHSEL1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> CHSEL1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> CHSEL1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL2`"] -pub type CHSEL2_R = crate::R; +#[doc = "Field `CHSEL2` reader - Channel Selection"] +pub struct CHSEL2_R(crate::FieldReader); impl CHSEL2_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL2_A { @@ -188,15 +231,22 @@ impl CHSEL2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL2_A::VALUE1 + **self == CHSEL2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL2_A::VALUE2 + **self == CHSEL2_A::VALUE2 + } +} +impl core::ops::Deref for CHSEL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSEL2`"] +#[doc = "Field `CHSEL2` writer - Channel Selection"] pub struct CHSEL2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CHSEL2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CHSEL2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL3`"] -pub type CHSEL3_R = crate::R; +#[doc = "Field `CHSEL3` reader - Channel Selection"] +pub struct CHSEL3_R(crate::FieldReader); impl CHSEL3_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL3_A { @@ -263,15 +314,22 @@ impl CHSEL3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL3_A::VALUE1 + **self == CHSEL3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL3_A::VALUE2 + **self == CHSEL3_A::VALUE2 } } -#[doc = "Write proxy for field `CHSEL3`"] +impl core::ops::Deref for CHSEL3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSEL3` writer - Channel Selection"] pub struct CHSEL3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> CHSEL3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> CHSEL3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL4`"] -pub type CHSEL4_R = crate::R; +#[doc = "Field `CHSEL4` reader - Channel Selection"] +pub struct CHSEL4_R(crate::FieldReader); impl CHSEL4_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL4_A { @@ -338,15 +397,22 @@ impl CHSEL4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL4_A::VALUE1 + **self == CHSEL4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL4_A::VALUE2 + **self == CHSEL4_A::VALUE2 + } +} +impl core::ops::Deref for CHSEL4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSEL4`"] +#[doc = "Field `CHSEL4` writer - Channel Selection"] pub struct CHSEL4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CHSEL4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CHSEL4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL5`"] -pub type CHSEL5_R = crate::R; +#[doc = "Field `CHSEL5` reader - Channel Selection"] +pub struct CHSEL5_R(crate::FieldReader); impl CHSEL5_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL5_A { @@ -413,15 +480,22 @@ impl CHSEL5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL5_A::VALUE1 + **self == CHSEL5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL5_A::VALUE2 + **self == CHSEL5_A::VALUE2 } } -#[doc = "Write proxy for field `CHSEL5`"] +impl core::ops::Deref for CHSEL5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSEL5` writer - Channel Selection"] pub struct CHSEL5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> CHSEL5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> CHSEL5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL6`"] -pub type CHSEL6_R = crate::R; +#[doc = "Field `CHSEL6` reader - Channel Selection"] +pub struct CHSEL6_R(crate::FieldReader); impl CHSEL6_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL6_A { @@ -488,15 +563,22 @@ impl CHSEL6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL6_A::VALUE1 + **self == CHSEL6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL6_A::VALUE2 + **self == CHSEL6_A::VALUE2 + } +} +impl core::ops::Deref for CHSEL6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSEL6`"] +#[doc = "Field `CHSEL6` writer - Channel Selection"] pub struct CHSEL6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> CHSEL6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> CHSEL6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CHSEL7`"] -pub type CHSEL7_R = crate::R; +#[doc = "Field `CHSEL7` reader - Channel Selection"] +pub struct CHSEL7_R(crate::FieldReader); impl CHSEL7_R { + pub(crate) fn new(bits: bool) -> Self { + CHSEL7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHSEL7_A { @@ -563,15 +646,22 @@ impl CHSEL7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHSEL7_A::VALUE1 + **self == CHSEL7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHSEL7_A::VALUE2 + **self == CHSEL7_A::VALUE2 + } +} +impl core::ops::Deref for CHSEL7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CHSEL7`"] +#[doc = "Field `CHSEL7` writer - Channel Selection"] pub struct CHSEL7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> CHSEL7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHSEL7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Ignore this channel"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> CHSEL7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -693,4 +781,30 @@ impl W { pub fn chsel7(&mut self) -> CHSEL7_W { CHSEL7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Autoscan Source Channel Select Register\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 [assel](index.html) module"] +pub struct ASSEL_SPEC; +impl crate::RegisterSpec for ASSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [assel::R](R) reader structure"] +impl crate::Readable for ASSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [assel::W](W) writer structure"] +impl crate::Writable for ASSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ASSEL to value 0"] +impl crate::Resettable for ASSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/bfl.rs b/src/vadc_g0/bfl.rs index 5bcf5774..0edb4c27 100644 --- a/src/vadc_g0/bfl.rs +++ b/src/vadc_g0/bfl.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BFL"] -pub type R = crate::R; -#[doc = "Writer for register BFL"] -pub type W = crate::W; -#[doc = "Register BFL `reset()`'s with value 0"] -impl crate::ResetValue for super::BFL { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BFL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BFL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Boundary Flag 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFL0`"] -pub type BFL0_R = crate::R; +#[doc = "Field `BFL0` reader - Boundary Flag 0"] +pub struct BFL0_R(crate::FieldReader); impl BFL0_R { + pub(crate) fn new(bits: bool) -> Self { + BFL0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFL0_A { @@ -38,12 +65,19 @@ impl BFL0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL0_A::VALUE1 + **self == BFL0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL0_A::VALUE2 + **self == BFL0_A::VALUE2 + } +} +impl core::ops::Deref for BFL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Boundary Flag 1\n\nValue on reset: 0"] @@ -60,9 +94,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFL1`"] -pub type BFL1_R = crate::R; +#[doc = "Field `BFL1` reader - Boundary Flag 1"] +pub struct BFL1_R(crate::FieldReader); impl BFL1_R { + pub(crate) fn new(bits: bool) -> Self { + BFL1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFL1_A { @@ -74,12 +111,19 @@ impl BFL1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL1_A::VALUE1 + **self == BFL1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL1_A::VALUE2 + **self == BFL1_A::VALUE2 + } +} +impl core::ops::Deref for BFL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Boundary Flag 2\n\nValue on reset: 0"] @@ -96,9 +140,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFL2`"] -pub type BFL2_R = crate::R; +#[doc = "Field `BFL2` reader - Boundary Flag 2"] +pub struct BFL2_R(crate::FieldReader); impl BFL2_R { + pub(crate) fn new(bits: bool) -> Self { + BFL2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFL2_A { @@ -110,12 +157,19 @@ impl BFL2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL2_A::VALUE1 + **self == BFL2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL2_A::VALUE2 + **self == BFL2_A::VALUE2 + } +} +impl core::ops::Deref for BFL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Boundary Flag 3\n\nValue on reset: 0"] @@ -132,9 +186,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFL3`"] -pub type BFL3_R = crate::R; +#[doc = "Field `BFL3` reader - Boundary Flag 3"] +pub struct BFL3_R(crate::FieldReader); impl BFL3_R { + pub(crate) fn new(bits: bool) -> Self { + BFL3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFL3_A { @@ -146,12 +203,19 @@ impl BFL3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL3_A::VALUE1 + **self == BFL3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL3_A::VALUE2 + **self == BFL3_A::VALUE2 + } +} +impl core::ops::Deref for BFL3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Boundary Flag 0 Activation Select\n\nValue on reset: 0"] @@ -168,9 +232,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFA0`"] -pub type BFA0_R = crate::R; +#[doc = "Field `BFA0` reader - Boundary Flag 0 Activation Select"] +pub struct BFA0_R(crate::FieldReader); impl BFA0_R { + pub(crate) fn new(bits: bool) -> Self { + BFA0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFA0_A { @@ -182,15 +249,22 @@ impl BFA0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFA0_A::VALUE1 + **self == BFA0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFA0_A::VALUE2 + **self == BFA0_A::VALUE2 } } -#[doc = "Write proxy for field `BFA0`"] +impl core::ops::Deref for BFA0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFA0` writer - Boundary Flag 0 Activation Select"] pub struct BFA0_W<'a> { w: &'a mut W, } @@ -198,9 +272,7 @@ impl<'a> BFA0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFA0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] @@ -225,7 +297,7 @@ impl<'a> BFA0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -243,9 +315,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFA1`"] -pub type BFA1_R = crate::R; +#[doc = "Field `BFA1` reader - Boundary Flag 1 Activation Select"] +pub struct BFA1_R(crate::FieldReader); impl BFA1_R { + pub(crate) fn new(bits: bool) -> Self { + BFA1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFA1_A { @@ -257,15 +332,22 @@ impl BFA1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFA1_A::VALUE1 + **self == BFA1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFA1_A::VALUE2 + **self == BFA1_A::VALUE2 } } -#[doc = "Write proxy for field `BFA1`"] +impl core::ops::Deref for BFA1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFA1` writer - Boundary Flag 1 Activation Select"] pub struct BFA1_W<'a> { w: &'a mut W, } @@ -273,9 +355,7 @@ impl<'a> BFA1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFA1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] @@ -300,7 +380,7 @@ impl<'a> BFA1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -318,9 +398,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFA2`"] -pub type BFA2_R = crate::R; +#[doc = "Field `BFA2` reader - Boundary Flag 2 Activation Select"] +pub struct BFA2_R(crate::FieldReader); impl BFA2_R { + pub(crate) fn new(bits: bool) -> Self { + BFA2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFA2_A { @@ -332,15 +415,22 @@ impl BFA2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFA2_A::VALUE1 + **self == BFA2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFA2_A::VALUE2 + **self == BFA2_A::VALUE2 } } -#[doc = "Write proxy for field `BFA2`"] +impl core::ops::Deref for BFA2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFA2` writer - Boundary Flag 2 Activation Select"] pub struct BFA2_W<'a> { w: &'a mut W, } @@ -348,9 +438,7 @@ impl<'a> BFA2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFA2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] @@ -375,7 +463,7 @@ impl<'a> BFA2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -393,9 +481,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFA3`"] -pub type BFA3_R = crate::R; +#[doc = "Field `BFA3` reader - Boundary Flag 3 Activation Select"] +pub struct BFA3_R(crate::FieldReader); impl BFA3_R { + pub(crate) fn new(bits: bool) -> Self { + BFA3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFA3_A { @@ -407,15 +498,22 @@ impl BFA3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFA3_A::VALUE1 + **self == BFA3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFA3_A::VALUE2 + **self == BFA3_A::VALUE2 } } -#[doc = "Write proxy for field `BFA3`"] +impl core::ops::Deref for BFA3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFA3` writer - Boundary Flag 3 Activation Select"] pub struct BFA3_W<'a> { w: &'a mut W, } @@ -423,9 +521,7 @@ impl<'a> BFA3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFA3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] @@ -450,7 +546,7 @@ impl<'a> BFA3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -468,9 +564,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFI0`"] -pub type BFI0_R = crate::R; +#[doc = "Field `BFI0` reader - Boundary Flag 0 Inversion Control"] +pub struct BFI0_R(crate::FieldReader); impl BFI0_R { + pub(crate) fn new(bits: bool) -> Self { + BFI0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFI0_A { @@ -482,15 +581,22 @@ impl BFI0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFI0_A::VALUE1 + **self == BFI0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFI0_A::VALUE2 + **self == BFI0_A::VALUE2 } } -#[doc = "Write proxy for field `BFI0`"] +impl core::ops::Deref for BFI0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFI0` writer - Boundary Flag 0 Inversion Control"] pub struct BFI0_W<'a> { w: &'a mut W, } @@ -498,9 +604,7 @@ impl<'a> BFI0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFI0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Use BFLy directly"] #[inline(always)] @@ -525,7 +629,7 @@ impl<'a> BFI0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -543,9 +647,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFI1`"] -pub type BFI1_R = crate::R; +#[doc = "Field `BFI1` reader - Boundary Flag 1 Inversion Control"] +pub struct BFI1_R(crate::FieldReader); impl BFI1_R { + pub(crate) fn new(bits: bool) -> Self { + BFI1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFI1_A { @@ -557,15 +664,22 @@ impl BFI1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFI1_A::VALUE1 + **self == BFI1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFI1_A::VALUE2 + **self == BFI1_A::VALUE2 } } -#[doc = "Write proxy for field `BFI1`"] +impl core::ops::Deref for BFI1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFI1` writer - Boundary Flag 1 Inversion Control"] pub struct BFI1_W<'a> { w: &'a mut W, } @@ -573,9 +687,7 @@ impl<'a> BFI1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFI1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Use BFLy directly"] #[inline(always)] @@ -600,7 +712,7 @@ impl<'a> BFI1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -618,9 +730,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFI2`"] -pub type BFI2_R = crate::R; +#[doc = "Field `BFI2` reader - Boundary Flag 2 Inversion Control"] +pub struct BFI2_R(crate::FieldReader); impl BFI2_R { + pub(crate) fn new(bits: bool) -> Self { + BFI2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFI2_A { @@ -632,15 +747,22 @@ impl BFI2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFI2_A::VALUE1 + **self == BFI2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFI2_A::VALUE2 + **self == BFI2_A::VALUE2 } } -#[doc = "Write proxy for field `BFI2`"] +impl core::ops::Deref for BFI2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFI2` writer - Boundary Flag 2 Inversion Control"] pub struct BFI2_W<'a> { w: &'a mut W, } @@ -648,9 +770,7 @@ impl<'a> BFI2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFI2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Use BFLy directly"] #[inline(always)] @@ -675,7 +795,7 @@ impl<'a> BFI2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -693,9 +813,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BFI3`"] -pub type BFI3_R = crate::R; +#[doc = "Field `BFI3` reader - Boundary Flag 3 Inversion Control"] +pub struct BFI3_R(crate::FieldReader); impl BFI3_R { + pub(crate) fn new(bits: bool) -> Self { + BFI3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BFI3_A { @@ -707,15 +830,22 @@ impl BFI3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFI3_A::VALUE1 + **self == BFI3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFI3_A::VALUE2 + **self == BFI3_A::VALUE2 } } -#[doc = "Write proxy for field `BFI3`"] +impl core::ops::Deref for BFI3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFI3` writer - Boundary Flag 3 Inversion Control"] pub struct BFI3_W<'a> { w: &'a mut W, } @@ -723,9 +853,7 @@ impl<'a> BFI3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFI3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Use BFLy directly"] #[inline(always)] @@ -750,7 +878,7 @@ impl<'a> BFI3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -857,4 +985,30 @@ impl W { pub fn bfi3(&mut self) -> BFI3_W { BFI3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Boundary Flag Register\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 [bfl](index.html) module"] +pub struct BFL_SPEC; +impl crate::RegisterSpec for BFL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bfl::R](R) reader structure"] +impl crate::Readable for BFL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bfl::W](W) writer structure"] +impl crate::Writable for BFL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BFL to value 0"] +impl crate::Resettable for BFL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/bflc.rs b/src/vadc_g0/bflc.rs index 0a84ce4a..142ca973 100644 --- a/src/vadc_g0/bflc.rs +++ b/src/vadc_g0/bflc.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BFLC"] -pub type R = crate::R; -#[doc = "Writer for register BFLC"] -pub type W = crate::W; -#[doc = "Register BFLC `reset()`'s with value 0"] -impl crate::ResetValue for super::BFLC { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `BFLC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BFLC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Boundary Flag y Mode Control\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFM0`"] -pub type BFM0_R = crate::R; +#[doc = "Field `BFM0` reader - Boundary Flag y Mode Control"] +pub struct BFM0_R(crate::FieldReader); impl BFM0_R { + pub(crate) fn new(bits: u8) -> Self { + BFM0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFM0_A::VALUE1), - 1 => Val(BFM0_A::VALUE2), - 2 => Val(BFM0_A::VALUE3), - 3 => Val(BFM0_A::VALUE4), - i => Res(i), + 0 => Some(BFM0_A::VALUE1), + 1 => Some(BFM0_A::VALUE2), + 2 => Some(BFM0_A::VALUE3), + 3 => Some(BFM0_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFM0_A::VALUE1 + **self == BFM0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFM0_A::VALUE2 + **self == BFM0_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFM0_A::VALUE3 + **self == BFM0_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFM0_A::VALUE4 + **self == BFM0_A::VALUE4 } } -#[doc = "Write proxy for field `BFM0`"] +impl core::ops::Deref for BFM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFM0` writer - Boundary Flag y Mode Control"] pub struct BFM0_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> BFM0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFM1`"] -pub type BFM1_R = crate::R; +#[doc = "Field `BFM1` reader - Boundary Flag y Mode Control"] +pub struct BFM1_R(crate::FieldReader); impl BFM1_R { + pub(crate) fn new(bits: u8) -> Self { + BFM1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFM1_A::VALUE1), - 1 => Val(BFM1_A::VALUE2), - 2 => Val(BFM1_A::VALUE3), - 3 => Val(BFM1_A::VALUE4), - i => Res(i), + 0 => Some(BFM1_A::VALUE1), + 1 => Some(BFM1_A::VALUE2), + 2 => Some(BFM1_A::VALUE3), + 3 => Some(BFM1_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFM1_A::VALUE1 + **self == BFM1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFM1_A::VALUE2 + **self == BFM1_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFM1_A::VALUE3 + **self == BFM1_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFM1_A::VALUE4 + **self == BFM1_A::VALUE4 } } -#[doc = "Write proxy for field `BFM1`"] +impl core::ops::Deref for BFM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFM1` writer - Boundary Flag y Mode Control"] pub struct BFM1_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> BFM1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -213,43 +255,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFM2`"] -pub type BFM2_R = crate::R; +#[doc = "Field `BFM2` reader - Boundary Flag y Mode Control"] +pub struct BFM2_R(crate::FieldReader); impl BFM2_R { + pub(crate) fn new(bits: u8) -> Self { + BFM2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFM2_A::VALUE1), - 1 => Val(BFM2_A::VALUE2), - 2 => Val(BFM2_A::VALUE3), - 3 => Val(BFM2_A::VALUE4), - i => Res(i), + 0 => Some(BFM2_A::VALUE1), + 1 => Some(BFM2_A::VALUE2), + 2 => Some(BFM2_A::VALUE3), + 3 => Some(BFM2_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFM2_A::VALUE1 + **self == BFM2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFM2_A::VALUE2 + **self == BFM2_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFM2_A::VALUE3 + **self == BFM2_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFM2_A::VALUE4 + **self == BFM2_A::VALUE4 + } +} +impl core::ops::Deref for BFM2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFM2`"] +#[doc = "Field `BFM2` writer - Boundary Flag y Mode Control"] pub struct BFM2_W<'a> { w: &'a mut W, } @@ -282,7 +333,7 @@ impl<'a> BFM2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -305,43 +356,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFM3`"] -pub type BFM3_R = crate::R; +#[doc = "Field `BFM3` reader - Boundary Flag y Mode Control"] +pub struct BFM3_R(crate::FieldReader); impl BFM3_R { + pub(crate) fn new(bits: u8) -> Self { + BFM3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFM3_A::VALUE1), - 1 => Val(BFM3_A::VALUE2), - 2 => Val(BFM3_A::VALUE3), - 3 => Val(BFM3_A::VALUE4), - i => Res(i), + 0 => Some(BFM3_A::VALUE1), + 1 => Some(BFM3_A::VALUE2), + 2 => Some(BFM3_A::VALUE3), + 3 => Some(BFM3_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFM3_A::VALUE1 + **self == BFM3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFM3_A::VALUE2 + **self == BFM3_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFM3_A::VALUE3 + **self == BFM3_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFM3_A::VALUE4 + **self == BFM3_A::VALUE4 + } +} +impl core::ops::Deref for BFM3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFM3`"] +#[doc = "Field `BFM3` writer - Boundary Flag y Mode Control"] pub struct BFM3_W<'a> { w: &'a mut W, } @@ -374,7 +434,7 @@ impl<'a> BFM3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -421,4 +481,30 @@ impl W { pub fn bfm3(&mut self) -> BFM3_W { BFM3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Boundary Flag Control Register\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 [bflc](index.html) module"] +pub struct BFLC_SPEC; +impl crate::RegisterSpec for BFLC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bflc::R](R) reader structure"] +impl crate::Readable for BFLC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bflc::W](W) writer structure"] +impl crate::Writable for BFLC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BFLC to value 0"] +impl crate::Resettable for BFLC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/bflnp.rs b/src/vadc_g0/bflnp.rs index e62015ec..d33202ad 100644 --- a/src/vadc_g0/bflnp.rs +++ b/src/vadc_g0/bflnp.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register BFLNP"] -pub type R = crate::R; -#[doc = "Writer for register BFLNP"] -pub type W = crate::W; -#[doc = "Register BFLNP `reset()`'s with value 0xffff"] -impl crate::ResetValue for super::BFLNP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0xffff +#[doc = "Register `BFLNP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BFLNP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Boundary Flag y Node Pointer\n\nValue on reset: 15"] @@ -31,49 +55,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFL0NP`"] -pub type BFL0NP_R = crate::R; +#[doc = "Field `BFL0NP` reader - Boundary Flag y Node Pointer"] +pub struct BFL0NP_R(crate::FieldReader); impl BFL0NP_R { + pub(crate) fn new(bits: u8) -> Self { + BFL0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFL0NP_A::VALUE1), - 3 => Val(BFL0NP_A::VALUE2), - 4 => Val(BFL0NP_A::VALUE3), - 7 => Val(BFL0NP_A::VALUE4), - 15 => Val(BFL0NP_A::VALUE5), - i => Res(i), + 0 => Some(BFL0NP_A::VALUE1), + 3 => Some(BFL0NP_A::VALUE2), + 4 => Some(BFL0NP_A::VALUE3), + 7 => Some(BFL0NP_A::VALUE4), + 15 => Some(BFL0NP_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL0NP_A::VALUE1 + **self == BFL0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL0NP_A::VALUE2 + **self == BFL0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFL0NP_A::VALUE3 + **self == BFL0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFL0NP_A::VALUE4 + **self == BFL0NP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == BFL0NP_A::VALUE5 + **self == BFL0NP_A::VALUE5 } } -#[doc = "Write proxy for field `BFL0NP`"] +impl core::ops::Deref for BFL0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFL0NP` writer - Boundary Flag y Node Pointer"] pub struct BFL0NP_W<'a> { w: &'a mut W, } @@ -111,7 +144,7 @@ impl<'a> BFL0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -136,49 +169,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFL1NP`"] -pub type BFL1NP_R = crate::R; +#[doc = "Field `BFL1NP` reader - Boundary Flag y Node Pointer"] +pub struct BFL1NP_R(crate::FieldReader); impl BFL1NP_R { + pub(crate) fn new(bits: u8) -> Self { + BFL1NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFL1NP_A::VALUE1), - 3 => Val(BFL1NP_A::VALUE2), - 4 => Val(BFL1NP_A::VALUE3), - 7 => Val(BFL1NP_A::VALUE4), - 15 => Val(BFL1NP_A::VALUE5), - i => Res(i), + 0 => Some(BFL1NP_A::VALUE1), + 3 => Some(BFL1NP_A::VALUE2), + 4 => Some(BFL1NP_A::VALUE3), + 7 => Some(BFL1NP_A::VALUE4), + 15 => Some(BFL1NP_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL1NP_A::VALUE1 + **self == BFL1NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL1NP_A::VALUE2 + **self == BFL1NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFL1NP_A::VALUE3 + **self == BFL1NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFL1NP_A::VALUE4 + **self == BFL1NP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == BFL1NP_A::VALUE5 + **self == BFL1NP_A::VALUE5 } } -#[doc = "Write proxy for field `BFL1NP`"] +impl core::ops::Deref for BFL1NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BFL1NP` writer - Boundary Flag y Node Pointer"] pub struct BFL1NP_W<'a> { w: &'a mut W, } @@ -216,7 +258,7 @@ impl<'a> BFL1NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -241,49 +283,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFL2NP`"] -pub type BFL2NP_R = crate::R; +#[doc = "Field `BFL2NP` reader - Boundary Flag y Node Pointer"] +pub struct BFL2NP_R(crate::FieldReader); impl BFL2NP_R { + pub(crate) fn new(bits: u8) -> Self { + BFL2NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFL2NP_A::VALUE1), - 3 => Val(BFL2NP_A::VALUE2), - 4 => Val(BFL2NP_A::VALUE3), - 7 => Val(BFL2NP_A::VALUE4), - 15 => Val(BFL2NP_A::VALUE5), - i => Res(i), + 0 => Some(BFL2NP_A::VALUE1), + 3 => Some(BFL2NP_A::VALUE2), + 4 => Some(BFL2NP_A::VALUE3), + 7 => Some(BFL2NP_A::VALUE4), + 15 => Some(BFL2NP_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL2NP_A::VALUE1 + **self == BFL2NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL2NP_A::VALUE2 + **self == BFL2NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFL2NP_A::VALUE3 + **self == BFL2NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFL2NP_A::VALUE4 + **self == BFL2NP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == BFL2NP_A::VALUE5 + **self == BFL2NP_A::VALUE5 + } +} +impl core::ops::Deref for BFL2NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFL2NP`"] +#[doc = "Field `BFL2NP` writer - Boundary Flag y Node Pointer"] pub struct BFL2NP_W<'a> { w: &'a mut W, } @@ -321,7 +372,7 @@ impl<'a> BFL2NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -346,49 +397,58 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BFL3NP`"] -pub type BFL3NP_R = crate::R; +#[doc = "Field `BFL3NP` reader - Boundary Flag y Node Pointer"] +pub struct BFL3NP_R(crate::FieldReader); impl BFL3NP_R { + pub(crate) fn new(bits: u8) -> Self { + BFL3NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BFL3NP_A::VALUE1), - 3 => Val(BFL3NP_A::VALUE2), - 4 => Val(BFL3NP_A::VALUE3), - 7 => Val(BFL3NP_A::VALUE4), - 15 => Val(BFL3NP_A::VALUE5), - i => Res(i), + 0 => Some(BFL3NP_A::VALUE1), + 3 => Some(BFL3NP_A::VALUE2), + 4 => Some(BFL3NP_A::VALUE3), + 7 => Some(BFL3NP_A::VALUE4), + 15 => Some(BFL3NP_A::VALUE5), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BFL3NP_A::VALUE1 + **self == BFL3NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BFL3NP_A::VALUE2 + **self == BFL3NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BFL3NP_A::VALUE3 + **self == BFL3NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BFL3NP_A::VALUE4 + **self == BFL3NP_A::VALUE4 } #[doc = "Checks if the value of the field is `VALUE5`"] #[inline(always)] pub fn is_value5(&self) -> bool { - *self == BFL3NP_A::VALUE5 + **self == BFL3NP_A::VALUE5 + } +} +impl core::ops::Deref for BFL3NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BFL3NP`"] +#[doc = "Field `BFL3NP` writer - Boundary Flag y Node Pointer"] pub struct BFL3NP_W<'a> { w: &'a mut W, } @@ -426,7 +486,7 @@ impl<'a> BFL3NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -473,4 +533,30 @@ impl W { pub fn bfl3np(&mut self) -> BFL3NP_W { BFL3NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Boundary Flag Node Pointer Register\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 [bflnp](index.html) module"] +pub struct BFLNP_SPEC; +impl crate::RegisterSpec for BFLNP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bflnp::R](R) reader structure"] +impl crate::Readable for BFLNP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bflnp::W](W) writer structure"] +impl crate::Writable for BFLNP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BFLNP to value 0xffff"] +impl crate::Resettable for BFLNP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff + } } diff --git a/src/vadc_g0/bfls.rs b/src/vadc_g0/bfls.rs index 1ebe7d34..2765d78e 100644 --- a/src/vadc_g0/bfls.rs +++ b/src/vadc_g0/bfls.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register BFLS"] -pub type W = crate::W; -#[doc = "Register BFLS `reset()`'s with value 0"] -impl crate::ResetValue for super::BFLS { - type Type = u32; +#[doc = "Register `BFLS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Boundary Flag 0 Clear\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFC0`"] +#[doc = "Field `BFC0` writer - Boundary Flag 0 Clear"] pub struct BFC0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> BFC0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFC0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> BFC0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFC1`"] +#[doc = "Field `BFC1` writer - Boundary Flag 1 Clear"] pub struct BFC1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> BFC1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFC1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> BFC1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFC2`"] +#[doc = "Field `BFC2` writer - Boundary Flag 2 Clear"] pub struct BFC2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> BFC2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFC2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> BFC2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFC3`"] +#[doc = "Field `BFC3` writer - Boundary Flag 3 Clear"] pub struct BFC3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> BFC3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFC3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> BFC3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFS0`"] +#[doc = "Field `BFS0` writer - Boundary Flag 0 Set"] pub struct BFS0_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> BFS0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFS0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> BFS0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFS1`"] +#[doc = "Field `BFS1` writer - Boundary Flag 1 Set"] pub struct BFS1_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> BFS1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFS1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> BFS1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFS2`"] +#[doc = "Field `BFS2` writer - Boundary Flag 2 Set"] pub struct BFS2_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> BFS2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFS2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> BFS2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `BFS3`"] +#[doc = "Field `BFS3` writer - Boundary Flag 3 Set"] pub struct BFS3_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> BFS3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BFS3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> BFS3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn bfs3(&mut self) -> BFS3_W { BFS3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Boundary Flag Software Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bfls](index.html) module"] +pub struct BFLS_SPEC; +impl crate::RegisterSpec for BFLS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [bfls::W](W) writer structure"] +impl crate::Writable for BFLS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BFLS to value 0"] +impl crate::Resettable for BFLS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/bound.rs b/src/vadc_g0/bound.rs index fefe35ca..a1056715 100644 --- a/src/vadc_g0/bound.rs +++ b/src/vadc_g0/bound.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register BOUND"] -pub type R = crate::R; -#[doc = "Writer for register BOUND"] -pub type W = crate::W; -#[doc = "Register BOUND `reset()`'s with value 0"] -impl crate::ResetValue for super::BOUND { - type Type = u32; +#[doc = "Register `BOUND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BOUND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BOUNDARY0` reader - Boundary Value 0 for Limit Checking"] +pub struct BOUNDARY0_R(crate::FieldReader); +impl BOUNDARY0_R { + pub(crate) fn new(bits: u16) -> Self { + BOUNDARY0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BOUNDARY0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `BOUNDARY0`"] -pub type BOUNDARY0_R = crate::R; -#[doc = "Write proxy for field `BOUNDARY0`"] +#[doc = "Field `BOUNDARY0` writer - Boundary Value 0 for Limit Checking"] pub struct BOUNDARY0_W<'a> { w: &'a mut W, } @@ -20,13 +56,25 @@ impl<'a> BOUNDARY0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0fff) | ((value as u32) & 0x0fff); + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); self.w } } -#[doc = "Reader of field `BOUNDARY1`"] -pub type BOUNDARY1_R = crate::R; -#[doc = "Write proxy for field `BOUNDARY1`"] +#[doc = "Field `BOUNDARY1` reader - Boundary Value 1 for Limit Checking"] +pub struct BOUNDARY1_R(crate::FieldReader); +impl BOUNDARY1_R { + pub(crate) fn new(bits: u16) -> Self { + BOUNDARY1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BOUNDARY1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BOUNDARY1` writer - Boundary Value 1 for Limit Checking"] pub struct BOUNDARY1_W<'a> { w: &'a mut W, } @@ -34,7 +82,7 @@ impl<'a> BOUNDARY1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0fff << 16)) | (((value as u32) & 0x0fff) << 16); + self.w.bits = (self.w.bits & !(0x0fff << 16)) | ((value as u32 & 0x0fff) << 16); self.w } } @@ -61,4 +109,30 @@ impl W { pub fn boundary1(&mut self) -> BOUNDARY1_W { BOUNDARY1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Boundary Select Register\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 [bound](index.html) module"] +pub struct BOUND_SPEC; +impl crate::RegisterSpec for BOUND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bound::R](R) reader structure"] +impl crate::Readable for BOUND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bound::W](W) writer structure"] +impl crate::Writable for BOUND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BOUND to value 0"] +impl crate::Resettable for BOUND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/cefclr.rs b/src/vadc_g0/cefclr.rs index bbc35fa4..09ba78f2 100644 --- a/src/vadc_g0/cefclr.rs +++ b/src/vadc_g0/cefclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register CEFCLR"] -pub type W = crate::W; -#[doc = "Register CEFCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::CEFCLR { - type Type = u32; +#[doc = "Register `CEFCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Channel Event for Channel 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV0`"] +#[doc = "Field `CEV0` writer - Clear Channel Event for Channel 0"] pub struct CEV0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> CEV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> CEV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV1`"] +#[doc = "Field `CEV1` writer - Clear Channel Event for Channel 1"] pub struct CEV1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> CEV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> CEV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV2`"] +#[doc = "Field `CEV2` writer - Clear Channel Event for Channel 2"] pub struct CEV2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> CEV2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> CEV2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV3`"] +#[doc = "Field `CEV3` writer - Clear Channel Event for Channel 3"] pub struct CEV3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> CEV3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> CEV3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV4`"] +#[doc = "Field `CEV4` writer - Clear Channel Event for Channel 4"] pub struct CEV4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> CEV4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> CEV4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV5`"] +#[doc = "Field `CEV5` writer - Clear Channel Event for Channel 5"] pub struct CEV5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> CEV5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> CEV5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV6`"] +#[doc = "Field `CEV6` writer - Clear Channel Event for Channel 6"] pub struct CEV6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> CEV6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> CEV6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV7`"] +#[doc = "Field `CEV7` writer - Clear Channel Event for Channel 7"] pub struct CEV7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> CEV7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> CEV7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn cev7(&mut self) -> CEV7_W { CEV7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Event Flag Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cefclr](index.html) module"] +pub struct CEFCLR_SPEC; +impl crate::RegisterSpec for CEFCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [cefclr::W](W) writer structure"] +impl crate::Writable for CEFCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CEFCLR to value 0"] +impl crate::Resettable for CEFCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/ceflag.rs b/src/vadc_g0/ceflag.rs index 6a17d235..9f5d63e1 100644 --- a/src/vadc_g0/ceflag.rs +++ b/src/vadc_g0/ceflag.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CEFLAG"] -pub type R = crate::R; -#[doc = "Writer for register CEFLAG"] -pub type W = crate::W; -#[doc = "Register CEFLAG `reset()`'s with value 0"] -impl crate::ResetValue for super::CEFLAG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CEFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CEFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Channel Event for Channel 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV0`"] -pub type CEV0_R = crate::R; +#[doc = "Field `CEV0` reader - Channel Event for Channel 0"] +pub struct CEV0_R(crate::FieldReader); impl CEV0_R { + pub(crate) fn new(bits: bool) -> Self { + CEV0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV0_A { @@ -38,15 +65,22 @@ impl CEV0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV0_A::VALUE1 + **self == CEV0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV0_A::VALUE2 + **self == CEV0_A::VALUE2 + } +} +impl core::ops::Deref for CEV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV0`"] +#[doc = "Field `CEV0` writer - Channel Event for Channel 0"] pub struct CEV0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> CEV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> CEV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV1`"] -pub type CEV1_R = crate::R; +#[doc = "Field `CEV1` reader - Channel Event for Channel 1"] +pub struct CEV1_R(crate::FieldReader); impl CEV1_R { + pub(crate) fn new(bits: bool) -> Self { + CEV1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV1_A { @@ -113,15 +148,22 @@ impl CEV1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV1_A::VALUE1 + **self == CEV1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV1_A::VALUE2 + **self == CEV1_A::VALUE2 } } -#[doc = "Write proxy for field `CEV1`"] +impl core::ops::Deref for CEV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV1` writer - Channel Event for Channel 1"] pub struct CEV1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> CEV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> CEV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV2`"] -pub type CEV2_R = crate::R; +#[doc = "Field `CEV2` reader - Channel Event for Channel 2"] +pub struct CEV2_R(crate::FieldReader); impl CEV2_R { + pub(crate) fn new(bits: bool) -> Self { + CEV2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV2_A { @@ -188,15 +231,22 @@ impl CEV2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV2_A::VALUE1 + **self == CEV2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV2_A::VALUE2 + **self == CEV2_A::VALUE2 + } +} +impl core::ops::Deref for CEV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV2`"] +#[doc = "Field `CEV2` writer - Channel Event for Channel 2"] pub struct CEV2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> CEV2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> CEV2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV3`"] -pub type CEV3_R = crate::R; +#[doc = "Field `CEV3` reader - Channel Event for Channel 3"] +pub struct CEV3_R(crate::FieldReader); impl CEV3_R { + pub(crate) fn new(bits: bool) -> Self { + CEV3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV3_A { @@ -263,15 +314,22 @@ impl CEV3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV3_A::VALUE1 + **self == CEV3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV3_A::VALUE2 + **self == CEV3_A::VALUE2 } } -#[doc = "Write proxy for field `CEV3`"] +impl core::ops::Deref for CEV3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV3` writer - Channel Event for Channel 3"] pub struct CEV3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> CEV3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> CEV3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV4`"] -pub type CEV4_R = crate::R; +#[doc = "Field `CEV4` reader - Channel Event for Channel 4"] +pub struct CEV4_R(crate::FieldReader); impl CEV4_R { + pub(crate) fn new(bits: bool) -> Self { + CEV4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV4_A { @@ -338,15 +397,22 @@ impl CEV4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV4_A::VALUE1 + **self == CEV4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV4_A::VALUE2 + **self == CEV4_A::VALUE2 + } +} +impl core::ops::Deref for CEV4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV4`"] +#[doc = "Field `CEV4` writer - Channel Event for Channel 4"] pub struct CEV4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> CEV4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> CEV4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV5`"] -pub type CEV5_R = crate::R; +#[doc = "Field `CEV5` reader - Channel Event for Channel 5"] +pub struct CEV5_R(crate::FieldReader); impl CEV5_R { + pub(crate) fn new(bits: bool) -> Self { + CEV5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV5_A { @@ -413,15 +480,22 @@ impl CEV5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV5_A::VALUE1 + **self == CEV5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV5_A::VALUE2 + **self == CEV5_A::VALUE2 } } -#[doc = "Write proxy for field `CEV5`"] +impl core::ops::Deref for CEV5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV5` writer - Channel Event for Channel 5"] pub struct CEV5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> CEV5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> CEV5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV6`"] -pub type CEV6_R = crate::R; +#[doc = "Field `CEV6` reader - Channel Event for Channel 6"] +pub struct CEV6_R(crate::FieldReader); impl CEV6_R { + pub(crate) fn new(bits: bool) -> Self { + CEV6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV6_A { @@ -488,15 +563,22 @@ impl CEV6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV6_A::VALUE1 + **self == CEV6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV6_A::VALUE2 + **self == CEV6_A::VALUE2 + } +} +impl core::ops::Deref for CEV6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV6`"] +#[doc = "Field `CEV6` writer - Channel Event for Channel 6"] pub struct CEV6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> CEV6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> CEV6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `CEV7`"] -pub type CEV7_R = crate::R; +#[doc = "Field `CEV7` reader - Channel Event for Channel 7"] +pub struct CEV7_R(crate::FieldReader); impl CEV7_R { + pub(crate) fn new(bits: bool) -> Self { + CEV7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CEV7_A { @@ -563,15 +646,22 @@ impl CEV7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV7_A::VALUE1 + **self == CEV7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV7_A::VALUE2 + **self == CEV7_A::VALUE2 + } +} +impl core::ops::Deref for CEV7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV7`"] +#[doc = "Field `CEV7` writer - Channel Event for Channel 7"] pub struct CEV7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> CEV7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No channel event"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> CEV7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -693,4 +781,30 @@ impl W { pub fn cev7(&mut self) -> CEV7_W { CEV7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Event Flag Register\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 [ceflag](index.html) module"] +pub struct CEFLAG_SPEC; +impl crate::RegisterSpec for CEFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ceflag::R](R) reader structure"] +impl crate::Readable for CEFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ceflag::W](W) writer structure"] +impl crate::Writable for CEFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CEFLAG to value 0"] +impl crate::Resettable for CEFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/cevnp0.rs b/src/vadc_g0/cevnp0.rs index 1bbe2206..24febd5a 100644 --- a/src/vadc_g0/cevnp0.rs +++ b/src/vadc_g0/cevnp0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CEVNP0"] -pub type R = crate::R; -#[doc = "Writer for register CEVNP0"] -pub type W = crate::W; -#[doc = "Register CEVNP0 `reset()`'s with value 0"] -impl crate::ResetValue for super::CEVNP0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CEVNP0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CEVNP0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV0NP`"] -pub type CEV0NP_R = crate::R; +#[doc = "Field `CEV0NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV0NP_R(crate::FieldReader); impl CEV0NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV0NP_A::VALUE1), - 3 => Val(CEV0NP_A::VALUE2), - 4 => Val(CEV0NP_A::VALUE3), - 7 => Val(CEV0NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV0NP_A::VALUE1), + 3 => Some(CEV0NP_A::VALUE2), + 4 => Some(CEV0NP_A::VALUE3), + 7 => Some(CEV0NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV0NP_A::VALUE1 + **self == CEV0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV0NP_A::VALUE2 + **self == CEV0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV0NP_A::VALUE3 + **self == CEV0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV0NP_A::VALUE4 + **self == CEV0NP_A::VALUE4 + } +} +impl core::ops::Deref for CEV0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV0NP`"] +#[doc = "Field `CEV0NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV0NP_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> CEV0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV1NP`"] -pub type CEV1NP_R = crate::R; +#[doc = "Field `CEV1NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV1NP_R(crate::FieldReader); impl CEV1NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV1NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV1NP_A::VALUE1), - 3 => Val(CEV1NP_A::VALUE2), - 4 => Val(CEV1NP_A::VALUE3), - 7 => Val(CEV1NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV1NP_A::VALUE1), + 3 => Some(CEV1NP_A::VALUE2), + 4 => Some(CEV1NP_A::VALUE3), + 7 => Some(CEV1NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV1NP_A::VALUE1 + **self == CEV1NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV1NP_A::VALUE2 + **self == CEV1NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV1NP_A::VALUE3 + **self == CEV1NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV1NP_A::VALUE4 + **self == CEV1NP_A::VALUE4 + } +} +impl core::ops::Deref for CEV1NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV1NP`"] +#[doc = "Field `CEV1NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV1NP_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> CEV1NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -213,43 +255,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV2NP`"] -pub type CEV2NP_R = crate::R; +#[doc = "Field `CEV2NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV2NP_R(crate::FieldReader); impl CEV2NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV2NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV2NP_A::VALUE1), - 3 => Val(CEV2NP_A::VALUE2), - 4 => Val(CEV2NP_A::VALUE3), - 7 => Val(CEV2NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV2NP_A::VALUE1), + 3 => Some(CEV2NP_A::VALUE2), + 4 => Some(CEV2NP_A::VALUE3), + 7 => Some(CEV2NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV2NP_A::VALUE1 + **self == CEV2NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV2NP_A::VALUE2 + **self == CEV2NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV2NP_A::VALUE3 + **self == CEV2NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV2NP_A::VALUE4 + **self == CEV2NP_A::VALUE4 } } -#[doc = "Write proxy for field `CEV2NP`"] +impl core::ops::Deref for CEV2NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV2NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV2NP_W<'a> { w: &'a mut W, } @@ -282,7 +333,7 @@ impl<'a> CEV2NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -305,43 +356,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV3NP`"] -pub type CEV3NP_R = crate::R; +#[doc = "Field `CEV3NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV3NP_R(crate::FieldReader); impl CEV3NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV3NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV3NP_A::VALUE1), - 3 => Val(CEV3NP_A::VALUE2), - 4 => Val(CEV3NP_A::VALUE3), - 7 => Val(CEV3NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV3NP_A::VALUE1), + 3 => Some(CEV3NP_A::VALUE2), + 4 => Some(CEV3NP_A::VALUE3), + 7 => Some(CEV3NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV3NP_A::VALUE1 + **self == CEV3NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV3NP_A::VALUE2 + **self == CEV3NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV3NP_A::VALUE3 + **self == CEV3NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV3NP_A::VALUE4 + **self == CEV3NP_A::VALUE4 } } -#[doc = "Write proxy for field `CEV3NP`"] +impl core::ops::Deref for CEV3NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV3NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV3NP_W<'a> { w: &'a mut W, } @@ -374,7 +434,7 @@ impl<'a> CEV3NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -397,43 +457,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV4NP`"] -pub type CEV4NP_R = crate::R; +#[doc = "Field `CEV4NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV4NP_R(crate::FieldReader); impl CEV4NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV4NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV4NP_A::VALUE1), - 3 => Val(CEV4NP_A::VALUE2), - 4 => Val(CEV4NP_A::VALUE3), - 7 => Val(CEV4NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV4NP_A::VALUE1), + 3 => Some(CEV4NP_A::VALUE2), + 4 => Some(CEV4NP_A::VALUE3), + 7 => Some(CEV4NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV4NP_A::VALUE1 + **self == CEV4NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV4NP_A::VALUE2 + **self == CEV4NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV4NP_A::VALUE3 + **self == CEV4NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV4NP_A::VALUE4 + **self == CEV4NP_A::VALUE4 } } -#[doc = "Write proxy for field `CEV4NP`"] +impl core::ops::Deref for CEV4NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV4NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV4NP_W<'a> { w: &'a mut W, } @@ -466,7 +535,7 @@ impl<'a> CEV4NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -489,43 +558,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV5NP`"] -pub type CEV5NP_R = crate::R; +#[doc = "Field `CEV5NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV5NP_R(crate::FieldReader); impl CEV5NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV5NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV5NP_A::VALUE1), - 3 => Val(CEV5NP_A::VALUE2), - 4 => Val(CEV5NP_A::VALUE3), - 7 => Val(CEV5NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV5NP_A::VALUE1), + 3 => Some(CEV5NP_A::VALUE2), + 4 => Some(CEV5NP_A::VALUE3), + 7 => Some(CEV5NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV5NP_A::VALUE1 + **self == CEV5NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV5NP_A::VALUE2 + **self == CEV5NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV5NP_A::VALUE3 + **self == CEV5NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV5NP_A::VALUE4 + **self == CEV5NP_A::VALUE4 } } -#[doc = "Write proxy for field `CEV5NP`"] +impl core::ops::Deref for CEV5NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CEV5NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV5NP_W<'a> { w: &'a mut W, } @@ -558,7 +636,7 @@ impl<'a> CEV5NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } @@ -581,43 +659,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV6NP`"] -pub type CEV6NP_R = crate::R; +#[doc = "Field `CEV6NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV6NP_R(crate::FieldReader); impl CEV6NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV6NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV6NP_A::VALUE1), - 3 => Val(CEV6NP_A::VALUE2), - 4 => Val(CEV6NP_A::VALUE3), - 7 => Val(CEV6NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV6NP_A::VALUE1), + 3 => Some(CEV6NP_A::VALUE2), + 4 => Some(CEV6NP_A::VALUE3), + 7 => Some(CEV6NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV6NP_A::VALUE1 + **self == CEV6NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV6NP_A::VALUE2 + **self == CEV6NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV6NP_A::VALUE3 + **self == CEV6NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV6NP_A::VALUE4 + **self == CEV6NP_A::VALUE4 + } +} +impl core::ops::Deref for CEV6NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV6NP`"] +#[doc = "Field `CEV6NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV6NP_W<'a> { w: &'a mut W, } @@ -650,7 +737,7 @@ impl<'a> CEV6NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -673,43 +760,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CEV7NP`"] -pub type CEV7NP_R = crate::R; +#[doc = "Field `CEV7NP` reader - Service Request Node Pointer Channel Event i"] +pub struct CEV7NP_R(crate::FieldReader); impl CEV7NP_R { + pub(crate) fn new(bits: u8) -> Self { + CEV7NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CEV7NP_A::VALUE1), - 3 => Val(CEV7NP_A::VALUE2), - 4 => Val(CEV7NP_A::VALUE3), - 7 => Val(CEV7NP_A::VALUE4), - i => Res(i), + 0 => Some(CEV7NP_A::VALUE1), + 3 => Some(CEV7NP_A::VALUE2), + 4 => Some(CEV7NP_A::VALUE3), + 7 => Some(CEV7NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CEV7NP_A::VALUE1 + **self == CEV7NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CEV7NP_A::VALUE2 + **self == CEV7NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CEV7NP_A::VALUE3 + **self == CEV7NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CEV7NP_A::VALUE4 + **self == CEV7NP_A::VALUE4 + } +} +impl core::ops::Deref for CEV7NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CEV7NP`"] +#[doc = "Field `CEV7NP` writer - Service Request Node Pointer Channel Event i"] pub struct CEV7NP_W<'a> { w: &'a mut W, } @@ -742,7 +838,7 @@ impl<'a> CEV7NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -829,4 +925,30 @@ impl W { pub fn cev7np(&mut self) -> CEV7NP_W { CEV7NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Event Node Pointer Register 0\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 [cevnp0](index.html) module"] +pub struct CEVNP0_SPEC; +impl crate::RegisterSpec for CEVNP0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cevnp0::R](R) reader structure"] +impl crate::Readable for CEVNP0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cevnp0::W](W) writer structure"] +impl crate::Writable for CEVNP0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CEVNP0 to value 0"] +impl crate::Resettable for CEVNP0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/chass.rs b/src/vadc_g0/chass.rs index 87188999..36da9c51 100644 --- a/src/vadc_g0/chass.rs +++ b/src/vadc_g0/chass.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register CHASS"] -pub type R = crate::R; -#[doc = "Writer for register CHASS"] -pub type W = crate::W; -#[doc = "Register CHASS `reset()`'s with value 0"] -impl crate::ResetValue for super::CHASS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CHASS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHASS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Assignment for Channel 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH0`"] -pub type ASSCH0_R = crate::R; +#[doc = "Field `ASSCH0` reader - Assignment for Channel 0"] +pub struct ASSCH0_R(crate::FieldReader); impl ASSCH0_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH0_A { @@ -38,15 +65,22 @@ impl ASSCH0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH0_A::VALUE1 + **self == ASSCH0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH0_A::VALUE2 + **self == ASSCH0_A::VALUE2 + } +} +impl core::ops::Deref for ASSCH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASSCH0`"] +#[doc = "Field `ASSCH0` writer - Assignment for Channel 0"] pub struct ASSCH0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> ASSCH0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> ASSCH0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH1`"] -pub type ASSCH1_R = crate::R; +#[doc = "Field `ASSCH1` reader - Assignment for Channel 1"] +pub struct ASSCH1_R(crate::FieldReader); impl ASSCH1_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH1_A { @@ -113,15 +148,22 @@ impl ASSCH1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH1_A::VALUE1 + **self == ASSCH1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH1_A::VALUE2 + **self == ASSCH1_A::VALUE2 } } -#[doc = "Write proxy for field `ASSCH1`"] +impl core::ops::Deref for ASSCH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ASSCH1` writer - Assignment for Channel 1"] pub struct ASSCH1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> ASSCH1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> ASSCH1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH2`"] -pub type ASSCH2_R = crate::R; +#[doc = "Field `ASSCH2` reader - Assignment for Channel 2"] +pub struct ASSCH2_R(crate::FieldReader); impl ASSCH2_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH2_A { @@ -188,15 +231,22 @@ impl ASSCH2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH2_A::VALUE1 + **self == ASSCH2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH2_A::VALUE2 + **self == ASSCH2_A::VALUE2 + } +} +impl core::ops::Deref for ASSCH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASSCH2`"] +#[doc = "Field `ASSCH2` writer - Assignment for Channel 2"] pub struct ASSCH2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> ASSCH2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> ASSCH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH3`"] -pub type ASSCH3_R = crate::R; +#[doc = "Field `ASSCH3` reader - Assignment for Channel 3"] +pub struct ASSCH3_R(crate::FieldReader); impl ASSCH3_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH3_A { @@ -263,15 +314,22 @@ impl ASSCH3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH3_A::VALUE1 + **self == ASSCH3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH3_A::VALUE2 + **self == ASSCH3_A::VALUE2 } } -#[doc = "Write proxy for field `ASSCH3`"] +impl core::ops::Deref for ASSCH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ASSCH3` writer - Assignment for Channel 3"] pub struct ASSCH3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> ASSCH3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> ASSCH3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH4`"] -pub type ASSCH4_R = crate::R; +#[doc = "Field `ASSCH4` reader - Assignment for Channel 4"] +pub struct ASSCH4_R(crate::FieldReader); impl ASSCH4_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH4_A { @@ -338,15 +397,22 @@ impl ASSCH4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH4_A::VALUE1 + **self == ASSCH4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH4_A::VALUE2 + **self == ASSCH4_A::VALUE2 + } +} +impl core::ops::Deref for ASSCH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASSCH4`"] +#[doc = "Field `ASSCH4` writer - Assignment for Channel 4"] pub struct ASSCH4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> ASSCH4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> ASSCH4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH5`"] -pub type ASSCH5_R = crate::R; +#[doc = "Field `ASSCH5` reader - Assignment for Channel 5"] +pub struct ASSCH5_R(crate::FieldReader); impl ASSCH5_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH5_A { @@ -413,15 +480,22 @@ impl ASSCH5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH5_A::VALUE1 + **self == ASSCH5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH5_A::VALUE2 + **self == ASSCH5_A::VALUE2 } } -#[doc = "Write proxy for field `ASSCH5`"] +impl core::ops::Deref for ASSCH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ASSCH5` writer - Assignment for Channel 5"] pub struct ASSCH5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> ASSCH5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> ASSCH5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH6`"] -pub type ASSCH6_R = crate::R; +#[doc = "Field `ASSCH6` reader - Assignment for Channel 6"] +pub struct ASSCH6_R(crate::FieldReader); impl ASSCH6_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH6_A { @@ -488,15 +563,22 @@ impl ASSCH6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH6_A::VALUE1 + **self == ASSCH6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH6_A::VALUE2 + **self == ASSCH6_A::VALUE2 + } +} +impl core::ops::Deref for ASSCH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASSCH6`"] +#[doc = "Field `ASSCH6` writer - Assignment for Channel 6"] pub struct ASSCH6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> ASSCH6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> ASSCH6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ASSCH7`"] -pub type ASSCH7_R = crate::R; +#[doc = "Field `ASSCH7` reader - Assignment for Channel 7"] +pub struct ASSCH7_R(crate::FieldReader); impl ASSCH7_R { + pub(crate) fn new(bits: bool) -> Self { + ASSCH7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ASSCH7_A { @@ -563,15 +646,22 @@ impl ASSCH7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ASSCH7_A::VALUE1 + **self == ASSCH7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ASSCH7_A::VALUE2 + **self == ASSCH7_A::VALUE2 + } +} +impl core::ops::Deref for ASSCH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ASSCH7`"] +#[doc = "Field `ASSCH7` writer - Assignment for Channel 7"] pub struct ASSCH7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> ASSCH7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSCH7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> ASSCH7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -693,4 +781,30 @@ impl W { pub fn assch7(&mut self) -> ASSCH7_W { ASSCH7_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Assignment Register\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 [chass](index.html) module"] +pub struct CHASS_SPEC; +impl crate::RegisterSpec for CHASS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chass::R](R) reader structure"] +impl crate::Readable for CHASS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chass::W](W) writer structure"] +impl crate::Writable for CHASS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHASS to value 0"] +impl crate::Resettable for CHASS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/chctr.rs b/src/vadc_g0/chctr.rs index e2b18956..412f5046 100644 --- a/src/vadc_g0/chctr.rs +++ b/src/vadc_g0/chctr.rs @@ -1,14 +1,37 @@ -#[doc = "Reader of register CHCTR[%s]"] -pub type R = crate::R; -#[doc = "Writer for register CHCTR[%s]"] -pub type W = crate::W; -#[doc = "Register CHCTR[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::CHCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CHCTR[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHCTR[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Input Class Select\n\nValue on reset: 0"] @@ -30,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ICLSEL`"] -pub type ICLSEL_R = crate::R; +#[doc = "Field `ICLSEL` reader - Input Class Select"] +pub struct ICLSEL_R(crate::FieldReader); impl ICLSEL_R { + pub(crate) fn new(bits: u8) -> Self { + ICLSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ICLSEL_A { @@ -47,25 +73,32 @@ impl ICLSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ICLSEL_A::VALUE1 + **self == ICLSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ICLSEL_A::VALUE2 + **self == ICLSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ICLSEL_A::VALUE3 + **self == ICLSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ICLSEL_A::VALUE4 + **self == ICLSEL_A::VALUE4 } } -#[doc = "Write proxy for field `ICLSEL`"] +impl core::ops::Deref for ICLSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ICLSEL` writer - Input Class Select"] pub struct ICLSEL_W<'a> { w: &'a mut W, } @@ -73,9 +106,7 @@ impl<'a> ICLSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ICLSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Use group-specific class 0"] #[inline(always)] @@ -100,7 +131,7 @@ impl<'a> ICLSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -123,9 +154,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BNDSELL`"] -pub type BNDSELL_R = crate::R; +#[doc = "Field `BNDSELL` reader - Lower Boundary Select"] +pub struct BNDSELL_R(crate::FieldReader); impl BNDSELL_R { + pub(crate) fn new(bits: u8) -> Self { + BNDSELL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BNDSELL_A { @@ -140,25 +174,32 @@ impl BNDSELL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BNDSELL_A::VALUE1 + **self == BNDSELL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BNDSELL_A::VALUE2 + **self == BNDSELL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BNDSELL_A::VALUE3 + **self == BNDSELL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BNDSELL_A::VALUE4 + **self == BNDSELL_A::VALUE4 } } -#[doc = "Write proxy for field `BNDSELL`"] +impl core::ops::Deref for BNDSELL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNDSELL` writer - Lower Boundary Select"] pub struct BNDSELL_W<'a> { w: &'a mut W, } @@ -166,9 +207,7 @@ impl<'a> BNDSELL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BNDSELL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Use group-specific boundary 0"] #[inline(always)] @@ -193,7 +232,7 @@ impl<'a> BNDSELL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); self.w } } @@ -216,9 +255,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BNDSELU`"] -pub type BNDSELU_R = crate::R; +#[doc = "Field `BNDSELU` reader - Upper Boundary Select"] +pub struct BNDSELU_R(crate::FieldReader); impl BNDSELU_R { + pub(crate) fn new(bits: u8) -> Self { + BNDSELU_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BNDSELU_A { @@ -233,25 +275,32 @@ impl BNDSELU_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BNDSELU_A::VALUE1 + **self == BNDSELU_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BNDSELU_A::VALUE2 + **self == BNDSELU_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == BNDSELU_A::VALUE3 + **self == BNDSELU_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == BNDSELU_A::VALUE4 + **self == BNDSELU_A::VALUE4 } } -#[doc = "Write proxy for field `BNDSELU`"] +impl core::ops::Deref for BNDSELU_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BNDSELU` writer - Upper Boundary Select"] pub struct BNDSELU_W<'a> { w: &'a mut W, } @@ -259,9 +308,7 @@ impl<'a> BNDSELU_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BNDSELU_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Use group-specific boundary 0"] #[inline(always)] @@ -286,7 +333,7 @@ impl<'a> BNDSELU_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); self.w } } @@ -309,9 +356,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CHEVMODE`"] -pub type CHEVMODE_R = crate::R; +#[doc = "Field `CHEVMODE` reader - Channel Event Mode"] +pub struct CHEVMODE_R(crate::FieldReader); impl CHEVMODE_R { + pub(crate) fn new(bits: u8) -> Self { + CHEVMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> CHEVMODE_A { @@ -326,25 +376,32 @@ impl CHEVMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CHEVMODE_A::VALUE1 + **self == CHEVMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CHEVMODE_A::VALUE2 + **self == CHEVMODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CHEVMODE_A::VALUE3 + **self == CHEVMODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == CHEVMODE_A::VALUE4 + **self == CHEVMODE_A::VALUE4 } } -#[doc = "Write proxy for field `CHEVMODE`"] +impl core::ops::Deref for CHEVMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHEVMODE` writer - Channel Event Mode"] pub struct CHEVMODE_W<'a> { w: &'a mut W, } @@ -352,9 +409,7 @@ impl<'a> CHEVMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CHEVMODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Never"] #[inline(always)] @@ -379,7 +434,7 @@ impl<'a> CHEVMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); self.w } } @@ -397,9 +452,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SYNC`"] -pub type SYNC_R = crate::R; +#[doc = "Field `SYNC` reader - Synchronization Request"] +pub struct SYNC_R(crate::FieldReader); impl SYNC_R { + pub(crate) fn new(bits: bool) -> Self { + SYNC_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNC_A { @@ -411,15 +469,22 @@ impl SYNC_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SYNC_A::VALUE1 + **self == SYNC_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SYNC_A::VALUE2 + **self == SYNC_A::VALUE2 + } +} +impl core::ops::Deref for SYNC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SYNC`"] +#[doc = "Field `SYNC` writer - Synchronization Request"] pub struct SYNC_W<'a> { w: &'a mut W, } @@ -427,9 +492,7 @@ impl<'a> SYNC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNC_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No synchroniz. request, standalone operation"] #[inline(always)] @@ -454,7 +517,7 @@ impl<'a> SYNC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -472,9 +535,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REFSEL`"] -pub type REFSEL_R = crate::R; +#[doc = "Field `REFSEL` reader - Reference Input Selection"] +pub struct REFSEL_R(crate::FieldReader); impl REFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + REFSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REFSEL_A { @@ -486,15 +552,22 @@ impl REFSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REFSEL_A::VALUE1 + **self == REFSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REFSEL_A::VALUE2 + **self == REFSEL_A::VALUE2 + } +} +impl core::ops::Deref for REFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REFSEL`"] +#[doc = "Field `REFSEL` writer - Reference Input Selection"] pub struct REFSEL_W<'a> { w: &'a mut W, } @@ -502,9 +575,7 @@ impl<'a> REFSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REFSEL_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Standard reference input VAREF"] #[inline(always)] @@ -529,7 +600,7 @@ impl<'a> REFSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -548,31 +619,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `RESREG`"] -pub type RESREG_R = crate::R; +#[doc = "Field `RESREG` reader - Result Register"] +pub struct RESREG_R(crate::FieldReader); impl RESREG_R { + pub(crate) fn new(bits: u8) -> Self { + RESREG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(RESREG_A::VALUE1), - 15 => Val(RESREG_A::VALUE2), - i => Res(i), + 0 => Some(RESREG_A::VALUE1), + 15 => Some(RESREG_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RESREG_A::VALUE1 + **self == RESREG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RESREG_A::VALUE2 + **self == RESREG_A::VALUE2 + } +} +impl core::ops::Deref for RESREG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RESREG`"] +#[doc = "Field `RESREG` writer - Result Register"] pub struct RESREG_W<'a> { w: &'a mut W, } @@ -595,7 +675,7 @@ impl<'a> RESREG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -613,9 +693,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RESTBS`"] -pub type RESTBS_R = crate::R; +#[doc = "Field `RESTBS` reader - Result Target for Background Source"] +pub struct RESTBS_R(crate::FieldReader); impl RESTBS_R { + pub(crate) fn new(bits: bool) -> Self { + RESTBS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RESTBS_A { @@ -627,15 +710,22 @@ impl RESTBS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RESTBS_A::VALUE1 + **self == RESTBS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RESTBS_A::VALUE2 + **self == RESTBS_A::VALUE2 } } -#[doc = "Write proxy for field `RESTBS`"] +impl core::ops::Deref for RESTBS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESTBS` writer - Result Target for Background Source"] pub struct RESTBS_W<'a> { w: &'a mut W, } @@ -643,9 +733,7 @@ impl<'a> RESTBS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RESTBS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Store results in the selected group result register"] #[inline(always)] @@ -670,7 +758,7 @@ impl<'a> RESTBS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20); + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); self.w } } @@ -688,9 +776,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RESPOS`"] -pub type RESPOS_R = crate::R; +#[doc = "Field `RESPOS` reader - Result Position"] +pub struct RESPOS_R(crate::FieldReader); impl RESPOS_R { + pub(crate) fn new(bits: bool) -> Self { + RESPOS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RESPOS_A { @@ -702,15 +793,22 @@ impl RESPOS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RESPOS_A::VALUE1 + **self == RESPOS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RESPOS_A::VALUE2 + **self == RESPOS_A::VALUE2 + } +} +impl core::ops::Deref for RESPOS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RESPOS`"] +#[doc = "Field `RESPOS` writer - Result Position"] pub struct RESPOS_W<'a> { w: &'a mut W, } @@ -718,9 +816,7 @@ impl<'a> RESPOS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RESPOS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Store results left-aligned"] #[inline(always)] @@ -745,7 +841,7 @@ impl<'a> RESPOS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21); + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); self.w } } @@ -764,31 +860,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `BWDCH`"] -pub type BWDCH_R = crate::R; +#[doc = "Field `BWDCH` reader - Broken Wire Detection Channel"] +pub struct BWDCH_R(crate::FieldReader); impl BWDCH_R { + pub(crate) fn new(bits: u8) -> Self { + BWDCH_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(BWDCH_A::VALUE1), - 1 => Val(BWDCH_A::VALUE2), - i => Res(i), + 0 => Some(BWDCH_A::VALUE1), + 1 => Some(BWDCH_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWDCH_A::VALUE1 + **self == BWDCH_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWDCH_A::VALUE2 + **self == BWDCH_A::VALUE2 + } +} +impl core::ops::Deref for BWDCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `BWDCH`"] +#[doc = "Field `BWDCH` writer - Broken Wire Detection Channel"] pub struct BWDCH_W<'a> { w: &'a mut W, } @@ -811,7 +916,7 @@ impl<'a> BWDCH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28); + self.w.bits = (self.w.bits & !(0x03 << 28)) | ((value as u32 & 0x03) << 28); self.w } } @@ -829,9 +934,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `BWDEN`"] -pub type BWDEN_R = crate::R; +#[doc = "Field `BWDEN` reader - Broken Wire Detection Enable"] +pub struct BWDEN_R(crate::FieldReader); impl BWDEN_R { + pub(crate) fn new(bits: bool) -> Self { + BWDEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BWDEN_A { @@ -843,15 +951,22 @@ impl BWDEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == BWDEN_A::VALUE1 + **self == BWDEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == BWDEN_A::VALUE2 + **self == BWDEN_A::VALUE2 } } -#[doc = "Write proxy for field `BWDEN`"] +impl core::ops::Deref for BWDEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BWDEN` writer - Broken Wire Detection Enable"] pub struct BWDEN_W<'a> { w: &'a mut W, } @@ -859,9 +974,7 @@ impl<'a> BWDEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BWDEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Normal operation"] #[inline(always)] @@ -886,7 +999,7 @@ impl<'a> BWDEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); self.w } } @@ -1003,4 +1116,31 @@ impl W { pub fn bwden(&mut self) -> BWDEN_W { BWDEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel Ctrl. Reg.\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 [chctr](index.html) module"] +pub struct CHCTR_SPEC; +impl crate::RegisterSpec for CHCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chctr::R](R) reader structure"] +impl crate::Readable for CHCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chctr::W](W) writer structure"] +impl crate::Writable for CHCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHCTR[%s] +to value 0"] +impl crate::Resettable for CHCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/emuxctr.rs b/src/vadc_g0/emuxctr.rs index e7e66c2f..66bea0f4 100644 --- a/src/vadc_g0/emuxctr.rs +++ b/src/vadc_g0/emuxctr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register EMUXCTR"] -pub type R = crate::R; -#[doc = "Writer for register EMUXCTR"] -pub type W = crate::W; -#[doc = "Register EMUXCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::EMUXCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `EMUXCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EMUXCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Reader of field `EMUXSET`"] -pub type EMUXSET_R = crate::R; -#[doc = "Write proxy for field `EMUXSET`"] +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `EMUXSET` reader - External Multiplexer Start Selection"] +pub struct EMUXSET_R(crate::FieldReader); +impl EMUXSET_R { + pub(crate) fn new(bits: u8) -> Self { + EMUXSET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUXSET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUXSET` writer - External Multiplexer Start Selection"] pub struct EMUXSET_W<'a> { w: &'a mut W, } @@ -20,15 +56,39 @@ impl<'a> EMUXSET_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07); + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); self.w } } -#[doc = "Reader of field `EMUXACT`"] -pub type EMUXACT_R = crate::R; -#[doc = "Reader of field `EMUXCH`"] -pub type EMUXCH_R = crate::R; -#[doc = "Write proxy for field `EMUXCH`"] +#[doc = "Field `EMUXACT` reader - External Multiplexer Actual Selection"] +pub struct EMUXACT_R(crate::FieldReader); +impl EMUXACT_R { + pub(crate) fn new(bits: u8) -> Self { + EMUXACT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUXACT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUXCH` reader - External Multiplexer Channel Select"] +pub struct EMUXCH_R(crate::FieldReader); +impl EMUXCH_R { + pub(crate) fn new(bits: u16) -> Self { + EMUXCH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUXCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUXCH` writer - External Multiplexer Channel Select"] pub struct EMUXCH_W<'a> { w: &'a mut W, } @@ -36,7 +96,7 @@ impl<'a> EMUXCH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03ff << 16)) | (((value as u32) & 0x03ff) << 16); + self.w.bits = (self.w.bits & !(0x03ff << 16)) | ((value as u32 & 0x03ff) << 16); self.w } } @@ -59,9 +119,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `EMUXMODE`"] -pub type EMUXMODE_R = crate::R; +#[doc = "Field `EMUXMODE` reader - External Multiplexer Mode"] +pub struct EMUXMODE_R(crate::FieldReader); impl EMUXMODE_R { + pub(crate) fn new(bits: u8) -> Self { + EMUXMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMUXMODE_A { @@ -76,25 +139,32 @@ impl EMUXMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMUXMODE_A::VALUE1 + **self == EMUXMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMUXMODE_A::VALUE2 + **self == EMUXMODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == EMUXMODE_A::VALUE3 + **self == EMUXMODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == EMUXMODE_A::VALUE4 + **self == EMUXMODE_A::VALUE4 + } +} +impl core::ops::Deref for EMUXMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EMUXMODE`"] +#[doc = "Field `EMUXMODE` writer - External Multiplexer Mode"] pub struct EMUXMODE_W<'a> { w: &'a mut W, } @@ -102,9 +172,7 @@ impl<'a> EMUXMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMUXMODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Software control (no hardware action)"] #[inline(always)] @@ -129,7 +197,7 @@ impl<'a> EMUXMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26); + self.w.bits = (self.w.bits & !(0x03 << 26)) | ((value as u32 & 0x03) << 26); self.w } } @@ -147,9 +215,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMXCOD`"] -pub type EMXCOD_R = crate::R; +#[doc = "Field `EMXCOD` reader - External Multiplexer Coding Scheme"] +pub struct EMXCOD_R(crate::FieldReader); impl EMXCOD_R { + pub(crate) fn new(bits: bool) -> Self { + EMXCOD_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMXCOD_A { @@ -161,15 +232,22 @@ impl EMXCOD_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMXCOD_A::VALUE1 + **self == EMXCOD_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMXCOD_A::VALUE2 + **self == EMXCOD_A::VALUE2 } } -#[doc = "Write proxy for field `EMXCOD`"] +impl core::ops::Deref for EMXCOD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMXCOD` writer - External Multiplexer Coding Scheme"] pub struct EMXCOD_W<'a> { w: &'a mut W, } @@ -177,9 +255,7 @@ impl<'a> EMXCOD_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMXCOD_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Output the channel number in binary code"] #[inline(always)] @@ -204,7 +280,7 @@ impl<'a> EMXCOD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -222,9 +298,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMXST`"] -pub type EMXST_R = crate::R; +#[doc = "Field `EMXST` reader - External Multiplexer Sample Time Control"] +pub struct EMXST_R(crate::FieldReader); impl EMXST_R { + pub(crate) fn new(bits: bool) -> Self { + EMXST_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMXST_A { @@ -236,15 +315,22 @@ impl EMXST_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMXST_A::VALUE1 + **self == EMXST_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMXST_A::VALUE2 + **self == EMXST_A::VALUE2 } } -#[doc = "Write proxy for field `EMXST`"] +impl core::ops::Deref for EMXST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMXST` writer - External Multiplexer Sample Time Control"] pub struct EMXST_W<'a> { w: &'a mut W, } @@ -252,9 +338,7 @@ impl<'a> EMXST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMXST_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Use STCE whenever the setting changes"] #[inline(always)] @@ -279,7 +363,7 @@ impl<'a> EMXST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29); + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); self.w } } @@ -297,9 +381,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMXCSS`"] -pub type EMXCSS_R = crate::R; +#[doc = "Field `EMXCSS` reader - External Multiplexer Channel Selection Style"] +pub struct EMXCSS_R(crate::FieldReader); impl EMXCSS_R { + pub(crate) fn new(bits: bool) -> Self { + EMXCSS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMXCSS_A { @@ -311,12 +398,19 @@ impl EMXCSS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMXCSS_A::VALUE1 + **self == EMXCSS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMXCSS_A::VALUE2 + **self == EMXCSS_A::VALUE2 + } +} +impl core::ops::Deref for EMXCSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Write Control for EMUX Configuration\n\nValue on reset: 0"] @@ -333,7 +427,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `EMXWC`"] +#[doc = "Field `EMXWC` writer - Write Control for EMUX Configuration"] pub struct EMXWC_W<'a> { w: &'a mut W, } @@ -341,9 +435,7 @@ impl<'a> EMXWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EMXWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to EMUX cfg."] #[inline(always)] @@ -368,7 +460,7 @@ impl<'a> EMXWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -440,4 +532,30 @@ impl W { pub fn emxwc(&mut self) -> EMXWC_W { EMXWC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External Multiplexer Control Register\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 [emuxctr](index.html) module"] +pub struct EMUXCTR_SPEC; +impl crate::RegisterSpec for EMUXCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [emuxctr::R](R) reader structure"] +impl crate::Readable for EMUXCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [emuxctr::W](W) writer structure"] +impl crate::Writable for EMUXCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EMUXCTR to value 0"] +impl crate::Resettable for EMUXCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/iclass.rs b/src/vadc_g0/iclass.rs index d6d0745f..8e7ab14d 100644 --- a/src/vadc_g0/iclass.rs +++ b/src/vadc_g0/iclass.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register ICLASS[%s]"] -pub type R = crate::R; -#[doc = "Writer for register ICLASS[%s]"] -pub type W = crate::W; -#[doc = "Register ICLASS[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::ICLASS { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `ICLASS[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ICLASS[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `STCS`"] -pub type STCS_R = crate::R; -#[doc = "Write proxy for field `STCS`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `STCS` reader - Sample Time Control for Standard Conversions"] +pub struct STCS_R(crate::FieldReader); +impl STCS_R { + pub(crate) fn new(bits: u8) -> Self { + STCS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STCS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STCS` writer - Sample Time Control for Standard Conversions"] pub struct STCS_W<'a> { w: &'a mut W, } @@ -21,7 +56,7 @@ impl<'a> STCS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } @@ -44,43 +79,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CMS`"] -pub type CMS_R = crate::R; +#[doc = "Field `CMS` reader - Conversion Mode for Standard Conversions"] +pub struct CMS_R(crate::FieldReader); impl CMS_R { + pub(crate) fn new(bits: u8) -> Self { + CMS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CMS_A::VALUE1), - 1 => Val(CMS_A::VALUE2), - 2 => Val(CMS_A::VALUE3), - 5 => Val(CMS_A::VALUE6), - i => Res(i), + 0 => Some(CMS_A::VALUE1), + 1 => Some(CMS_A::VALUE2), + 2 => Some(CMS_A::VALUE3), + 5 => Some(CMS_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CMS_A::VALUE1 + **self == CMS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CMS_A::VALUE2 + **self == CMS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CMS_A::VALUE3 + **self == CMS_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == CMS_A::VALUE6 + **self == CMS_A::VALUE6 } } -#[doc = "Write proxy for field `CMS`"] +impl core::ops::Deref for CMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMS` writer - Conversion Mode for Standard Conversions"] pub struct CMS_W<'a> { w: &'a mut W, } @@ -113,13 +157,25 @@ impl<'a> CMS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8); + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); self.w } } -#[doc = "Reader of field `STCE`"] -pub type STCE_R = crate::R; -#[doc = "Write proxy for field `STCE`"] +#[doc = "Field `STCE` reader - Sample Time Control for EMUX Conversions"] +pub struct STCE_R(crate::FieldReader); +impl STCE_R { + pub(crate) fn new(bits: u8) -> Self { + STCE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STCE` writer - Sample Time Control for EMUX Conversions"] pub struct STCE_W<'a> { w: &'a mut W, } @@ -127,7 +183,7 @@ impl<'a> STCE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); + self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16); self.w } } @@ -150,43 +206,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CME`"] -pub type CME_R = crate::R; +#[doc = "Field `CME` reader - Conversion Mode for EMUX Conversions"] +pub struct CME_R(crate::FieldReader); impl CME_R { + pub(crate) fn new(bits: u8) -> Self { + CME_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CME_A::VALUE1), - 1 => Val(CME_A::VALUE2), - 2 => Val(CME_A::VALUE3), - 5 => Val(CME_A::VALUE6), - i => Res(i), + 0 => Some(CME_A::VALUE1), + 1 => Some(CME_A::VALUE2), + 2 => Some(CME_A::VALUE3), + 5 => Some(CME_A::VALUE6), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CME_A::VALUE1 + **self == CME_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CME_A::VALUE2 + **self == CME_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CME_A::VALUE3 + **self == CME_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE6`"] #[inline(always)] pub fn is_value6(&self) -> bool { - *self == CME_A::VALUE6 + **self == CME_A::VALUE6 + } +} +impl core::ops::Deref for CME_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `CME`"] +#[doc = "Field `CME` writer - Conversion Mode for EMUX Conversions"] pub struct CME_W<'a> { w: &'a mut W, } @@ -219,7 +284,7 @@ impl<'a> CME_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24); + self.w.bits = (self.w.bits & !(0x07 << 24)) | ((value as u32 & 0x07) << 24); self.w } } @@ -266,4 +331,31 @@ impl W { pub fn cme(&mut self) -> CME_W { CME_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input Class Register\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 [iclass](index.html) module"] +pub struct ICLASS_SPEC; +impl crate::RegisterSpec for ICLASS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [iclass::R](R) reader structure"] +impl crate::Readable for ICLASS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [iclass::W](W) writer structure"] +impl crate::Writable for ICLASS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ICLASS[%s] +to value 0"] +impl crate::Resettable for ICLASS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/q0r0.rs b/src/vadc_g0/q0r0.rs index e67e346c..a091827b 100644 --- a/src/vadc_g0/q0r0.rs +++ b/src/vadc_g0/q0r0.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register Q0R0"] -pub type R = crate::R; -#[doc = "Reader of field `REQCHNR`"] -pub type REQCHNR_R = crate::R; +#[doc = "Register `Q0R0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `REQCHNR` reader - Request Channel Number"] +pub struct REQCHNR_R(crate::FieldReader); +impl REQCHNR_R { + pub(crate) fn new(bits: u8) -> Self { + REQCHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REQCHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Refill\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RF_A { @@ -16,9 +41,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RF`"] -pub type RF_R = crate::R; +#[doc = "Field `RF` reader - Refill"] +pub struct RF_R(crate::FieldReader); impl RF_R { + pub(crate) fn new(bits: bool) -> Self { + RF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RF_A { @@ -30,12 +58,19 @@ impl RF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RF_A::VALUE1 + **self == RF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RF_A::VALUE2 + **self == RF_A::VALUE2 + } +} +impl core::ops::Deref for RF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Enable Source Interrupt\n\nValue on reset: 0"] @@ -52,9 +87,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENSI`"] -pub type ENSI_R = crate::R; +#[doc = "Field `ENSI` reader - Enable Source Interrupt"] +pub struct ENSI_R(crate::FieldReader); impl ENSI_R { + pub(crate) fn new(bits: bool) -> Self { + ENSI_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENSI_A { @@ -66,12 +104,19 @@ impl ENSI_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENSI_A::VALUE1 + **self == ENSI_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENSI_A::VALUE2 + **self == ENSI_A::VALUE2 + } +} +impl core::ops::Deref for ENSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "External Trigger\n\nValue on reset: 0"] @@ -88,9 +133,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EXTR`"] -pub type EXTR_R = crate::R; +#[doc = "Field `EXTR` reader - External Trigger"] +pub struct EXTR_R(crate::FieldReader); impl EXTR_R { + pub(crate) fn new(bits: bool) -> Self { + EXTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EXTR_A { @@ -102,12 +150,19 @@ impl EXTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EXTR_A::VALUE1 + **self == EXTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EXTR_A::VALUE2 + **self == EXTR_A::VALUE2 + } +} +impl core::ops::Deref for EXTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Request Channel Number Valid\n\nValue on reset: 0"] @@ -124,9 +179,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `V`"] -pub type V_R = crate::R; +#[doc = "Field `V` reader - Request Channel Number Valid"] +pub struct V_R(crate::FieldReader); impl V_R { + pub(crate) fn new(bits: bool) -> Self { + V_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> V_A { @@ -138,12 +196,19 @@ impl V_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == V_A::VALUE1 + **self == V_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == V_A::VALUE2 + **self == V_A::VALUE2 + } +} +impl core::ops::Deref for V_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -173,3 +238,19 @@ impl R { V_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Queue 0 Register 0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [q0r0](index.html) module"] +pub struct Q0R0_SPEC; +impl crate::RegisterSpec for Q0R0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [q0r0::R](R) reader structure"] +impl crate::Readable for Q0R0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets Q0R0 to value 0"] +impl crate::Resettable for Q0R0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/vadc_g0/qbur0.rs b/src/vadc_g0/qbur0.rs index 97e4c1c4..6aa2ad43 100644 --- a/src/vadc_g0/qbur0.rs +++ b/src/vadc_g0/qbur0.rs @@ -1,13 +1,74 @@ -#[doc = "Reader of register QBUR0"] -pub type R = crate::R; -#[doc = "Reader of field `REQCHNR`"] -pub type REQCHNR_R = crate::R; -#[doc = "Reader of field `RF`"] -pub type RF_R = crate::R; -#[doc = "Reader of field `ENSI`"] -pub type ENSI_R = crate::R; -#[doc = "Reader of field `EXTR`"] -pub type EXTR_R = crate::R; +#[doc = "Register `QBUR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `REQCHNR` reader - Request Channel Number"] +pub struct REQCHNR_R(crate::FieldReader); +impl REQCHNR_R { + pub(crate) fn new(bits: u8) -> Self { + REQCHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REQCHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RF` reader - Refill"] +pub struct RF_R(crate::FieldReader); +impl RF_R { + pub(crate) fn new(bits: bool) -> Self { + RF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENSI` reader - Enable Source Interrupt"] +pub struct ENSI_R(crate::FieldReader); +impl ENSI_R { + pub(crate) fn new(bits: bool) -> Self { + ENSI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXTR` reader - External Trigger"] +pub struct EXTR_R(crate::FieldReader); +impl EXTR_R { + pub(crate) fn new(bits: bool) -> Self { + EXTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EXTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Request Channel Number Valid\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum V_A { @@ -22,9 +83,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `V`"] -pub type V_R = crate::R; +#[doc = "Field `V` reader - Request Channel Number Valid"] +pub struct V_R(crate::FieldReader); impl V_R { + pub(crate) fn new(bits: bool) -> Self { + V_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> V_A { @@ -36,12 +100,19 @@ impl V_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == V_A::VALUE1 + **self == V_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == V_A::VALUE2 + **self == V_A::VALUE2 + } +} +impl core::ops::Deref for V_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -71,3 +142,19 @@ impl R { V_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Queue 0 Backup Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qbur0](index.html) module"] +pub struct QBUR0_SPEC; +impl crate::RegisterSpec for QBUR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [qbur0::R](R) reader structure"] +impl crate::Readable for QBUR0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets QBUR0 to value 0"] +impl crate::Resettable for QBUR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/vadc_g0/qctrl0.rs b/src/vadc_g0/qctrl0.rs index 5d6f47c5..575c815a 100644 --- a/src/vadc_g0/qctrl0.rs +++ b/src/vadc_g0/qctrl0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register QCTRL0"] -pub type R = crate::R; -#[doc = "Writer for register QCTRL0"] -pub type W = crate::W; -#[doc = "Register QCTRL0 `reset()`'s with value 0"] -impl crate::ResetValue for super::QCTRL0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `QCTRL0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `QCTRL0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source-specific Result Register\n\nValue on reset: 0"] @@ -27,37 +51,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SRCRESREG`"] -pub type SRCRESREG_R = crate::R; +#[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] +pub struct SRCRESREG_R(crate::FieldReader); impl SRCRESREG_R { + pub(crate) fn new(bits: u8) -> Self { + SRCRESREG_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SRCRESREG_A::VALUE1), - 1 => Val(SRCRESREG_A::VALUE2), - 15 => Val(SRCRESREG_A::VALUE3), - i => Res(i), + 0 => Some(SRCRESREG_A::VALUE1), + 1 => Some(SRCRESREG_A::VALUE2), + 15 => Some(SRCRESREG_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRCRESREG_A::VALUE1 + **self == SRCRESREG_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRCRESREG_A::VALUE2 + **self == SRCRESREG_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SRCRESREG_A::VALUE3 + **self == SRCRESREG_A::VALUE3 } } -#[doc = "Write proxy for field `SRCRESREG`"] +impl core::ops::Deref for SRCRESREG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] pub struct SRCRESREG_W<'a> { w: &'a mut W, } @@ -85,13 +118,25 @@ impl<'a> SRCRESREG_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } -#[doc = "Reader of field `XTSEL`"] -pub type XTSEL_R = crate::R; -#[doc = "Write proxy for field `XTSEL`"] +#[doc = "Field `XTSEL` reader - External Trigger Input Selection"] +pub struct XTSEL_R(crate::FieldReader); +impl XTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + XTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `XTSEL` writer - External Trigger Input Selection"] pub struct XTSEL_W<'a> { w: &'a mut W, } @@ -99,12 +144,24 @@ impl<'a> XTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } -#[doc = "Reader of field `XTLVL`"] -pub type XTLVL_R = crate::R; +#[doc = "Field `XTLVL` reader - External Trigger Level"] +pub struct XTLVL_R(crate::FieldReader); +impl XTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + XTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for XTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -124,9 +181,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `XTMODE`"] -pub type XTMODE_R = crate::R; +#[doc = "Field `XTMODE` reader - Trigger Operating Mode"] +pub struct XTMODE_R(crate::FieldReader); impl XTMODE_R { + pub(crate) fn new(bits: u8) -> Self { + XTMODE_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> XTMODE_A { @@ -141,25 +201,32 @@ impl XTMODE_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == XTMODE_A::VALUE1 + **self == XTMODE_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == XTMODE_A::VALUE2 + **self == XTMODE_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == XTMODE_A::VALUE3 + **self == XTMODE_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == XTMODE_A::VALUE4 + **self == XTMODE_A::VALUE4 + } +} +impl core::ops::Deref for XTMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `XTMODE`"] +#[doc = "Field `XTMODE` writer - Trigger Operating Mode"] pub struct XTMODE_W<'a> { w: &'a mut W, } @@ -167,9 +234,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTMODE_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No external trigger"] #[inline(always)] @@ -194,7 +259,7 @@ impl<'a> XTMODE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 13)) | (((value as u32) & 0x03) << 13); + self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13); self.w } } @@ -212,7 +277,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `XTWC`"] +#[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] pub struct XTWC_W<'a> { w: &'a mut W, } @@ -220,9 +285,7 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: XTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to trigger configuration"] #[inline(always)] @@ -247,13 +310,25 @@ impl<'a> XTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } -#[doc = "Reader of field `GTSEL`"] -pub type GTSEL_R = crate::R; -#[doc = "Write proxy for field `GTSEL`"] +#[doc = "Field `GTSEL` reader - Gate Input Selection"] +pub struct GTSEL_R(crate::FieldReader); +impl GTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + GTSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GTSEL` writer - Gate Input Selection"] pub struct GTSEL_W<'a> { w: &'a mut W, } @@ -261,12 +336,24 @@ impl<'a> GTSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } -#[doc = "Reader of field `GTLVL`"] -pub type GTLVL_R = crate::R; +#[doc = "Field `GTLVL` reader - Gate Input Level"] +pub struct GTLVL_R(crate::FieldReader); +impl GTLVL_R { + pub(crate) fn new(bits: bool) -> Self { + GTLVL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GTLVL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum GTWC_AW { @@ -281,7 +368,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `GTWC`"] +#[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] pub struct GTWC_W<'a> { w: &'a mut W, } @@ -289,9 +376,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: GTWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to gate configuration"] #[inline(always)] @@ -316,7 +401,7 @@ impl<'a> GTWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); self.w } } @@ -334,9 +419,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `TMEN`"] -pub type TMEN_R = crate::R; +#[doc = "Field `TMEN` reader - Timer Mode Enable"] +pub struct TMEN_R(crate::FieldReader); impl TMEN_R { + pub(crate) fn new(bits: bool) -> Self { + TMEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TMEN_A { @@ -348,15 +436,22 @@ impl TMEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == TMEN_A::VALUE1 + **self == TMEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == TMEN_A::VALUE2 + **self == TMEN_A::VALUE2 + } +} +impl core::ops::Deref for TMEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `TMEN`"] +#[doc = "Field `TMEN` writer - Timer Mode Enable"] pub struct TMEN_W<'a> { w: &'a mut W, } @@ -364,9 +459,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TMEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] @@ -391,7 +484,7 @@ impl<'a> TMEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28); + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); self.w } } @@ -409,7 +502,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TMWC`"] +#[doc = "Field `TMWC` writer - Write Control for Timer Mode"] pub struct TMWC_W<'a> { w: &'a mut W, } @@ -417,9 +510,7 @@ impl<'a> TMWC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TMWC_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No write access to timer mode"] #[inline(always)] @@ -444,7 +535,7 @@ impl<'a> TMWC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -526,4 +617,30 @@ impl W { pub fn tmwc(&mut self) -> TMWC_W { TMWC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Queue 0 Source Control Register\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 [qctrl0](index.html) module"] +pub struct QCTRL0_SPEC; +impl crate::RegisterSpec for QCTRL0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [qctrl0::R](R) reader structure"] +impl crate::Readable for QCTRL0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [qctrl0::W](W) writer structure"] +impl crate::Writable for QCTRL0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets QCTRL0 to value 0"] +impl crate::Resettable for QCTRL0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/qinr0.rs b/src/vadc_g0/qinr0.rs index 21db1f2e..e0aea5e3 100644 --- a/src/vadc_g0/qinr0.rs +++ b/src/vadc_g0/qinr0.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register QINR0"] -pub type W = crate::W; -#[doc = "Register QINR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::QINR0 { - type Type = u32; +#[doc = "Register `QINR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `REQCHNR`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `REQCHNR` writer - Request Channel Number"] pub struct REQCHNR_W<'a> { w: &'a mut W, } @@ -16,7 +27,7 @@ impl<'a> REQCHNR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); self.w } } @@ -34,7 +45,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `RF`"] +#[doc = "Field `RF` writer - Refill"] pub struct RF_W<'a> { w: &'a mut W, } @@ -42,9 +53,7 @@ impl<'a> RF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RF_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No refill: this queue entry is converted once and then invalidated"] #[inline(always)] @@ -69,7 +78,7 @@ impl<'a> RF_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -87,7 +96,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ENSI`"] +#[doc = "Field `ENSI` writer - Enable Source Interrupt"] pub struct ENSI_W<'a> { w: &'a mut W, } @@ -95,9 +104,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENSI_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No request source interrupt"] #[inline(always)] @@ -122,7 +129,7 @@ impl<'a> ENSI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -140,7 +147,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `EXTR`"] +#[doc = "Field `EXTR` writer - External Trigger"] pub struct EXTR_W<'a> { w: &'a mut W, } @@ -148,9 +155,7 @@ impl<'a> EXTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EXTR_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A valid queue entry immediately leads to a conversion request."] #[inline(always)] @@ -175,7 +180,7 @@ impl<'a> EXTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -200,4 +205,26 @@ impl W { pub fn extr(&mut self) -> EXTR_W { EXTR_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Queue 0 Input Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qinr0](index.html) module"] +pub struct QINR0_SPEC; +impl crate::RegisterSpec for QINR0_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [qinr0::W](W) writer structure"] +impl crate::Writable for QINR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets QINR0 to value 0"] +impl crate::Resettable for QINR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/qmr0.rs b/src/vadc_g0/qmr0.rs index 80d093aa..4973db39 100644 --- a/src/vadc_g0/qmr0.rs +++ b/src/vadc_g0/qmr0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register QMR0"] -pub type R = crate::R; -#[doc = "Writer for register QMR0"] -pub type W = crate::W; -#[doc = "Register QMR0 `reset()`'s with value 0"] -impl crate::ResetValue for super::QMR0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `QMR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `QMR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Enable Gate\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `ENGT`"] -pub type ENGT_R = crate::R; +#[doc = "Field `ENGT` reader - Enable Gate"] +pub struct ENGT_R(crate::FieldReader); impl ENGT_R { + pub(crate) fn new(bits: u8) -> Self { + ENGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENGT_A { @@ -46,25 +73,32 @@ impl ENGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENGT_A::VALUE1 + **self == ENGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENGT_A::VALUE2 + **self == ENGT_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == ENGT_A::VALUE3 + **self == ENGT_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == ENGT_A::VALUE4 + **self == ENGT_A::VALUE4 + } +} +impl core::ops::Deref for ENGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENGT`"] +#[doc = "Field `ENGT` writer - Enable Gate"] pub struct ENGT_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENGT_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "No conversion requests are issued"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> ENGT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -117,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `ENTR`"] -pub type ENTR_R = crate::R; +#[doc = "Field `ENTR` reader - Enable External Trigger"] +pub struct ENTR_R(crate::FieldReader); impl ENTR_R { + pub(crate) fn new(bits: bool) -> Self { + ENTR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENTR_A { @@ -131,15 +166,22 @@ impl ENTR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == ENTR_A::VALUE1 + **self == ENTR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == ENTR_A::VALUE2 + **self == ENTR_A::VALUE2 + } +} +impl core::ops::Deref for ENTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `ENTR`"] +#[doc = "Field `ENTR` writer - Enable External Trigger"] pub struct ENTR_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ENTR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "External trigger disabled"] #[inline(always)] @@ -174,7 +214,7 @@ impl<'a> ENTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -192,7 +232,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CLRV`"] +#[doc = "Field `CLRV` writer - Clear Valid Bit"] pub struct CLRV_W<'a> { w: &'a mut W, } @@ -200,9 +240,7 @@ impl<'a> CLRV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLRV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -227,7 +265,7 @@ impl<'a> CLRV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -245,7 +283,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `TREV`"] +#[doc = "Field `TREV` writer - Trigger Event"] pub struct TREV_W<'a> { w: &'a mut W, } @@ -253,9 +291,7 @@ impl<'a> TREV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TREV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -280,7 +316,7 @@ impl<'a> TREV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -298,7 +334,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `FLUSH`"] +#[doc = "Field `FLUSH` writer - Flush Queue"] pub struct FLUSH_W<'a> { w: &'a mut W, } @@ -306,9 +342,7 @@ impl<'a> FLUSH_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FLUSH_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -333,7 +367,7 @@ impl<'a> FLUSH_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -351,7 +385,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `CEV`"] +#[doc = "Field `CEV` writer - Clear Event Flag"] pub struct CEV_W<'a> { w: &'a mut W, } @@ -359,9 +393,7 @@ impl<'a> CEV_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CEV_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -386,7 +418,7 @@ impl<'a> CEV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -404,9 +436,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `RPTDIS`"] -pub type RPTDIS_R = crate::R; +#[doc = "Field `RPTDIS` reader - Repeat Disable"] +pub struct RPTDIS_R(crate::FieldReader); impl RPTDIS_R { + pub(crate) fn new(bits: bool) -> Self { + RPTDIS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RPTDIS_A { @@ -418,15 +453,22 @@ impl RPTDIS_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == RPTDIS_A::VALUE1 + **self == RPTDIS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == RPTDIS_A::VALUE2 + **self == RPTDIS_A::VALUE2 + } +} +impl core::ops::Deref for RPTDIS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `RPTDIS`"] +#[doc = "Field `RPTDIS` writer - Repeat Disable"] pub struct RPTDIS_W<'a> { w: &'a mut W, } @@ -434,9 +476,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RPTDIS_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "A cancelled conversion is repeated"] #[inline(always)] @@ -461,7 +501,7 @@ impl<'a> RPTDIS_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); self.w } } @@ -518,4 +558,30 @@ impl W { pub fn rptdis(&mut self) -> RPTDIS_W { RPTDIS_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Queue 0 Mode Register\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 [qmr0](index.html) module"] +pub struct QMR0_SPEC; +impl crate::RegisterSpec for QMR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [qmr0::R](R) reader structure"] +impl crate::Readable for QMR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [qmr0::W](W) writer structure"] +impl crate::Writable for QMR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets QMR0 to value 0"] +impl crate::Resettable for QMR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/qsr0.rs b/src/vadc_g0/qsr0.rs index 8a30fd4b..525864b7 100644 --- a/src/vadc_g0/qsr0.rs +++ b/src/vadc_g0/qsr0.rs @@ -1,5 +1,18 @@ -#[doc = "Reader of register QSR0"] -pub type R = crate::R; +#[doc = "Register `QSR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} #[doc = "Filling Level for Queue 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -19,40 +32,49 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `FILL`"] -pub type FILL_R = crate::R; +#[doc = "Field `FILL` reader - Filling Level for Queue 2"] +pub struct FILL_R(crate::FieldReader); impl FILL_R { + pub(crate) fn new(bits: u8) -> Self { + FILL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(FILL_A::VALUE1), - 1 => Val(FILL_A::VALUE2), - 2 => Val(FILL_A::VALUE3), - 7 => Val(FILL_A::VALUE4), - i => Res(i), + 0 => Some(FILL_A::VALUE1), + 1 => Some(FILL_A::VALUE2), + 2 => Some(FILL_A::VALUE3), + 7 => Some(FILL_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FILL_A::VALUE1 + **self == FILL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FILL_A::VALUE2 + **self == FILL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == FILL_A::VALUE3 + **self == FILL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == FILL_A::VALUE4 + **self == FILL_A::VALUE4 + } +} +impl core::ops::Deref for FILL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Queue Empty\n\nValue on reset: 1"] @@ -69,9 +91,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EMPTY`"] -pub type EMPTY_R = crate::R; +#[doc = "Field `EMPTY` reader - Queue Empty"] +pub struct EMPTY_R(crate::FieldReader); impl EMPTY_R { + pub(crate) fn new(bits: bool) -> Self { + EMPTY_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EMPTY_A { @@ -83,12 +108,19 @@ impl EMPTY_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EMPTY_A::VALUE1 + **self == EMPTY_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EMPTY_A::VALUE2 + **self == EMPTY_A::VALUE2 + } +} +impl core::ops::Deref for EMPTY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Request Gate Level\n\nValue on reset: 0"] @@ -105,9 +137,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REQGT`"] -pub type REQGT_R = crate::R; +#[doc = "Field `REQGT` reader - Request Gate Level"] +pub struct REQGT_R(crate::FieldReader); impl REQGT_R { + pub(crate) fn new(bits: bool) -> Self { + REQGT_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REQGT_A { @@ -119,12 +154,19 @@ impl REQGT_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REQGT_A::VALUE1 + **self == REQGT_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REQGT_A::VALUE2 + **self == REQGT_A::VALUE2 + } +} +impl core::ops::Deref for REQGT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Event Detected\n\nValue on reset: 0"] @@ -141,9 +183,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EV`"] -pub type EV_R = crate::R; +#[doc = "Field `EV` reader - Event Detected"] +pub struct EV_R(crate::FieldReader); impl EV_R { + pub(crate) fn new(bits: bool) -> Self { + EV_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EV_A { @@ -155,12 +200,19 @@ impl EV_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EV_A::VALUE1 + **self == EV_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EV_A::VALUE2 + **self == EV_A::VALUE2 + } +} +impl core::ops::Deref for EV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -185,3 +237,19 @@ impl R { EV_R::new(((self.bits >> 8) & 0x01) != 0) } } +#[doc = "Queue 0 Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [qsr0](index.html) module"] +pub struct QSR0_SPEC; +impl crate::RegisterSpec for QSR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [qsr0::R](R) reader structure"] +impl crate::Readable for QSR0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets QSR0 to value 0x20"] +impl crate::Resettable for QSR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x20 + } +} diff --git a/src/vadc_g0/rcr.rs b/src/vadc_g0/rcr.rs index 94ddf2c2..b13d21ec 100644 --- a/src/vadc_g0/rcr.rs +++ b/src/vadc_g0/rcr.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register RCR[%s]"] -pub type R = crate::R; -#[doc = "Writer for register RCR[%s]"] -pub type W = crate::W; -#[doc = "Register RCR[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::RCR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RCR[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RCR[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `DRCTR`"] -pub type DRCTR_R = crate::R; -#[doc = "Write proxy for field `DRCTR`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DRCTR` reader - Data Reduction Control"] +pub struct DRCTR_R(crate::FieldReader); +impl DRCTR_R { + pub(crate) fn new(bits: u8) -> Self { + DRCTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DRCTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DRCTR` writer - Data Reduction Control"] pub struct DRCTR_W<'a> { w: &'a mut W, } @@ -21,7 +56,7 @@ impl<'a> DRCTR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -42,37 +77,46 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `DMM`"] -pub type DMM_R = crate::R; +#[doc = "Field `DMM` reader - Data Modification Mode"] +pub struct DMM_R(crate::FieldReader); impl DMM_R { + pub(crate) fn new(bits: u8) -> Self { + DMM_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(DMM_A::VALUE1), - 1 => Val(DMM_A::VALUE2), - 2 => Val(DMM_A::VALUE3), - i => Res(i), + 0 => Some(DMM_A::VALUE1), + 1 => Some(DMM_A::VALUE2), + 2 => Some(DMM_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == DMM_A::VALUE1 + **self == DMM_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == DMM_A::VALUE2 + **self == DMM_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == DMM_A::VALUE3 + **self == DMM_A::VALUE3 + } +} +impl core::ops::Deref for DMM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `DMM`"] +#[doc = "Field `DMM` writer - Data Modification Mode"] pub struct DMM_W<'a> { w: &'a mut W, } @@ -100,7 +144,7 @@ impl<'a> DMM_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20); + self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20); self.w } } @@ -118,9 +162,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `WFR`"] -pub type WFR_R = crate::R; +#[doc = "Field `WFR` reader - Wait-for-Read Mode Enable"] +pub struct WFR_R(crate::FieldReader); impl WFR_R { + pub(crate) fn new(bits: bool) -> Self { + WFR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WFR_A { @@ -132,15 +179,22 @@ impl WFR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == WFR_A::VALUE1 + **self == WFR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == WFR_A::VALUE2 + **self == WFR_A::VALUE2 + } +} +impl core::ops::Deref for WFR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `WFR`"] +#[doc = "Field `WFR` writer - Wait-for-Read Mode Enable"] pub struct WFR_W<'a> { w: &'a mut W, } @@ -148,9 +202,7 @@ impl<'a> WFR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WFR_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Overwrite mode"] #[inline(always)] @@ -175,7 +227,7 @@ impl<'a> WFR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); self.w } } @@ -194,31 +246,40 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `FEN`"] -pub type FEN_R = crate::R; +#[doc = "Field `FEN` reader - FIFO Mode Enable"] +pub struct FEN_R(crate::FieldReader); impl FEN_R { + pub(crate) fn new(bits: u8) -> Self { + FEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(FEN_A::VALUE1), - 1 => Val(FEN_A::VALUE2), - i => Res(i), + 0 => Some(FEN_A::VALUE1), + 1 => Some(FEN_A::VALUE2), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FEN_A::VALUE1 + **self == FEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FEN_A::VALUE2 + **self == FEN_A::VALUE2 } } -#[doc = "Write proxy for field `FEN`"] +impl core::ops::Deref for FEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FEN` writer - FIFO Mode Enable"] pub struct FEN_W<'a> { w: &'a mut W, } @@ -241,7 +302,7 @@ impl<'a> FEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x03 << 25)) | (((value as u32) & 0x03) << 25); + self.w.bits = (self.w.bits & !(0x03 << 25)) | ((value as u32 & 0x03) << 25); self.w } } @@ -259,9 +320,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SRGEN`"] -pub type SRGEN_R = crate::R; +#[doc = "Field `SRGEN` reader - Service Request Generation Enable"] +pub struct SRGEN_R(crate::FieldReader); impl SRGEN_R { + pub(crate) fn new(bits: bool) -> Self { + SRGEN_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SRGEN_A { @@ -273,15 +337,22 @@ impl SRGEN_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SRGEN_A::VALUE1 + **self == SRGEN_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SRGEN_A::VALUE2 + **self == SRGEN_A::VALUE2 } } -#[doc = "Write proxy for field `SRGEN`"] +impl core::ops::Deref for SRGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRGEN` writer - Service Request Generation Enable"] pub struct SRGEN_W<'a> { w: &'a mut W, } @@ -289,9 +360,7 @@ impl<'a> SRGEN_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SRGEN_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No service request"] #[inline(always)] @@ -316,7 +385,7 @@ impl<'a> SRGEN_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); self.w } } @@ -373,4 +442,31 @@ impl W { pub fn srgen(&mut self) -> SRGEN_W { SRGEN_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Control Register\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 [rcr](index.html) module"] +pub struct RCR_SPEC; +impl crate::RegisterSpec for RCR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rcr::R](R) reader structure"] +impl crate::Readable for RCR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rcr::W](W) writer structure"] +impl crate::Writable for RCR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RCR[%s] +to value 0"] +impl crate::Resettable for RCR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/refclr.rs b/src/vadc_g0/refclr.rs index e43f96d6..aec750d4 100644 --- a/src/vadc_g0/refclr.rs +++ b/src/vadc_g0/refclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register REFCLR"] -pub type W = crate::W; -#[doc = "Register REFCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::REFCLR { - type Type = u32; +#[doc = "Register `REFCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Result Event for Result Register 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV0`"] +#[doc = "Field `REV0` writer - Clear Result Event for Result Register 0"] pub struct REV0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> REV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> REV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV1`"] +#[doc = "Field `REV1` writer - Clear Result Event for Result Register 1"] pub struct REV1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> REV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> REV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV2`"] +#[doc = "Field `REV2` writer - Clear Result Event for Result Register 2"] pub struct REV2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> REV2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> REV2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV3`"] +#[doc = "Field `REV3` writer - Clear Result Event for Result Register 3"] pub struct REV3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> REV3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> REV3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV4`"] +#[doc = "Field `REV4` writer - Clear Result Event for Result Register 4"] pub struct REV4_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> REV4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV4_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> REV4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV5`"] +#[doc = "Field `REV5` writer - Clear Result Event for Result Register 5"] pub struct REV5_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> REV5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV5_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> REV5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV6`"] +#[doc = "Field `REV6` writer - Clear Result Event for Result Register 6"] pub struct REV6_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> REV6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV6_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> REV6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV7`"] +#[doc = "Field `REV7` writer - Clear Result Event for Result Register 7"] pub struct REV7_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> REV7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV7_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> REV7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -446,7 +441,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV8`"] +#[doc = "Field `REV8` writer - Clear Result Event for Result Register 8"] pub struct REV8_W<'a> { w: &'a mut W, } @@ -454,9 +449,7 @@ impl<'a> REV8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV8_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -481,7 +474,7 @@ impl<'a> REV8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -499,7 +492,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV9`"] +#[doc = "Field `REV9` writer - Clear Result Event for Result Register 9"] pub struct REV9_W<'a> { w: &'a mut W, } @@ -507,9 +500,7 @@ impl<'a> REV9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV9_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -534,7 +525,7 @@ impl<'a> REV9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -552,7 +543,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV10`"] +#[doc = "Field `REV10` writer - Clear Result Event for Result Register 10"] pub struct REV10_W<'a> { w: &'a mut W, } @@ -560,9 +551,7 @@ impl<'a> REV10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV10_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -587,7 +576,7 @@ impl<'a> REV10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -605,7 +594,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV11`"] +#[doc = "Field `REV11` writer - Clear Result Event for Result Register 11"] pub struct REV11_W<'a> { w: &'a mut W, } @@ -613,9 +602,7 @@ impl<'a> REV11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV11_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -640,7 +627,7 @@ impl<'a> REV11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -658,7 +645,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV12`"] +#[doc = "Field `REV12` writer - Clear Result Event for Result Register 12"] pub struct REV12_W<'a> { w: &'a mut W, } @@ -666,9 +653,7 @@ impl<'a> REV12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV12_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -693,7 +678,7 @@ impl<'a> REV12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -711,7 +696,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV13`"] +#[doc = "Field `REV13` writer - Clear Result Event for Result Register 13"] pub struct REV13_W<'a> { w: &'a mut W, } @@ -719,9 +704,7 @@ impl<'a> REV13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV13_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -746,7 +729,7 @@ impl<'a> REV13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -764,7 +747,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV14`"] +#[doc = "Field `REV14` writer - Clear Result Event for Result Register 14"] pub struct REV14_W<'a> { w: &'a mut W, } @@ -772,9 +755,7 @@ impl<'a> REV14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV14_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -799,7 +780,7 @@ impl<'a> REV14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -817,7 +798,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `REV15`"] +#[doc = "Field `REV15` writer - Clear Result Event for Result Register 15"] pub struct REV15_W<'a> { w: &'a mut W, } @@ -825,9 +806,7 @@ impl<'a> REV15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV15_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -852,7 +831,7 @@ impl<'a> REV15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -937,4 +916,26 @@ impl W { pub fn rev15(&mut self) -> REV15_W { REV15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Event Flag Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refclr](index.html) module"] +pub struct REFCLR_SPEC; +impl crate::RegisterSpec for REFCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [refclr::W](W) writer structure"] +impl crate::Writable for REFCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REFCLR to value 0"] +impl crate::Resettable for REFCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/reflag.rs b/src/vadc_g0/reflag.rs index b65b1815..44cafb9a 100644 --- a/src/vadc_g0/reflag.rs +++ b/src/vadc_g0/reflag.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register REFLAG"] -pub type R = crate::R; -#[doc = "Writer for register REFLAG"] -pub type W = crate::W; -#[doc = "Register REFLAG `reset()`'s with value 0"] -impl crate::ResetValue for super::REFLAG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `REFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Result Event for Result Register 0\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV0`"] -pub type REV0_R = crate::R; +#[doc = "Field `REV0` reader - Result Event for Result Register 0"] +pub struct REV0_R(crate::FieldReader); impl REV0_R { + pub(crate) fn new(bits: bool) -> Self { + REV0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV0_A { @@ -38,15 +65,22 @@ impl REV0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV0_A::VALUE1 + **self == REV0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV0_A::VALUE2 + **self == REV0_A::VALUE2 } } -#[doc = "Write proxy for field `REV0`"] +impl core::ops::Deref for REV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV0` writer - Result Event for Result Register 0"] pub struct REV0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> REV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> REV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV1`"] -pub type REV1_R = crate::R; +#[doc = "Field `REV1` reader - Result Event for Result Register 1"] +pub struct REV1_R(crate::FieldReader); impl REV1_R { + pub(crate) fn new(bits: bool) -> Self { + REV1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV1_A { @@ -113,15 +148,22 @@ impl REV1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV1_A::VALUE1 + **self == REV1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV1_A::VALUE2 + **self == REV1_A::VALUE2 } } -#[doc = "Write proxy for field `REV1`"] +impl core::ops::Deref for REV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV1` writer - Result Event for Result Register 1"] pub struct REV1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> REV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> REV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV2`"] -pub type REV2_R = crate::R; +#[doc = "Field `REV2` reader - Result Event for Result Register 2"] +pub struct REV2_R(crate::FieldReader); impl REV2_R { + pub(crate) fn new(bits: bool) -> Self { + REV2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV2_A { @@ -188,15 +231,22 @@ impl REV2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV2_A::VALUE1 + **self == REV2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV2_A::VALUE2 + **self == REV2_A::VALUE2 + } +} +impl core::ops::Deref for REV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV2`"] +#[doc = "Field `REV2` writer - Result Event for Result Register 2"] pub struct REV2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> REV2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> REV2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV3`"] -pub type REV3_R = crate::R; +#[doc = "Field `REV3` reader - Result Event for Result Register 3"] +pub struct REV3_R(crate::FieldReader); impl REV3_R { + pub(crate) fn new(bits: bool) -> Self { + REV3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV3_A { @@ -263,15 +314,22 @@ impl REV3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV3_A::VALUE1 + **self == REV3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV3_A::VALUE2 + **self == REV3_A::VALUE2 + } +} +impl core::ops::Deref for REV3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV3`"] +#[doc = "Field `REV3` writer - Result Event for Result Register 3"] pub struct REV3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> REV3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> REV3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV4`"] -pub type REV4_R = crate::R; +#[doc = "Field `REV4` reader - Result Event for Result Register 4"] +pub struct REV4_R(crate::FieldReader); impl REV4_R { + pub(crate) fn new(bits: bool) -> Self { + REV4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV4_A { @@ -338,15 +397,22 @@ impl REV4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV4_A::VALUE1 + **self == REV4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV4_A::VALUE2 + **self == REV4_A::VALUE2 + } +} +impl core::ops::Deref for REV4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV4`"] +#[doc = "Field `REV4` writer - Result Event for Result Register 4"] pub struct REV4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> REV4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> REV4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV5`"] -pub type REV5_R = crate::R; +#[doc = "Field `REV5` reader - Result Event for Result Register 5"] +pub struct REV5_R(crate::FieldReader); impl REV5_R { + pub(crate) fn new(bits: bool) -> Self { + REV5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV5_A { @@ -413,15 +480,22 @@ impl REV5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV5_A::VALUE1 + **self == REV5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV5_A::VALUE2 + **self == REV5_A::VALUE2 + } +} +impl core::ops::Deref for REV5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV5`"] +#[doc = "Field `REV5` writer - Result Event for Result Register 5"] pub struct REV5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> REV5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> REV5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV6`"] -pub type REV6_R = crate::R; +#[doc = "Field `REV6` reader - Result Event for Result Register 6"] +pub struct REV6_R(crate::FieldReader); impl REV6_R { + pub(crate) fn new(bits: bool) -> Self { + REV6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV6_A { @@ -488,15 +563,22 @@ impl REV6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV6_A::VALUE1 + **self == REV6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV6_A::VALUE2 + **self == REV6_A::VALUE2 } } -#[doc = "Write proxy for field `REV6`"] +impl core::ops::Deref for REV6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV6` writer - Result Event for Result Register 6"] pub struct REV6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> REV6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> REV6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV7`"] -pub type REV7_R = crate::R; +#[doc = "Field `REV7` reader - Result Event for Result Register 7"] +pub struct REV7_R(crate::FieldReader); impl REV7_R { + pub(crate) fn new(bits: bool) -> Self { + REV7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV7_A { @@ -563,15 +646,22 @@ impl REV7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV7_A::VALUE1 + **self == REV7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV7_A::VALUE2 + **self == REV7_A::VALUE2 } } -#[doc = "Write proxy for field `REV7`"] +impl core::ops::Deref for REV7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV7` writer - Result Event for Result Register 7"] pub struct REV7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> REV7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> REV7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV8`"] -pub type REV8_R = crate::R; +#[doc = "Field `REV8` reader - Result Event for Result Register 8"] +pub struct REV8_R(crate::FieldReader); impl REV8_R { + pub(crate) fn new(bits: bool) -> Self { + REV8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV8_A { @@ -638,15 +729,22 @@ impl REV8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV8_A::VALUE1 + **self == REV8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV8_A::VALUE2 + **self == REV8_A::VALUE2 } } -#[doc = "Write proxy for field `REV8`"] +impl core::ops::Deref for REV8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV8` writer - Result Event for Result Register 8"] pub struct REV8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> REV8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> REV8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV9`"] -pub type REV9_R = crate::R; +#[doc = "Field `REV9` reader - Result Event for Result Register 9"] +pub struct REV9_R(crate::FieldReader); impl REV9_R { + pub(crate) fn new(bits: bool) -> Self { + REV9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV9_A { @@ -713,15 +812,22 @@ impl REV9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV9_A::VALUE1 + **self == REV9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV9_A::VALUE2 + **self == REV9_A::VALUE2 + } +} +impl core::ops::Deref for REV9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV9`"] +#[doc = "Field `REV9` writer - Result Event for Result Register 9"] pub struct REV9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> REV9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> REV9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV10`"] -pub type REV10_R = crate::R; +#[doc = "Field `REV10` reader - Result Event for Result Register 10"] +pub struct REV10_R(crate::FieldReader); impl REV10_R { + pub(crate) fn new(bits: bool) -> Self { + REV10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV10_A { @@ -788,15 +895,22 @@ impl REV10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV10_A::VALUE1 + **self == REV10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV10_A::VALUE2 + **self == REV10_A::VALUE2 } } -#[doc = "Write proxy for field `REV10`"] +impl core::ops::Deref for REV10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV10` writer - Result Event for Result Register 10"] pub struct REV10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> REV10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> REV10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV11`"] -pub type REV11_R = crate::R; +#[doc = "Field `REV11` reader - Result Event for Result Register 11"] +pub struct REV11_R(crate::FieldReader); impl REV11_R { + pub(crate) fn new(bits: bool) -> Self { + REV11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV11_A { @@ -863,15 +978,22 @@ impl REV11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV11_A::VALUE1 + **self == REV11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV11_A::VALUE2 + **self == REV11_A::VALUE2 } } -#[doc = "Write proxy for field `REV11`"] +impl core::ops::Deref for REV11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV11` writer - Result Event for Result Register 11"] pub struct REV11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> REV11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> REV11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV12`"] -pub type REV12_R = crate::R; +#[doc = "Field `REV12` reader - Result Event for Result Register 12"] +pub struct REV12_R(crate::FieldReader); impl REV12_R { + pub(crate) fn new(bits: bool) -> Self { + REV12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV12_A { @@ -938,15 +1061,22 @@ impl REV12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV12_A::VALUE1 + **self == REV12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV12_A::VALUE2 + **self == REV12_A::VALUE2 + } +} +impl core::ops::Deref for REV12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV12`"] +#[doc = "Field `REV12` writer - Result Event for Result Register 12"] pub struct REV12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> REV12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> REV12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV13`"] -pub type REV13_R = crate::R; +#[doc = "Field `REV13` reader - Result Event for Result Register 13"] +pub struct REV13_R(crate::FieldReader); impl REV13_R { + pub(crate) fn new(bits: bool) -> Self { + REV13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV13_A { @@ -1013,15 +1144,22 @@ impl REV13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV13_A::VALUE1 + **self == REV13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV13_A::VALUE2 + **self == REV13_A::VALUE2 } } -#[doc = "Write proxy for field `REV13`"] +impl core::ops::Deref for REV13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV13` writer - Result Event for Result Register 13"] pub struct REV13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> REV13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> REV13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV14`"] -pub type REV14_R = crate::R; +#[doc = "Field `REV14` reader - Result Event for Result Register 14"] +pub struct REV14_R(crate::FieldReader); impl REV14_R { + pub(crate) fn new(bits: bool) -> Self { + REV14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV14_A { @@ -1088,15 +1227,22 @@ impl REV14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV14_A::VALUE1 + **self == REV14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV14_A::VALUE2 + **self == REV14_A::VALUE2 } } -#[doc = "Write proxy for field `REV14`"] +impl core::ops::Deref for REV14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV14` writer - Result Event for Result Register 14"] pub struct REV14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> REV14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> REV14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `REV15`"] -pub type REV15_R = crate::R; +#[doc = "Field `REV15` reader - Result Event for Result Register 15"] +pub struct REV15_R(crate::FieldReader); impl REV15_R { + pub(crate) fn new(bits: bool) -> Self { + REV15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> REV15_A { @@ -1163,15 +1310,22 @@ impl REV15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV15_A::VALUE1 + **self == REV15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV15_A::VALUE2 + **self == REV15_A::VALUE2 } } -#[doc = "Write proxy for field `REV15`"] +impl core::ops::Deref for REV15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV15` writer - Result Event for Result Register 15"] pub struct REV15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> REV15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: REV15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No result event"] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> REV15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn rev15(&mut self) -> REV15_W { REV15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Event Flag Register\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 [reflag](index.html) module"] +pub struct REFLAG_SPEC; +impl crate::RegisterSpec for REFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [reflag::R](R) reader structure"] +impl crate::Readable for REFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [reflag::W](W) writer structure"] +impl crate::Writable for REFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REFLAG to value 0"] +impl crate::Resettable for REFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/res.rs b/src/vadc_g0/res.rs index 09b14f62..170d35e6 100644 --- a/src/vadc_g0/res.rs +++ b/src/vadc_g0/res.rs @@ -1,19 +1,54 @@ -#[doc = "Reader of register RES[%s]"] -pub type R = crate::R; -#[doc = "Writer for register RES[%s]"] -pub type W = crate::W; -#[doc = "Register RES[%s] -`reset()`'s with value 0"] -impl crate::ResetValue for super::RES { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `RES[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RES[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; -#[doc = "Write proxy for field `RESULT`"] +#[doc = "Field `RESULT` reader - Result of Most Recent Conversion"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESULT` writer - Result of Most Recent Conversion"] pub struct RESULT_W<'a> { w: &'a mut W, } @@ -21,16 +56,52 @@ impl<'a> RESULT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); self.w } } -#[doc = "Reader of field `DRC`"] -pub type DRC_R = crate::R; -#[doc = "Reader of field `CHNR`"] -pub type CHNR_R = crate::R; -#[doc = "Reader of field `EMUX`"] -pub type EMUX_R = crate::R; +#[doc = "Field `DRC` reader - Data Reduction Counter"] +pub struct DRC_R(crate::FieldReader); +impl DRC_R { + pub(crate) fn new(bits: u8) -> Self { + DRC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHNR` reader - Channel Number"] +pub struct CHNR_R(crate::FieldReader); +impl CHNR_R { + pub(crate) fn new(bits: u8) -> Self { + CHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUX` reader - External Multiplexer Setting"] +pub struct EMUX_R(crate::FieldReader); +impl EMUX_R { + pub(crate) fn new(bits: u8) -> Self { + EMUX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Converted Request Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -48,34 +119,43 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CRS`"] -pub type CRS_R = crate::R; +#[doc = "Field `CRS` reader - Converted Request Source"] +pub struct CRS_R(crate::FieldReader); impl CRS_R { + pub(crate) fn new(bits: u8) -> Self { + CRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CRS_A::VALUE1), - 1 => Val(CRS_A::VALUE2), - 2 => Val(CRS_A::VALUE3), - i => Res(i), + 0 => Some(CRS_A::VALUE1), + 1 => Some(CRS_A::VALUE2), + 2 => Some(CRS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CRS_A::VALUE1 + **self == CRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CRS_A::VALUE2 + **self == CRS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CRS_A::VALUE3 + **self == CRS_A::VALUE3 + } +} +impl core::ops::Deref for CRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Fast Compare Result\n\nValue on reset: 0"] @@ -92,9 +172,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCR`"] -pub type FCR_R = crate::R; +#[doc = "Field `FCR` reader - Fast Compare Result"] +pub struct FCR_R(crate::FieldReader); impl FCR_R { + pub(crate) fn new(bits: bool) -> Self { + FCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCR_A { @@ -106,12 +189,19 @@ impl FCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCR_A::VALUE1 + **self == FCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCR_A::VALUE2 + **self == FCR_A::VALUE2 + } +} +impl core::ops::Deref for FCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Valid Flag\n\nValue on reset: 0"] @@ -128,9 +218,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF`"] -pub type VF_R = crate::R; +#[doc = "Field `VF` reader - Valid Flag"] +pub struct VF_R(crate::FieldReader); impl VF_R { + pub(crate) fn new(bits: bool) -> Self { + VF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF_A { @@ -142,12 +235,19 @@ impl VF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF_A::VALUE1 + **self == VF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF_A::VALUE2 + **self == VF_A::VALUE2 + } +} +impl core::ops::Deref for VF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -193,4 +293,31 @@ impl W { pub fn result(&mut self) -> RESULT_W { RESULT_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Register\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 [res](index.html) module"] +pub struct RES_SPEC; +impl crate::RegisterSpec for RES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [res::R](R) reader structure"] +impl crate::Readable for RES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [res::W](W) writer structure"] +impl crate::Writable for RES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RES[%s] +to value 0"] +impl crate::Resettable for RES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/resd.rs b/src/vadc_g0/resd.rs index ed3ef3d4..34878fe7 100644 --- a/src/vadc_g0/resd.rs +++ b/src/vadc_g0/resd.rs @@ -1,13 +1,74 @@ -#[doc = "Reader of register RESD[%s]"] -pub type R = crate::R; -#[doc = "Reader of field `RESULT`"] -pub type RESULT_R = crate::R; -#[doc = "Reader of field `DRC`"] -pub type DRC_R = crate::R; -#[doc = "Reader of field `CHNR`"] -pub type CHNR_R = crate::R; -#[doc = "Reader of field `EMUX`"] -pub type EMUX_R = crate::R; +#[doc = "Register `RESD[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RESULT` reader - Result of Most Recent Conversion"] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: u16) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DRC` reader - Data Reduction Counter"] +pub struct DRC_R(crate::FieldReader); +impl DRC_R { + pub(crate) fn new(bits: u8) -> Self { + DRC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHNR` reader - Channel Number"] +pub struct CHNR_R(crate::FieldReader); +impl CHNR_R { + pub(crate) fn new(bits: u8) -> Self { + CHNR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CHNR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EMUX` reader - External Multiplexer Setting"] +pub struct EMUX_R(crate::FieldReader); +impl EMUX_R { + pub(crate) fn new(bits: u8) -> Self { + EMUX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} #[doc = "Converted Request Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] @@ -25,34 +86,43 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `CRS`"] -pub type CRS_R = crate::R; +#[doc = "Field `CRS` reader - Converted Request Source"] +pub struct CRS_R(crate::FieldReader); impl CRS_R { + pub(crate) fn new(bits: u8) -> Self { + CRS_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(CRS_A::VALUE1), - 1 => Val(CRS_A::VALUE2), - 2 => Val(CRS_A::VALUE3), - i => Res(i), + 0 => Some(CRS_A::VALUE1), + 1 => Some(CRS_A::VALUE2), + 2 => Some(CRS_A::VALUE3), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == CRS_A::VALUE1 + **self == CRS_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == CRS_A::VALUE2 + **self == CRS_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == CRS_A::VALUE3 + **self == CRS_A::VALUE3 + } +} +impl core::ops::Deref for CRS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Fast Compare Result\n\nValue on reset: 0"] @@ -69,9 +139,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `FCR`"] -pub type FCR_R = crate::R; +#[doc = "Field `FCR` reader - Fast Compare Result"] +pub struct FCR_R(crate::FieldReader); impl FCR_R { + pub(crate) fn new(bits: bool) -> Self { + FCR_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCR_A { @@ -83,12 +156,19 @@ impl FCR_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == FCR_A::VALUE1 + **self == FCR_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == FCR_A::VALUE2 + **self == FCR_A::VALUE2 + } +} +impl core::ops::Deref for FCR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } #[doc = "Valid Flag\n\nValue on reset: 0"] @@ -105,9 +185,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF`"] -pub type VF_R = crate::R; +#[doc = "Field `VF` reader - Valid Flag"] +pub struct VF_R(crate::FieldReader); impl VF_R { + pub(crate) fn new(bits: bool) -> Self { + VF_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF_A { @@ -119,12 +202,19 @@ impl VF_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF_A::VALUE1 + **self == VF_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF_A::VALUE2 + **self == VF_A::VALUE2 + } +} +impl core::ops::Deref for VF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } impl R { @@ -164,3 +254,20 @@ impl R { VF_R::new(((self.bits >> 31) & 0x01) != 0) } } +#[doc = "Result Register, Debug\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resd](index.html) module"] +pub struct RESD_SPEC; +impl crate::RegisterSpec for RESD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [resd::R](R) reader structure"] +impl crate::Readable for RESD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RESD[%s] +to value 0"] +impl crate::Resettable for RESD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/vadc_g0/revnp0.rs b/src/vadc_g0/revnp0.rs index b4d70098..887aa060 100644 --- a/src/vadc_g0/revnp0.rs +++ b/src/vadc_g0/revnp0.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register REVNP0"] -pub type R = crate::R; -#[doc = "Writer for register REVNP0"] -pub type W = crate::W; -#[doc = "Register REVNP0 `reset()`'s with value 0"] -impl crate::ResetValue for super::REVNP0 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `REVNP0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REVNP0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV0NP`"] -pub type REV0NP_R = crate::R; +#[doc = "Field `REV0NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV0NP_R(crate::FieldReader); impl REV0NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV0NP_A::VALUE1), - 3 => Val(REV0NP_A::VALUE2), - 4 => Val(REV0NP_A::VALUE3), - 7 => Val(REV0NP_A::VALUE4), - i => Res(i), + 0 => Some(REV0NP_A::VALUE1), + 3 => Some(REV0NP_A::VALUE2), + 4 => Some(REV0NP_A::VALUE3), + 7 => Some(REV0NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV0NP_A::VALUE1 + **self == REV0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV0NP_A::VALUE2 + **self == REV0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV0NP_A::VALUE3 + **self == REV0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV0NP_A::VALUE4 + **self == REV0NP_A::VALUE4 + } +} +impl core::ops::Deref for REV0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV0NP`"] +#[doc = "Field `REV0NP` writer - Service Request Node Pointer Result Event i"] pub struct REV0NP_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> REV0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV1NP`"] -pub type REV1NP_R = crate::R; +#[doc = "Field `REV1NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV1NP_R(crate::FieldReader); impl REV1NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV1NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV1NP_A::VALUE1), - 3 => Val(REV1NP_A::VALUE2), - 4 => Val(REV1NP_A::VALUE3), - 7 => Val(REV1NP_A::VALUE4), - i => Res(i), + 0 => Some(REV1NP_A::VALUE1), + 3 => Some(REV1NP_A::VALUE2), + 4 => Some(REV1NP_A::VALUE3), + 7 => Some(REV1NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV1NP_A::VALUE1 + **self == REV1NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV1NP_A::VALUE2 + **self == REV1NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV1NP_A::VALUE3 + **self == REV1NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV1NP_A::VALUE4 + **self == REV1NP_A::VALUE4 + } +} +impl core::ops::Deref for REV1NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV1NP`"] +#[doc = "Field `REV1NP` writer - Service Request Node Pointer Result Event i"] pub struct REV1NP_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> REV1NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -213,43 +255,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV2NP`"] -pub type REV2NP_R = crate::R; +#[doc = "Field `REV2NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV2NP_R(crate::FieldReader); impl REV2NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV2NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV2NP_A::VALUE1), - 3 => Val(REV2NP_A::VALUE2), - 4 => Val(REV2NP_A::VALUE3), - 7 => Val(REV2NP_A::VALUE4), - i => Res(i), + 0 => Some(REV2NP_A::VALUE1), + 3 => Some(REV2NP_A::VALUE2), + 4 => Some(REV2NP_A::VALUE3), + 7 => Some(REV2NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV2NP_A::VALUE1 + **self == REV2NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV2NP_A::VALUE2 + **self == REV2NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV2NP_A::VALUE3 + **self == REV2NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV2NP_A::VALUE4 + **self == REV2NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV2NP`"] +impl core::ops::Deref for REV2NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV2NP` writer - Service Request Node Pointer Result Event i"] pub struct REV2NP_W<'a> { w: &'a mut W, } @@ -282,7 +333,7 @@ impl<'a> REV2NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -305,43 +356,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV3NP`"] -pub type REV3NP_R = crate::R; +#[doc = "Field `REV3NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV3NP_R(crate::FieldReader); impl REV3NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV3NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV3NP_A::VALUE1), - 3 => Val(REV3NP_A::VALUE2), - 4 => Val(REV3NP_A::VALUE3), - 7 => Val(REV3NP_A::VALUE4), - i => Res(i), + 0 => Some(REV3NP_A::VALUE1), + 3 => Some(REV3NP_A::VALUE2), + 4 => Some(REV3NP_A::VALUE3), + 7 => Some(REV3NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV3NP_A::VALUE1 + **self == REV3NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV3NP_A::VALUE2 + **self == REV3NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV3NP_A::VALUE3 + **self == REV3NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV3NP_A::VALUE4 + **self == REV3NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV3NP`"] +impl core::ops::Deref for REV3NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV3NP` writer - Service Request Node Pointer Result Event i"] pub struct REV3NP_W<'a> { w: &'a mut W, } @@ -374,7 +434,7 @@ impl<'a> REV3NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -397,43 +457,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV4NP`"] -pub type REV4NP_R = crate::R; +#[doc = "Field `REV4NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV4NP_R(crate::FieldReader); impl REV4NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV4NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV4NP_A::VALUE1), - 3 => Val(REV4NP_A::VALUE2), - 4 => Val(REV4NP_A::VALUE3), - 7 => Val(REV4NP_A::VALUE4), - i => Res(i), + 0 => Some(REV4NP_A::VALUE1), + 3 => Some(REV4NP_A::VALUE2), + 4 => Some(REV4NP_A::VALUE3), + 7 => Some(REV4NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV4NP_A::VALUE1 + **self == REV4NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV4NP_A::VALUE2 + **self == REV4NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV4NP_A::VALUE3 + **self == REV4NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV4NP_A::VALUE4 + **self == REV4NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV4NP`"] +impl core::ops::Deref for REV4NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV4NP` writer - Service Request Node Pointer Result Event i"] pub struct REV4NP_W<'a> { w: &'a mut W, } @@ -466,7 +535,7 @@ impl<'a> REV4NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -489,43 +558,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV5NP`"] -pub type REV5NP_R = crate::R; +#[doc = "Field `REV5NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV5NP_R(crate::FieldReader); impl REV5NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV5NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV5NP_A::VALUE1), - 3 => Val(REV5NP_A::VALUE2), - 4 => Val(REV5NP_A::VALUE3), - 7 => Val(REV5NP_A::VALUE4), - i => Res(i), + 0 => Some(REV5NP_A::VALUE1), + 3 => Some(REV5NP_A::VALUE2), + 4 => Some(REV5NP_A::VALUE3), + 7 => Some(REV5NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV5NP_A::VALUE1 + **self == REV5NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV5NP_A::VALUE2 + **self == REV5NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV5NP_A::VALUE3 + **self == REV5NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV5NP_A::VALUE4 + **self == REV5NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV5NP`"] +impl core::ops::Deref for REV5NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV5NP` writer - Service Request Node Pointer Result Event i"] pub struct REV5NP_W<'a> { w: &'a mut W, } @@ -558,7 +636,7 @@ impl<'a> REV5NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } @@ -581,43 +659,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV6NP`"] -pub type REV6NP_R = crate::R; +#[doc = "Field `REV6NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV6NP_R(crate::FieldReader); impl REV6NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV6NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV6NP_A::VALUE1), - 3 => Val(REV6NP_A::VALUE2), - 4 => Val(REV6NP_A::VALUE3), - 7 => Val(REV6NP_A::VALUE4), - i => Res(i), + 0 => Some(REV6NP_A::VALUE1), + 3 => Some(REV6NP_A::VALUE2), + 4 => Some(REV6NP_A::VALUE3), + 7 => Some(REV6NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV6NP_A::VALUE1 + **self == REV6NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV6NP_A::VALUE2 + **self == REV6NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV6NP_A::VALUE3 + **self == REV6NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV6NP_A::VALUE4 + **self == REV6NP_A::VALUE4 + } +} +impl core::ops::Deref for REV6NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV6NP`"] +#[doc = "Field `REV6NP` writer - Service Request Node Pointer Result Event i"] pub struct REV6NP_W<'a> { w: &'a mut W, } @@ -650,7 +737,7 @@ impl<'a> REV6NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -673,43 +760,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV7NP`"] -pub type REV7NP_R = crate::R; +#[doc = "Field `REV7NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV7NP_R(crate::FieldReader); impl REV7NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV7NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV7NP_A::VALUE1), - 3 => Val(REV7NP_A::VALUE2), - 4 => Val(REV7NP_A::VALUE3), - 7 => Val(REV7NP_A::VALUE4), - i => Res(i), + 0 => Some(REV7NP_A::VALUE1), + 3 => Some(REV7NP_A::VALUE2), + 4 => Some(REV7NP_A::VALUE3), + 7 => Some(REV7NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV7NP_A::VALUE1 + **self == REV7NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV7NP_A::VALUE2 + **self == REV7NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV7NP_A::VALUE3 + **self == REV7NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV7NP_A::VALUE4 + **self == REV7NP_A::VALUE4 + } +} +impl core::ops::Deref for REV7NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV7NP`"] +#[doc = "Field `REV7NP` writer - Service Request Node Pointer Result Event i"] pub struct REV7NP_W<'a> { w: &'a mut W, } @@ -742,7 +838,7 @@ impl<'a> REV7NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -829,4 +925,30 @@ impl W { pub fn rev7np(&mut self) -> REV7NP_W { REV7NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Event Node Pointer Register 0\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 [revnp0](index.html) module"] +pub struct REVNP0_SPEC; +impl crate::RegisterSpec for REVNP0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [revnp0::R](R) reader structure"] +impl crate::Readable for REVNP0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [revnp0::W](W) writer structure"] +impl crate::Writable for REVNP0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REVNP0 to value 0"] +impl crate::Resettable for REVNP0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/revnp1.rs b/src/vadc_g0/revnp1.rs index 38f9c7b0..908d3a26 100644 --- a/src/vadc_g0/revnp1.rs +++ b/src/vadc_g0/revnp1.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register REVNP1"] -pub type R = crate::R; -#[doc = "Writer for register REVNP1"] -pub type W = crate::W; -#[doc = "Register REVNP1 `reset()`'s with value 0"] -impl crate::ResetValue for super::REVNP1 { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `REVNP1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REVNP1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV8NP`"] -pub type REV8NP_R = crate::R; +#[doc = "Field `REV8NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV8NP_R(crate::FieldReader); impl REV8NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV8NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV8NP_A::VALUE1), - 3 => Val(REV8NP_A::VALUE2), - 4 => Val(REV8NP_A::VALUE3), - 7 => Val(REV8NP_A::VALUE4), - i => Res(i), + 0 => Some(REV8NP_A::VALUE1), + 3 => Some(REV8NP_A::VALUE2), + 4 => Some(REV8NP_A::VALUE3), + 7 => Some(REV8NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV8NP_A::VALUE1 + **self == REV8NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV8NP_A::VALUE2 + **self == REV8NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV8NP_A::VALUE3 + **self == REV8NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV8NP_A::VALUE4 + **self == REV8NP_A::VALUE4 + } +} +impl core::ops::Deref for REV8NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV8NP`"] +#[doc = "Field `REV8NP` writer - Service Request Node Pointer Result Event i"] pub struct REV8NP_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> REV8NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV9NP`"] -pub type REV9NP_R = crate::R; +#[doc = "Field `REV9NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV9NP_R(crate::FieldReader); impl REV9NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV9NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV9NP_A::VALUE1), - 3 => Val(REV9NP_A::VALUE2), - 4 => Val(REV9NP_A::VALUE3), - 7 => Val(REV9NP_A::VALUE4), - i => Res(i), + 0 => Some(REV9NP_A::VALUE1), + 3 => Some(REV9NP_A::VALUE2), + 4 => Some(REV9NP_A::VALUE3), + 7 => Some(REV9NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV9NP_A::VALUE1 + **self == REV9NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV9NP_A::VALUE2 + **self == REV9NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV9NP_A::VALUE3 + **self == REV9NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV9NP_A::VALUE4 + **self == REV9NP_A::VALUE4 + } +} +impl core::ops::Deref for REV9NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV9NP`"] +#[doc = "Field `REV9NP` writer - Service Request Node Pointer Result Event i"] pub struct REV9NP_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> REV9NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -213,43 +255,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV10NP`"] -pub type REV10NP_R = crate::R; +#[doc = "Field `REV10NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV10NP_R(crate::FieldReader); impl REV10NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV10NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV10NP_A::VALUE1), - 3 => Val(REV10NP_A::VALUE2), - 4 => Val(REV10NP_A::VALUE3), - 7 => Val(REV10NP_A::VALUE4), - i => Res(i), + 0 => Some(REV10NP_A::VALUE1), + 3 => Some(REV10NP_A::VALUE2), + 4 => Some(REV10NP_A::VALUE3), + 7 => Some(REV10NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV10NP_A::VALUE1 + **self == REV10NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV10NP_A::VALUE2 + **self == REV10NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV10NP_A::VALUE3 + **self == REV10NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV10NP_A::VALUE4 + **self == REV10NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV10NP`"] +impl core::ops::Deref for REV10NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV10NP` writer - Service Request Node Pointer Result Event i"] pub struct REV10NP_W<'a> { w: &'a mut W, } @@ -282,7 +333,7 @@ impl<'a> REV10NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8); + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); self.w } } @@ -305,43 +356,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV11NP`"] -pub type REV11NP_R = crate::R; +#[doc = "Field `REV11NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV11NP_R(crate::FieldReader); impl REV11NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV11NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV11NP_A::VALUE1), - 3 => Val(REV11NP_A::VALUE2), - 4 => Val(REV11NP_A::VALUE3), - 7 => Val(REV11NP_A::VALUE4), - i => Res(i), + 0 => Some(REV11NP_A::VALUE1), + 3 => Some(REV11NP_A::VALUE2), + 4 => Some(REV11NP_A::VALUE3), + 7 => Some(REV11NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV11NP_A::VALUE1 + **self == REV11NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV11NP_A::VALUE2 + **self == REV11NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV11NP_A::VALUE3 + **self == REV11NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV11NP_A::VALUE4 + **self == REV11NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV11NP`"] +impl core::ops::Deref for REV11NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV11NP` writer - Service Request Node Pointer Result Event i"] pub struct REV11NP_W<'a> { w: &'a mut W, } @@ -374,7 +434,7 @@ impl<'a> REV11NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12); + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } @@ -397,43 +457,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV12NP`"] -pub type REV12NP_R = crate::R; +#[doc = "Field `REV12NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV12NP_R(crate::FieldReader); impl REV12NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV12NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV12NP_A::VALUE1), - 3 => Val(REV12NP_A::VALUE2), - 4 => Val(REV12NP_A::VALUE3), - 7 => Val(REV12NP_A::VALUE4), - i => Res(i), + 0 => Some(REV12NP_A::VALUE1), + 3 => Some(REV12NP_A::VALUE2), + 4 => Some(REV12NP_A::VALUE3), + 7 => Some(REV12NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV12NP_A::VALUE1 + **self == REV12NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV12NP_A::VALUE2 + **self == REV12NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV12NP_A::VALUE3 + **self == REV12NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV12NP_A::VALUE4 + **self == REV12NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV12NP`"] +impl core::ops::Deref for REV12NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV12NP` writer - Service Request Node Pointer Result Event i"] pub struct REV12NP_W<'a> { w: &'a mut W, } @@ -466,7 +535,7 @@ impl<'a> REV12NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16); + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); self.w } } @@ -489,43 +558,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV13NP`"] -pub type REV13NP_R = crate::R; +#[doc = "Field `REV13NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV13NP_R(crate::FieldReader); impl REV13NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV13NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV13NP_A::VALUE1), - 3 => Val(REV13NP_A::VALUE2), - 4 => Val(REV13NP_A::VALUE3), - 7 => Val(REV13NP_A::VALUE4), - i => Res(i), + 0 => Some(REV13NP_A::VALUE1), + 3 => Some(REV13NP_A::VALUE2), + 4 => Some(REV13NP_A::VALUE3), + 7 => Some(REV13NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV13NP_A::VALUE1 + **self == REV13NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV13NP_A::VALUE2 + **self == REV13NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV13NP_A::VALUE3 + **self == REV13NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV13NP_A::VALUE4 + **self == REV13NP_A::VALUE4 } } -#[doc = "Write proxy for field `REV13NP`"] +impl core::ops::Deref for REV13NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REV13NP` writer - Service Request Node Pointer Result Event i"] pub struct REV13NP_W<'a> { w: &'a mut W, } @@ -558,7 +636,7 @@ impl<'a> REV13NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20); + self.w.bits = (self.w.bits & !(0x0f << 20)) | ((value as u32 & 0x0f) << 20); self.w } } @@ -581,43 +659,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV14NP`"] -pub type REV14NP_R = crate::R; +#[doc = "Field `REV14NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV14NP_R(crate::FieldReader); impl REV14NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV14NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV14NP_A::VALUE1), - 3 => Val(REV14NP_A::VALUE2), - 4 => Val(REV14NP_A::VALUE3), - 7 => Val(REV14NP_A::VALUE4), - i => Res(i), + 0 => Some(REV14NP_A::VALUE1), + 3 => Some(REV14NP_A::VALUE2), + 4 => Some(REV14NP_A::VALUE3), + 7 => Some(REV14NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV14NP_A::VALUE1 + **self == REV14NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV14NP_A::VALUE2 + **self == REV14NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV14NP_A::VALUE3 + **self == REV14NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV14NP_A::VALUE4 + **self == REV14NP_A::VALUE4 + } +} +impl core::ops::Deref for REV14NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV14NP`"] +#[doc = "Field `REV14NP` writer - Service Request Node Pointer Result Event i"] pub struct REV14NP_W<'a> { w: &'a mut W, } @@ -650,7 +737,7 @@ impl<'a> REV14NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24); + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); self.w } } @@ -673,43 +760,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `REV15NP`"] -pub type REV15NP_R = crate::R; +#[doc = "Field `REV15NP` reader - Service Request Node Pointer Result Event i"] +pub struct REV15NP_R(crate::FieldReader); impl REV15NP_R { + pub(crate) fn new(bits: u8) -> Self { + REV15NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(REV15NP_A::VALUE1), - 3 => Val(REV15NP_A::VALUE2), - 4 => Val(REV15NP_A::VALUE3), - 7 => Val(REV15NP_A::VALUE4), - i => Res(i), + 0 => Some(REV15NP_A::VALUE1), + 3 => Some(REV15NP_A::VALUE2), + 4 => Some(REV15NP_A::VALUE3), + 7 => Some(REV15NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == REV15NP_A::VALUE1 + **self == REV15NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == REV15NP_A::VALUE2 + **self == REV15NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == REV15NP_A::VALUE3 + **self == REV15NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == REV15NP_A::VALUE4 + **self == REV15NP_A::VALUE4 + } +} +impl core::ops::Deref for REV15NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `REV15NP`"] +#[doc = "Field `REV15NP` writer - Service Request Node Pointer Result Event i"] pub struct REV15NP_W<'a> { w: &'a mut W, } @@ -742,7 +838,7 @@ impl<'a> REV15NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28); + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); self.w } } @@ -829,4 +925,30 @@ impl W { pub fn rev15np(&mut self) -> REV15NP_W { REV15NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result Event Node Pointer Register 1\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 [revnp1](index.html) module"] +pub struct REVNP1_SPEC; +impl crate::RegisterSpec for REVNP1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [revnp1::R](R) reader structure"] +impl crate::Readable for REVNP1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [revnp1::W](W) writer structure"] +impl crate::Writable for REVNP1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REVNP1 to value 0"] +impl crate::Resettable for REVNP1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/sefclr.rs b/src/vadc_g0/sefclr.rs index 04102d70..bbaa14fa 100644 --- a/src/vadc_g0/sefclr.rs +++ b/src/vadc_g0/sefclr.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register SEFCLR"] -pub type W = crate::W; -#[doc = "Register SEFCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::SEFCLR { - type Type = u32; +#[doc = "Register `SEFCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Clear Source Event 0/1\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SEV0`"] +#[doc = "Field `SEV0` writer - Clear Source Event 0/1"] pub struct SEV0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> SEV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEV0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> SEV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `SEV1`"] +#[doc = "Field `SEV1` writer - Clear Source Event 0/1"] pub struct SEV1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> SEV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEV1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> SEV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -125,4 +132,26 @@ impl W { pub fn sev1(&mut self) -> SEV1_W { SEV1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Event Flag Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sefclr](index.html) module"] +pub struct SEFCLR_SPEC; +impl crate::RegisterSpec for SEFCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [sefclr::W](W) writer structure"] +impl crate::Writable for SEFCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SEFCLR to value 0"] +impl crate::Resettable for SEFCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/seflag.rs b/src/vadc_g0/seflag.rs index 6ea7b057..72e82ae0 100644 --- a/src/vadc_g0/seflag.rs +++ b/src/vadc_g0/seflag.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SEFLAG"] -pub type R = crate::R; -#[doc = "Writer for register SEFLAG"] -pub type W = crate::W; -#[doc = "Register SEFLAG `reset()`'s with value 0"] -impl crate::ResetValue for super::SEFLAG { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SEFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SEFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Source Event 0/1\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SEV0`"] -pub type SEV0_R = crate::R; +#[doc = "Field `SEV0` reader - Source Event 0/1"] +pub struct SEV0_R(crate::FieldReader); impl SEV0_R { + pub(crate) fn new(bits: bool) -> Self { + SEV0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SEV0_A { @@ -38,15 +65,22 @@ impl SEV0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEV0_A::VALUE1 + **self == SEV0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEV0_A::VALUE2 + **self == SEV0_A::VALUE2 } } -#[doc = "Write proxy for field `SEV0`"] +impl core::ops::Deref for SEV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEV0` writer - Source Event 0/1"] pub struct SEV0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> SEV0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEV0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No source event"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> SEV0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `SEV1`"] -pub type SEV1_R = crate::R; +#[doc = "Field `SEV1` reader - Source Event 0/1"] +pub struct SEV1_R(crate::FieldReader); impl SEV1_R { + pub(crate) fn new(bits: bool) -> Self { + SEV1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SEV1_A { @@ -113,15 +148,22 @@ impl SEV1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEV1_A::VALUE1 + **self == SEV1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEV1_A::VALUE2 + **self == SEV1_A::VALUE2 + } +} +impl core::ops::Deref for SEV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SEV1`"] +#[doc = "Field `SEV1` writer - Source Event 0/1"] pub struct SEV1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> SEV1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SEV1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No source event"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> SEV1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -183,4 +223,30 @@ impl W { pub fn sev1(&mut self) -> SEV1_W { SEV1_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Event Flag Register\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 [seflag](index.html) module"] +pub struct SEFLAG_SPEC; +impl crate::RegisterSpec for SEFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [seflag::R](R) reader structure"] +impl crate::Readable for SEFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [seflag::W](W) writer structure"] +impl crate::Writable for SEFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SEFLAG to value 0"] +impl crate::Resettable for SEFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/sevnp.rs b/src/vadc_g0/sevnp.rs index 34c485cc..c9f7e637 100644 --- a/src/vadc_g0/sevnp.rs +++ b/src/vadc_g0/sevnp.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SEVNP"] -pub type R = crate::R; -#[doc = "Writer for register SEVNP"] -pub type W = crate::W; -#[doc = "Register SEVNP `reset()`'s with value 0"] -impl crate::ResetValue for super::SEVNP { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SEVNP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SEVNP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Service Request Node Pointer Source Event i\n\nValue on reset: 0"] @@ -29,43 +53,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SEV0NP`"] -pub type SEV0NP_R = crate::R; +#[doc = "Field `SEV0NP` reader - Service Request Node Pointer Source Event i"] +pub struct SEV0NP_R(crate::FieldReader); impl SEV0NP_R { + pub(crate) fn new(bits: u8) -> Self { + SEV0NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SEV0NP_A::VALUE1), - 3 => Val(SEV0NP_A::VALUE2), - 4 => Val(SEV0NP_A::VALUE3), - 7 => Val(SEV0NP_A::VALUE4), - i => Res(i), + 0 => Some(SEV0NP_A::VALUE1), + 3 => Some(SEV0NP_A::VALUE2), + 4 => Some(SEV0NP_A::VALUE3), + 7 => Some(SEV0NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEV0NP_A::VALUE1 + **self == SEV0NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEV0NP_A::VALUE2 + **self == SEV0NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SEV0NP_A::VALUE3 + **self == SEV0NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SEV0NP_A::VALUE4 + **self == SEV0NP_A::VALUE4 } } -#[doc = "Write proxy for field `SEV0NP`"] +impl core::ops::Deref for SEV0NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEV0NP` writer - Service Request Node Pointer Source Event i"] pub struct SEV0NP_W<'a> { w: &'a mut W, } @@ -98,7 +131,7 @@ impl<'a> SEV0NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } @@ -121,43 +154,52 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `SEV1NP`"] -pub type SEV1NP_R = crate::R; +#[doc = "Field `SEV1NP` reader - Service Request Node Pointer Source Event i"] +pub struct SEV1NP_R(crate::FieldReader); impl SEV1NP_R { + pub(crate) fn new(bits: u8) -> Self { + SEV1NP_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> crate::Variant { - use crate::Variant::*; + pub fn variant(&self) -> Option { match self.bits { - 0 => Val(SEV1NP_A::VALUE1), - 3 => Val(SEV1NP_A::VALUE2), - 4 => Val(SEV1NP_A::VALUE3), - 7 => Val(SEV1NP_A::VALUE4), - i => Res(i), + 0 => Some(SEV1NP_A::VALUE1), + 3 => Some(SEV1NP_A::VALUE2), + 4 => Some(SEV1NP_A::VALUE3), + 7 => Some(SEV1NP_A::VALUE4), + _ => None, } } #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == SEV1NP_A::VALUE1 + **self == SEV1NP_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == SEV1NP_A::VALUE2 + **self == SEV1NP_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == SEV1NP_A::VALUE3 + **self == SEV1NP_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == SEV1NP_A::VALUE4 + **self == SEV1NP_A::VALUE4 + } +} +impl core::ops::Deref for SEV1NP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `SEV1NP`"] +#[doc = "Field `SEV1NP` writer - Service Request Node Pointer Source Event i"] pub struct SEV1NP_W<'a> { w: &'a mut W, } @@ -190,7 +232,7 @@ impl<'a> SEV1NP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4); + self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } @@ -217,4 +259,30 @@ impl W { pub fn sev1np(&mut self) -> SEV1NP_W { SEV1NP_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Source Event Node Pointer Register\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 [sevnp](index.html) module"] +pub struct SEVNP_SPEC; +impl crate::RegisterSpec for SEVNP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sevnp::R](R) reader structure"] +impl crate::Readable for SEVNP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sevnp::W](W) writer structure"] +impl crate::Writable for SEVNP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SEVNP to value 0"] +impl crate::Resettable for SEVNP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/sract.rs b/src/vadc_g0/sract.rs index 4a3264ea..75d8a11f 100644 --- a/src/vadc_g0/sract.rs +++ b/src/vadc_g0/sract.rs @@ -1,11 +1,22 @@ -#[doc = "Writer for register SRACT"] -pub type W = crate::W; -#[doc = "Register SRACT `reset()`'s with value 0"] -impl crate::ResetValue for super::SRACT { - type Type = u32; +#[doc = "Register `SRACT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Activate Group Service Request Node 0\n\nValue on reset: 0"] @@ -22,7 +33,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AGSR0`"] +#[doc = "Field `AGSR0` writer - Activate Group Service Request Node 0"] pub struct AGSR0_W<'a> { w: &'a mut W, } @@ -30,9 +41,7 @@ impl<'a> AGSR0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AGSR0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -57,7 +66,7 @@ impl<'a> AGSR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -75,7 +84,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AGSR1`"] +#[doc = "Field `AGSR1` writer - Activate Group Service Request Node 1"] pub struct AGSR1_W<'a> { w: &'a mut W, } @@ -83,9 +92,7 @@ impl<'a> AGSR1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AGSR1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -110,7 +117,7 @@ impl<'a> AGSR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -128,7 +135,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AGSR2`"] +#[doc = "Field `AGSR2` writer - Activate Group Service Request Node 2"] pub struct AGSR2_W<'a> { w: &'a mut W, } @@ -136,9 +143,7 @@ impl<'a> AGSR2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AGSR2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -163,7 +168,7 @@ impl<'a> AGSR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -181,7 +186,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `AGSR3`"] +#[doc = "Field `AGSR3` writer - Activate Group Service Request Node 3"] pub struct AGSR3_W<'a> { w: &'a mut W, } @@ -189,9 +194,7 @@ impl<'a> AGSR3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AGSR3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -216,7 +219,7 @@ impl<'a> AGSR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -234,7 +237,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ASSR0`"] +#[doc = "Field `ASSR0` writer - Activate Shared Service Request Node 0"] pub struct ASSR0_W<'a> { w: &'a mut W, } @@ -242,9 +245,7 @@ impl<'a> ASSR0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSR0_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -269,7 +270,7 @@ impl<'a> ASSR0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -287,7 +288,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ASSR1`"] +#[doc = "Field `ASSR1` writer - Activate Shared Service Request Node 1"] pub struct ASSR1_W<'a> { w: &'a mut W, } @@ -295,9 +296,7 @@ impl<'a> ASSR1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSR1_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -322,7 +321,7 @@ impl<'a> ASSR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -340,7 +339,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ASSR2`"] +#[doc = "Field `ASSR2` writer - Activate Shared Service Request Node 2"] pub struct ASSR2_W<'a> { w: &'a mut W, } @@ -348,9 +347,7 @@ impl<'a> ASSR2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSR2_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -375,7 +372,7 @@ impl<'a> ASSR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -393,7 +390,7 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Write proxy for field `ASSR3`"] +#[doc = "Field `ASSR3` writer - Activate Shared Service Request Node 3"] pub struct ASSR3_W<'a> { w: &'a mut W, } @@ -401,9 +398,7 @@ impl<'a> ASSR3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ASSR3_AW) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No action"] #[inline(always)] @@ -428,7 +423,7 @@ impl<'a> ASSR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -473,4 +468,26 @@ impl W { pub fn assr3(&mut self) -> ASSR3_W { ASSR3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Service Request Software Activation Trigger\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sract](index.html) module"] +pub struct SRACT_SPEC; +impl crate::RegisterSpec for SRACT_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [sract::W](W) writer structure"] +impl crate::Writable for SRACT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRACT to value 0"] +impl crate::Resettable for SRACT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/synctr.rs b/src/vadc_g0/synctr.rs index ea062199..beac566e 100644 --- a/src/vadc_g0/synctr.rs +++ b/src/vadc_g0/synctr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register SYNCTR"] -pub type R = crate::R; -#[doc = "Writer for register SYNCTR"] -pub type W = crate::W; -#[doc = "Register SYNCTR `reset()`'s with value 0"] -impl crate::ResetValue for super::SYNCTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `SYNCTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SYNCTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Start Selection\n\nValue on reset: 0"] @@ -29,9 +53,12 @@ impl From for u8 { variant as _ } } -#[doc = "Reader of field `STSEL`"] -pub type STSEL_R = crate::R; +#[doc = "Field `STSEL` reader - Start Selection"] +pub struct STSEL_R(crate::FieldReader); impl STSEL_R { + pub(crate) fn new(bits: u8) -> Self { + STSEL_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STSEL_A { @@ -46,25 +73,32 @@ impl STSEL_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == STSEL_A::VALUE1 + **self == STSEL_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == STSEL_A::VALUE2 + **self == STSEL_A::VALUE2 } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { - *self == STSEL_A::VALUE3 + **self == STSEL_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { - *self == STSEL_A::VALUE4 + **self == STSEL_A::VALUE4 } } -#[doc = "Write proxy for field `STSEL`"] +impl core::ops::Deref for STSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STSEL` writer - Start Selection"] pub struct STSEL_W<'a> { w: &'a mut W, } @@ -72,9 +106,7 @@ impl<'a> STSEL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: STSEL_A) -> &'a mut W { - { - self.bits(variant.into()) - } + self.bits(variant.into()) } #[doc = "Kernel is synchronization master: Use own bitfield GxARBCFG.ANONC"] #[inline(always)] @@ -99,7 +131,7 @@ impl<'a> STSEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); self.w } } @@ -117,9 +149,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EVALR1`"] -pub type EVALR1_R = crate::R; +#[doc = "Field `EVALR1` reader - Evaluate Ready Input Rx"] +pub struct EVALR1_R(crate::FieldReader); impl EVALR1_R { + pub(crate) fn new(bits: bool) -> Self { + EVALR1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EVALR1_A { @@ -131,15 +166,22 @@ impl EVALR1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EVALR1_A::VALUE1 + **self == EVALR1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EVALR1_A::VALUE2 + **self == EVALR1_A::VALUE2 } } -#[doc = "Write proxy for field `EVALR1`"] +impl core::ops::Deref for EVALR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EVALR1` writer - Evaluate Ready Input Rx"] pub struct EVALR1_W<'a> { w: &'a mut W, } @@ -147,9 +189,7 @@ impl<'a> EVALR1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EVALR1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No ready input control"] #[inline(always)] @@ -174,7 +214,7 @@ impl<'a> EVALR1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -192,9 +232,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EVALR2`"] -pub type EVALR2_R = crate::R; +#[doc = "Field `EVALR2` reader - Evaluate Ready Input Rx"] +pub struct EVALR2_R(crate::FieldReader); impl EVALR2_R { + pub(crate) fn new(bits: bool) -> Self { + EVALR2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EVALR2_A { @@ -206,15 +249,22 @@ impl EVALR2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EVALR2_A::VALUE1 + **self == EVALR2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EVALR2_A::VALUE2 + **self == EVALR2_A::VALUE2 + } +} +impl core::ops::Deref for EVALR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EVALR2`"] +#[doc = "Field `EVALR2` writer - Evaluate Ready Input Rx"] pub struct EVALR2_W<'a> { w: &'a mut W, } @@ -222,9 +272,7 @@ impl<'a> EVALR2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EVALR2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No ready input control"] #[inline(always)] @@ -249,7 +297,7 @@ impl<'a> EVALR2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -267,9 +315,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `EVALR3`"] -pub type EVALR3_R = crate::R; +#[doc = "Field `EVALR3` reader - Evaluate Ready Input Rx"] +pub struct EVALR3_R(crate::FieldReader); impl EVALR3_R { + pub(crate) fn new(bits: bool) -> Self { + EVALR3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EVALR3_A { @@ -281,15 +332,22 @@ impl EVALR3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == EVALR3_A::VALUE1 + **self == EVALR3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == EVALR3_A::VALUE2 + **self == EVALR3_A::VALUE2 + } +} +impl core::ops::Deref for EVALR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `EVALR3`"] +#[doc = "Field `EVALR3` writer - Evaluate Ready Input Rx"] pub struct EVALR3_W<'a> { w: &'a mut W, } @@ -297,9 +355,7 @@ impl<'a> EVALR3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EVALR3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "No ready input control"] #[inline(always)] @@ -324,7 +380,7 @@ impl<'a> EVALR3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -371,4 +427,30 @@ impl W { pub fn evalr3(&mut self) -> EVALR3_W { EVALR3_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Synchronization Control Register\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 [synctr](index.html) module"] +pub struct SYNCTR_SPEC; +impl crate::RegisterSpec for SYNCTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [synctr::R](R) reader structure"] +impl crate::Readable for SYNCTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [synctr::W](W) writer structure"] +impl crate::Writable for SYNCTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYNCTR to value 0"] +impl crate::Resettable for SYNCTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/vadc_g0/vfr.rs b/src/vadc_g0/vfr.rs index bc520351..dfa3472a 100644 --- a/src/vadc_g0/vfr.rs +++ b/src/vadc_g0/vfr.rs @@ -1,13 +1,37 @@ -#[doc = "Reader of register VFR"] -pub type R = crate::R; -#[doc = "Writer for register VFR"] -pub type W = crate::W; -#[doc = "Register VFR `reset()`'s with value 0"] -impl crate::ResetValue for super::VFR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `VFR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `VFR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } #[doc = "Valid Flag of Result Register x\n\nValue on reset: 0"] @@ -24,9 +48,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF0`"] -pub type VF0_R = crate::R; +#[doc = "Field `VF0` reader - Valid Flag of Result Register x"] +pub struct VF0_R(crate::FieldReader); impl VF0_R { + pub(crate) fn new(bits: bool) -> Self { + VF0_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF0_A { @@ -38,15 +65,22 @@ impl VF0_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF0_A::VALUE1 + **self == VF0_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF0_A::VALUE2 + **self == VF0_A::VALUE2 } } -#[doc = "Write proxy for field `VF0`"] +impl core::ops::Deref for VF0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF0` writer - Valid Flag of Result Register x"] pub struct VF0_W<'a> { w: &'a mut W, } @@ -54,9 +88,7 @@ impl<'a> VF0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF0_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -81,7 +113,7 @@ impl<'a> VF0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -99,9 +131,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF1`"] -pub type VF1_R = crate::R; +#[doc = "Field `VF1` reader - Valid Flag of Result Register x"] +pub struct VF1_R(crate::FieldReader); impl VF1_R { + pub(crate) fn new(bits: bool) -> Self { + VF1_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF1_A { @@ -113,15 +148,22 @@ impl VF1_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF1_A::VALUE1 + **self == VF1_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF1_A::VALUE2 + **self == VF1_A::VALUE2 } } -#[doc = "Write proxy for field `VF1`"] +impl core::ops::Deref for VF1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF1` writer - Valid Flag of Result Register x"] pub struct VF1_W<'a> { w: &'a mut W, } @@ -129,9 +171,7 @@ impl<'a> VF1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF1_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -156,7 +196,7 @@ impl<'a> VF1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } @@ -174,9 +214,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF2`"] -pub type VF2_R = crate::R; +#[doc = "Field `VF2` reader - Valid Flag of Result Register x"] +pub struct VF2_R(crate::FieldReader); impl VF2_R { + pub(crate) fn new(bits: bool) -> Self { + VF2_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF2_A { @@ -188,15 +231,22 @@ impl VF2_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF2_A::VALUE1 + **self == VF2_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF2_A::VALUE2 + **self == VF2_A::VALUE2 + } +} +impl core::ops::Deref for VF2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF2`"] +#[doc = "Field `VF2` writer - Valid Flag of Result Register x"] pub struct VF2_W<'a> { w: &'a mut W, } @@ -204,9 +254,7 @@ impl<'a> VF2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF2_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -231,7 +279,7 @@ impl<'a> VF2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); self.w } } @@ -249,9 +297,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF3`"] -pub type VF3_R = crate::R; +#[doc = "Field `VF3` reader - Valid Flag of Result Register x"] +pub struct VF3_R(crate::FieldReader); impl VF3_R { + pub(crate) fn new(bits: bool) -> Self { + VF3_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF3_A { @@ -263,15 +314,22 @@ impl VF3_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF3_A::VALUE1 + **self == VF3_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF3_A::VALUE2 + **self == VF3_A::VALUE2 + } +} +impl core::ops::Deref for VF3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF3`"] +#[doc = "Field `VF3` writer - Valid Flag of Result Register x"] pub struct VF3_W<'a> { w: &'a mut W, } @@ -279,9 +337,7 @@ impl<'a> VF3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF3_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -306,7 +362,7 @@ impl<'a> VF3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); self.w } } @@ -324,9 +380,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF4`"] -pub type VF4_R = crate::R; +#[doc = "Field `VF4` reader - Valid Flag of Result Register x"] +pub struct VF4_R(crate::FieldReader); impl VF4_R { + pub(crate) fn new(bits: bool) -> Self { + VF4_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF4_A { @@ -338,15 +397,22 @@ impl VF4_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF4_A::VALUE1 + **self == VF4_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF4_A::VALUE2 + **self == VF4_A::VALUE2 + } +} +impl core::ops::Deref for VF4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF4`"] +#[doc = "Field `VF4` writer - Valid Flag of Result Register x"] pub struct VF4_W<'a> { w: &'a mut W, } @@ -354,9 +420,7 @@ impl<'a> VF4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF4_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -381,7 +445,7 @@ impl<'a> VF4_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } @@ -399,9 +463,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF5`"] -pub type VF5_R = crate::R; +#[doc = "Field `VF5` reader - Valid Flag of Result Register x"] +pub struct VF5_R(crate::FieldReader); impl VF5_R { + pub(crate) fn new(bits: bool) -> Self { + VF5_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF5_A { @@ -413,15 +480,22 @@ impl VF5_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF5_A::VALUE1 + **self == VF5_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF5_A::VALUE2 + **self == VF5_A::VALUE2 + } +} +impl core::ops::Deref for VF5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF5`"] +#[doc = "Field `VF5` writer - Valid Flag of Result Register x"] pub struct VF5_W<'a> { w: &'a mut W, } @@ -429,9 +503,7 @@ impl<'a> VF5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF5_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -456,7 +528,7 @@ impl<'a> VF5_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); self.w } } @@ -474,9 +546,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF6`"] -pub type VF6_R = crate::R; +#[doc = "Field `VF6` reader - Valid Flag of Result Register x"] +pub struct VF6_R(crate::FieldReader); impl VF6_R { + pub(crate) fn new(bits: bool) -> Self { + VF6_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF6_A { @@ -488,15 +563,22 @@ impl VF6_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF6_A::VALUE1 + **self == VF6_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF6_A::VALUE2 + **self == VF6_A::VALUE2 } } -#[doc = "Write proxy for field `VF6`"] +impl core::ops::Deref for VF6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF6` writer - Valid Flag of Result Register x"] pub struct VF6_W<'a> { w: &'a mut W, } @@ -504,9 +586,7 @@ impl<'a> VF6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF6_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -531,7 +611,7 @@ impl<'a> VF6_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); self.w } } @@ -549,9 +629,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF7`"] -pub type VF7_R = crate::R; +#[doc = "Field `VF7` reader - Valid Flag of Result Register x"] +pub struct VF7_R(crate::FieldReader); impl VF7_R { + pub(crate) fn new(bits: bool) -> Self { + VF7_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF7_A { @@ -563,15 +646,22 @@ impl VF7_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF7_A::VALUE1 + **self == VF7_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF7_A::VALUE2 + **self == VF7_A::VALUE2 } } -#[doc = "Write proxy for field `VF7`"] +impl core::ops::Deref for VF7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF7` writer - Valid Flag of Result Register x"] pub struct VF7_W<'a> { w: &'a mut W, } @@ -579,9 +669,7 @@ impl<'a> VF7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF7_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -606,7 +694,7 @@ impl<'a> VF7_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); self.w } } @@ -624,9 +712,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF8`"] -pub type VF8_R = crate::R; +#[doc = "Field `VF8` reader - Valid Flag of Result Register x"] +pub struct VF8_R(crate::FieldReader); impl VF8_R { + pub(crate) fn new(bits: bool) -> Self { + VF8_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF8_A { @@ -638,15 +729,22 @@ impl VF8_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF8_A::VALUE1 + **self == VF8_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF8_A::VALUE2 + **self == VF8_A::VALUE2 } } -#[doc = "Write proxy for field `VF8`"] +impl core::ops::Deref for VF8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF8` writer - Valid Flag of Result Register x"] pub struct VF8_W<'a> { w: &'a mut W, } @@ -654,9 +752,7 @@ impl<'a> VF8_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF8_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -681,7 +777,7 @@ impl<'a> VF8_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); self.w } } @@ -699,9 +795,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF9`"] -pub type VF9_R = crate::R; +#[doc = "Field `VF9` reader - Valid Flag of Result Register x"] +pub struct VF9_R(crate::FieldReader); impl VF9_R { + pub(crate) fn new(bits: bool) -> Self { + VF9_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF9_A { @@ -713,15 +812,22 @@ impl VF9_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF9_A::VALUE1 + **self == VF9_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF9_A::VALUE2 + **self == VF9_A::VALUE2 + } +} +impl core::ops::Deref for VF9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF9`"] +#[doc = "Field `VF9` writer - Valid Flag of Result Register x"] pub struct VF9_W<'a> { w: &'a mut W, } @@ -729,9 +835,7 @@ impl<'a> VF9_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF9_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -756,7 +860,7 @@ impl<'a> VF9_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); self.w } } @@ -774,9 +878,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF10`"] -pub type VF10_R = crate::R; +#[doc = "Field `VF10` reader - Valid Flag of Result Register x"] +pub struct VF10_R(crate::FieldReader); impl VF10_R { + pub(crate) fn new(bits: bool) -> Self { + VF10_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF10_A { @@ -788,15 +895,22 @@ impl VF10_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF10_A::VALUE1 + **self == VF10_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF10_A::VALUE2 + **self == VF10_A::VALUE2 } } -#[doc = "Write proxy for field `VF10`"] +impl core::ops::Deref for VF10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF10` writer - Valid Flag of Result Register x"] pub struct VF10_W<'a> { w: &'a mut W, } @@ -804,9 +918,7 @@ impl<'a> VF10_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF10_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -831,7 +943,7 @@ impl<'a> VF10_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); self.w } } @@ -849,9 +961,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF11`"] -pub type VF11_R = crate::R; +#[doc = "Field `VF11` reader - Valid Flag of Result Register x"] +pub struct VF11_R(crate::FieldReader); impl VF11_R { + pub(crate) fn new(bits: bool) -> Self { + VF11_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF11_A { @@ -863,15 +978,22 @@ impl VF11_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF11_A::VALUE1 + **self == VF11_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF11_A::VALUE2 + **self == VF11_A::VALUE2 } } -#[doc = "Write proxy for field `VF11`"] +impl core::ops::Deref for VF11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF11` writer - Valid Flag of Result Register x"] pub struct VF11_W<'a> { w: &'a mut W, } @@ -879,9 +1001,7 @@ impl<'a> VF11_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF11_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -906,7 +1026,7 @@ impl<'a> VF11_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); self.w } } @@ -924,9 +1044,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF12`"] -pub type VF12_R = crate::R; +#[doc = "Field `VF12` reader - Valid Flag of Result Register x"] +pub struct VF12_R(crate::FieldReader); impl VF12_R { + pub(crate) fn new(bits: bool) -> Self { + VF12_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF12_A { @@ -938,15 +1061,22 @@ impl VF12_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF12_A::VALUE1 + **self == VF12_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF12_A::VALUE2 + **self == VF12_A::VALUE2 + } +} +impl core::ops::Deref for VF12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 } } -#[doc = "Write proxy for field `VF12`"] +#[doc = "Field `VF12` writer - Valid Flag of Result Register x"] pub struct VF12_W<'a> { w: &'a mut W, } @@ -954,9 +1084,7 @@ impl<'a> VF12_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF12_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -981,7 +1109,7 @@ impl<'a> VF12_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); self.w } } @@ -999,9 +1127,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF13`"] -pub type VF13_R = crate::R; +#[doc = "Field `VF13` reader - Valid Flag of Result Register x"] +pub struct VF13_R(crate::FieldReader); impl VF13_R { + pub(crate) fn new(bits: bool) -> Self { + VF13_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF13_A { @@ -1013,15 +1144,22 @@ impl VF13_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF13_A::VALUE1 + **self == VF13_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF13_A::VALUE2 + **self == VF13_A::VALUE2 } } -#[doc = "Write proxy for field `VF13`"] +impl core::ops::Deref for VF13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF13` writer - Valid Flag of Result Register x"] pub struct VF13_W<'a> { w: &'a mut W, } @@ -1029,9 +1167,7 @@ impl<'a> VF13_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF13_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -1056,7 +1192,7 @@ impl<'a> VF13_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13); + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); self.w } } @@ -1074,9 +1210,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF14`"] -pub type VF14_R = crate::R; +#[doc = "Field `VF14` reader - Valid Flag of Result Register x"] +pub struct VF14_R(crate::FieldReader); impl VF14_R { + pub(crate) fn new(bits: bool) -> Self { + VF14_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF14_A { @@ -1088,15 +1227,22 @@ impl VF14_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF14_A::VALUE1 + **self == VF14_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF14_A::VALUE2 + **self == VF14_A::VALUE2 } } -#[doc = "Write proxy for field `VF14`"] +impl core::ops::Deref for VF14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF14` writer - Valid Flag of Result Register x"] pub struct VF14_W<'a> { w: &'a mut W, } @@ -1104,9 +1250,7 @@ impl<'a> VF14_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF14_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -1131,7 +1275,7 @@ impl<'a> VF14_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); self.w } } @@ -1149,9 +1293,12 @@ impl From for bool { variant as u8 != 0 } } -#[doc = "Reader of field `VF15`"] -pub type VF15_R = crate::R; +#[doc = "Field `VF15` reader - Valid Flag of Result Register x"] +pub struct VF15_R(crate::FieldReader); impl VF15_R { + pub(crate) fn new(bits: bool) -> Self { + VF15_R(crate::FieldReader::new(bits)) + } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> VF15_A { @@ -1163,15 +1310,22 @@ impl VF15_R { #[doc = "Checks if the value of the field is `VALUE1`"] #[inline(always)] pub fn is_value1(&self) -> bool { - *self == VF15_A::VALUE1 + **self == VF15_A::VALUE1 } #[doc = "Checks if the value of the field is `VALUE2`"] #[inline(always)] pub fn is_value2(&self) -> bool { - *self == VF15_A::VALUE2 + **self == VF15_A::VALUE2 } } -#[doc = "Write proxy for field `VF15`"] +impl core::ops::Deref for VF15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VF15` writer - Valid Flag of Result Register x"] pub struct VF15_W<'a> { w: &'a mut W, } @@ -1179,9 +1333,7 @@ impl<'a> VF15_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: VF15_A) -> &'a mut W { - { - self.bit(variant.into()) - } + self.bit(variant.into()) } #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] @@ -1206,7 +1358,7 @@ impl<'a> VF15_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); self.w } } @@ -1373,4 +1525,30 @@ impl W { pub fn vf15(&mut self) -> VF15_W { VF15_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Valid Flag Register\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 [vfr](index.html) module"] +pub struct VFR_SPEC; +impl crate::RegisterSpec for VFR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [vfr::R](R) reader structure"] +impl crate::Readable for VFR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [vfr::W](W) writer structure"] +impl crate::Writable for VFR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets VFR to value 0"] +impl crate::Resettable for VFR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/wdt.rs b/src/wdt.rs index d293cae0..a6effb3e 100644 --- a/src/wdt.rs +++ b/src/wdt.rs @@ -2,97 +2,51 @@ #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - WDT ID Register"] - pub id: ID, + pub id: crate::Reg, #[doc = "0x04 - WDT Control Register"] - pub ctr: CTR, + pub ctr: crate::Reg, #[doc = "0x08 - WDT Service Register"] - pub srv: SRV, + pub srv: crate::Reg, #[doc = "0x0c - WDT Timer Register"] - pub tim: TIM, + pub tim: crate::Reg, #[doc = "0x10 - WDT Window Lower Bound Register"] - pub wlb: WLB, + pub wlb: crate::Reg, #[doc = "0x14 - WDT Window Upper Bound Register"] - pub wub: WUB, + pub wub: crate::Reg, #[doc = "0x18 - WDT Status Register"] - pub wdtsts: WDTSTS, + pub wdtsts: crate::Reg, #[doc = "0x1c - WDT Clear Register"] - pub wdtclr: WDTCLR, + pub wdtclr: crate::Reg, } -#[doc = "WDT ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](id) module"] -pub type ID = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _ID; -#[doc = "`read()` method returns [id::R](id::R) reader structure"] -impl crate::Readable for ID {} +#[doc = "ID register accessor: an alias for `Reg`"] +pub type ID = crate::Reg; #[doc = "WDT ID Register"] pub mod id; -#[doc = "WDT Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctr](ctr) module"] -pub type CTR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _CTR; -#[doc = "`read()` method returns [ctr::R](ctr::R) reader structure"] -impl crate::Readable for CTR {} -#[doc = "`write(|w| ..)` method takes [ctr::W](ctr::W) writer structure"] -impl crate::Writable for CTR {} +#[doc = "CTR register accessor: an alias for `Reg`"] +pub type CTR = crate::Reg; #[doc = "WDT Control Register"] pub mod ctr; -#[doc = "WDT Service Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srv](srv) module"] -pub type SRV = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _SRV; -#[doc = "`write(|w| ..)` method takes [srv::W](srv::W) writer structure"] -impl crate::Writable for SRV {} +#[doc = "SRV register accessor: an alias for `Reg`"] +pub type SRV = crate::Reg; #[doc = "WDT Service Register"] pub mod srv; -#[doc = "WDT Timer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tim](tim) module"] -pub type TIM = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _TIM; -#[doc = "`read()` method returns [tim::R](tim::R) reader structure"] -impl crate::Readable for TIM {} +#[doc = "TIM register accessor: an alias for `Reg`"] +pub type TIM = crate::Reg; #[doc = "WDT Timer Register"] pub mod tim; -#[doc = "WDT Window Lower Bound Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wlb](wlb) module"] -pub type WLB = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WLB; -#[doc = "`read()` method returns [wlb::R](wlb::R) reader structure"] -impl crate::Readable for WLB {} -#[doc = "`write(|w| ..)` method takes [wlb::W](wlb::W) writer structure"] -impl crate::Writable for WLB {} +#[doc = "WLB register accessor: an alias for `Reg`"] +pub type WLB = crate::Reg; #[doc = "WDT Window Lower Bound Register"] pub mod wlb; -#[doc = "WDT Window Upper Bound Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wub](wub) module"] -pub type WUB = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WUB; -#[doc = "`read()` method returns [wub::R](wub::R) reader structure"] -impl crate::Readable for WUB {} -#[doc = "`write(|w| ..)` method takes [wub::W](wub::W) writer structure"] -impl crate::Writable for WUB {} +#[doc = "WUB register accessor: an alias for `Reg`"] +pub type WUB = crate::Reg; #[doc = "WDT Window Upper Bound Register"] pub mod wub; -#[doc = "WDT Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtsts](wdtsts) module"] -pub type WDTSTS = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WDTSTS; -#[doc = "`read()` method returns [wdtsts::R](wdtsts::R) reader structure"] -impl crate::Readable for WDTSTS {} +#[doc = "WDTSTS register accessor: an alias for `Reg`"] +pub type WDTSTS = crate::Reg; #[doc = "WDT Status Register"] pub mod wdtsts; -#[doc = "WDT Clear Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtclr](wdtclr) module"] -pub type WDTCLR = crate::Reg; -#[allow(missing_docs)] -#[doc(hidden)] -pub struct _WDTCLR; -#[doc = "`write(|w| ..)` method takes [wdtclr::W](wdtclr::W) writer structure"] -impl crate::Writable for WDTCLR {} +#[doc = "WDTCLR register accessor: an alias for `Reg`"] +pub type WDTCLR = crate::Reg; #[doc = "WDT Clear Register"] pub mod wdtclr; diff --git a/src/wdt/ctr.rs b/src/wdt/ctr.rs index ce80555c..0a5a2492 100644 --- a/src/wdt/ctr.rs +++ b/src/wdt/ctr.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register CTR"] -pub type R = crate::R; -#[doc = "Writer for register CTR"] -pub type W = crate::W; -#[doc = "Register CTR `reset()`'s with value 0"] -impl crate::ResetValue for super::CTR { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `CTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Reader of field `ENB`"] -pub type ENB_R = crate::R; -#[doc = "Write proxy for field `ENB`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ENB` reader - Enable"] +pub struct ENB_R(crate::FieldReader); +impl ENB_R { + pub(crate) fn new(bits: bool) -> Self { + ENB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENB` writer - Enable"] pub struct ENB_W<'a> { w: &'a mut W, } @@ -30,13 +66,25 @@ impl<'a> ENB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } -#[doc = "Reader of field `PRE`"] -pub type PRE_R = crate::R; -#[doc = "Write proxy for field `PRE`"] +#[doc = "Field `PRE` reader - Pre-warning"] +pub struct PRE_R(crate::FieldReader); +impl PRE_R { + pub(crate) fn new(bits: bool) -> Self { + PRE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRE` writer - Pre-warning"] pub struct PRE_W<'a> { w: &'a mut W, } @@ -54,13 +102,25 @@ impl<'a> PRE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } -#[doc = "Reader of field `DSP`"] -pub type DSP_R = crate::R; -#[doc = "Write proxy for field `DSP`"] +#[doc = "Field `DSP` reader - Debug Suspend"] +pub struct DSP_R(crate::FieldReader); +impl DSP_R { + pub(crate) fn new(bits: bool) -> Self { + DSP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DSP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DSP` writer - Debug Suspend"] pub struct DSP_W<'a> { w: &'a mut W, } @@ -78,13 +138,25 @@ impl<'a> DSP_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); self.w } } -#[doc = "Reader of field `SPW`"] -pub type SPW_R = crate::R; -#[doc = "Write proxy for field `SPW`"] +#[doc = "Field `SPW` reader - Service Indication Pulse Width"] +pub struct SPW_R(crate::FieldReader); +impl SPW_R { + pub(crate) fn new(bits: u8) -> Self { + SPW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SPW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SPW` writer - Service Indication Pulse Width"] pub struct SPW_W<'a> { w: &'a mut W, } @@ -92,7 +164,7 @@ impl<'a> SPW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { - self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); self.w } } @@ -139,4 +211,30 @@ impl W { pub fn spw(&mut self) -> SPW_W { SPW_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Control Register\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 [ctr](index.html) module"] +pub struct CTR_SPEC; +impl crate::RegisterSpec for CTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctr::R](R) reader structure"] +impl crate::Readable for CTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctr::W](W) writer structure"] +impl crate::Writable for CTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTR to value 0"] +impl crate::Resettable for CTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/wdt/id.rs b/src/wdt/id.rs index f22f9749..7ea13ca4 100644 --- a/src/wdt/id.rs +++ b/src/wdt/id.rs @@ -1,11 +1,60 @@ -#[doc = "Reader of register ID"] -pub type R = crate::R; -#[doc = "Reader of field `MOD_REV`"] -pub type MOD_REV_R = crate::R; -#[doc = "Reader of field `MOD_TYPE`"] -pub type MOD_TYPE_R = crate::R; -#[doc = "Reader of field `MOD_NUMBER`"] -pub type MOD_NUMBER_R = crate::R; +#[doc = "Register `ID` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MOD_REV` reader - Module Revision"] +pub struct MOD_REV_R(crate::FieldReader); +impl MOD_REV_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_REV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_REV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_TYPE` reader - Module Type"] +pub struct MOD_TYPE_R(crate::FieldReader); +impl MOD_TYPE_R { + pub(crate) fn new(bits: u8) -> Self { + MOD_TYPE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_TYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MOD_NUMBER` reader - Module Number"] +pub struct MOD_NUMBER_R(crate::FieldReader); +impl MOD_NUMBER_R { + pub(crate) fn new(bits: u16) -> Self { + MOD_NUMBER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MOD_NUMBER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -23,3 +72,19 @@ impl R { MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16) } } +#[doc = "WDT ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"] +pub struct ID_SPEC; +impl crate::RegisterSpec for ID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [id::R](R) reader structure"] +impl crate::Readable for ID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ID to value 0x00ad_c000"] +impl crate::Resettable for ID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x00ad_c000 + } +} diff --git a/src/wdt/srv.rs b/src/wdt/srv.rs index 343f1182..854eed26 100644 --- a/src/wdt/srv.rs +++ b/src/wdt/srv.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register SRV"] -pub type W = crate::W; -#[doc = "Register SRV `reset()`'s with value 0"] -impl crate::ResetValue for super::SRV { - type Type = u32; +#[doc = "Register `SRV` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `SRV`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SRV` writer - Service"] pub struct SRV_W<'a> { w: &'a mut W, } @@ -16,7 +27,7 @@ impl<'a> SRV_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -26,4 +37,26 @@ impl W { pub fn srv(&mut self) -> SRV_W { SRV_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Service Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srv](index.html) module"] +pub struct SRV_SPEC; +impl crate::RegisterSpec for SRV_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [srv::W](W) writer structure"] +impl crate::Writable for SRV_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SRV to value 0"] +impl crate::Resettable for SRV_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/wdt/tim.rs b/src/wdt/tim.rs index 53633487..959547a9 100644 --- a/src/wdt/tim.rs +++ b/src/wdt/tim.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register TIM"] -pub type R = crate::R; -#[doc = "Reader of field `TIM`"] -pub type TIM_R = crate::R; +#[doc = "Register `TIM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `TIM` reader - Timer Value"] +pub struct TIM_R(crate::FieldReader); +impl TIM_R { + pub(crate) fn new(bits: u32) -> Self { + TIM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TIM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bits 0:31 - Timer Value"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { TIM_R::new((self.bits & 0xffff_ffff) as u32) } } +#[doc = "WDT Timer Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tim](index.html) module"] +pub struct TIM_SPEC; +impl crate::RegisterSpec for TIM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tim::R](R) reader structure"] +impl crate::Readable for TIM_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TIM to value 0"] +impl crate::Resettable for TIM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/wdtclr.rs b/src/wdt/wdtclr.rs index 3ccbc23d..ded1a09b 100644 --- a/src/wdt/wdtclr.rs +++ b/src/wdt/wdtclr.rs @@ -1,14 +1,25 @@ -#[doc = "Writer for register WDTCLR"] -pub type W = crate::W; -#[doc = "Register WDTCLR `reset()`'s with value 0"] -impl crate::ResetValue for super::WDTCLR { - type Type = u32; +#[doc = "Register `WDTCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; #[inline(always)] - fn reset_value() -> Self::Type { - 0 + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } -#[doc = "Write proxy for field `ALMC`"] +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ALMC` writer - Pre-warning Alarm"] pub struct ALMC_W<'a> { w: &'a mut W, } @@ -26,7 +37,7 @@ impl<'a> ALMC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } @@ -36,4 +47,26 @@ impl W { pub fn almc(&mut self) -> ALMC_W { ALMC_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtclr](index.html) module"] +pub struct WDTCLR_SPEC; +impl crate::RegisterSpec for WDTCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [wdtclr::W](W) writer structure"] +impl crate::Writable for WDTCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WDTCLR to value 0"] +impl crate::Resettable for WDTCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/wdt/wdtsts.rs b/src/wdt/wdtsts.rs index 48b30712..7b2f2b5a 100644 --- a/src/wdt/wdtsts.rs +++ b/src/wdt/wdtsts.rs @@ -1,7 +1,32 @@ -#[doc = "Reader of register WDTSTS"] -pub type R = crate::R; -#[doc = "Reader of field `ALMS`"] -pub type ALMS_R = crate::R; +#[doc = "Register `WDTSTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ALMS` reader - Pre-warning Alarm"] +pub struct ALMS_R(crate::FieldReader); +impl ALMS_R { + pub(crate) fn new(bits: bool) -> Self { + ALMS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ALMS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} impl R { #[doc = "Bit 0 - Pre-warning Alarm"] #[inline(always)] @@ -9,3 +34,19 @@ impl R { ALMS_R::new((self.bits & 0x01) != 0) } } +#[doc = "WDT Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtsts](index.html) module"] +pub struct WDTSTS_SPEC; +impl crate::RegisterSpec for WDTSTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wdtsts::R](R) reader structure"] +impl crate::Readable for WDTSTS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets WDTSTS to value 0"] +impl crate::Resettable for WDTSTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/wlb.rs b/src/wdt/wlb.rs index 00fa1474..5dcadff2 100644 --- a/src/wdt/wlb.rs +++ b/src/wdt/wlb.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register WLB"] -pub type R = crate::R; -#[doc = "Writer for register WLB"] -pub type W = crate::W; -#[doc = "Register WLB `reset()`'s with value 0"] -impl crate::ResetValue for super::WLB { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0 +#[doc = "Register `WLB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WLB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `WLB`"] -pub type WLB_R = crate::R; -#[doc = "Write proxy for field `WLB`"] +#[doc = "Field `WLB` reader - Window Lower Bound"] +pub struct WLB_R(crate::FieldReader); +impl WLB_R { + pub(crate) fn new(bits: u32) -> Self { + WLB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WLB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WLB` writer - Window Lower Bound"] pub struct WLB_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> WLB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn wlb(&mut self) -> WLB_W { WLB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Window Lower Bound Register\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 [wlb](index.html) module"] +pub struct WLB_SPEC; +impl crate::RegisterSpec for WLB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wlb::R](R) reader structure"] +impl crate::Readable for WLB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wlb::W](W) writer structure"] +impl crate::Writable for WLB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WLB to value 0"] +impl crate::Resettable for WLB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } } diff --git a/src/wdt/wub.rs b/src/wdt/wub.rs index ea12a873..214d7d17 100644 --- a/src/wdt/wub.rs +++ b/src/wdt/wub.rs @@ -1,18 +1,54 @@ -#[doc = "Reader of register WUB"] -pub type R = crate::R; -#[doc = "Writer for register WUB"] -pub type W = crate::W; -#[doc = "Register WUB `reset()`'s with value 0xffff_ffff"] -impl crate::ResetValue for super::WUB { - type Type = u32; - #[inline(always)] - fn reset_value() -> Self::Type { - 0xffff_ffff +#[doc = "Register `WUB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WUB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) } } -#[doc = "Reader of field `WUB`"] -pub type WUB_R = crate::R; -#[doc = "Write proxy for field `WUB`"] +#[doc = "Field `WUB` reader - Window Upper Bound"] +pub struct WUB_R(crate::FieldReader); +impl WUB_R { + pub(crate) fn new(bits: u32) -> Self { + WUB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WUB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WUB` writer - Window Upper Bound"] pub struct WUB_W<'a> { w: &'a mut W, } @@ -20,7 +56,7 @@ impl<'a> WUB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { - self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } @@ -37,4 +73,30 @@ impl W { pub fn wub(&mut self) -> WUB_W { WUB_W { w: self } } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "WDT Window Upper Bound Register\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 [wub](index.html) module"] +pub struct WUB_SPEC; +impl crate::RegisterSpec for WUB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wub::R](R) reader structure"] +impl crate::Readable for WUB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wub::W](W) writer structure"] +impl crate::Writable for WUB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WUB to value 0xffff_ffff"] +impl crate::Resettable for WUB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } }